Skip to content

Ontology Regex Update #63

Description

@lindaxiang
Ontology Current regex Proposed regex Note
CCI ^CCI:[A-Z0-9]([0-9]{2}|[A-Z]{2}){3}(([0-9]{2}|[A-Z]{2})[A-Z0-9]?)?$ ✅ No change needed.
ECTO (Environmental conditions, treatments and exposures ontology) ^ECTO:\d{7}$ ➕ New addition.
ExO (Exposure ontology) ^ExO:\d{7}$ ✅ No change needed.
Genome annotation build/version ^(?:Ensembl \d{1,5}|RefSeq \d{1,5}|Gencode v\d{1,5})$ ✅ No change needed.
HPO ^HP:[0-9]{7}$ ✅ No change needed.
ICD-10 ^icd10:(([XVI]+)|([A-Z][0-9]+((-[A-Z][0-9]+)|(\.[0-9]))?))$ ✅ No change needed. This is WHO ICD-10 specifically, not ICD-10-CM/CA.
ICD-O-3 (topography) ^ICDO3:[C][0-9]{2}(.[0-9]{1})?$ ^ICDO3:C[0-9]{2}(\.[0-9])?$ ❌ Fix required. Unescaped . matches any character, not a literal dot.
KEGG (drug) ^kegg\.drug:D\d+$ ✅ No change needed.
LOINC ^LOINC:(\d|\w)+-\d$ ✅ No change needed.
LOINC ^LOINC:[0-9]{1,5}-[0-9]$ ^LOINC:(\d|\w)+-\d$ ❌ Fix required. Too strict (rejects real 6-digit codes).
MONDO ^MONDO:\d{7}$ ✅ No change needed.
NCIt ^NCIT:C\d+$ ^NCIT:[CRPA]\d+$ ❌ Fix required. NCIt codes can start with C, R, P, or A, not just C.
OBI ^OBI:\d{7}$ ✅ No change needed.
Orphanet ^ORPHA:C?\d+$ ➕ New addition.
PubChem (compound) ^pubchem\.compound:\d+$ ✅ No change needed.
RxNorm ^rxnorm:\d{1,8}$ ✅ No change needed.
SNOMED-CT ^snomedct:(\w+)?\d+$ ✅ No change needed.
SO ^SO:\d{7}$ ✅ No change needed.
UBERON ^UBERON:\d{7,}$ ✅ No change needed.
UCUM ⚠️ (no single regex exists) ❓ Its identifiers are free-form algebraic unit expressions (e.g. mmol.mL-1, /A/s3/cg3/T3, Cel.d-1, %), not a fixed-shape code. A simple regex can't validate UCUM; real validation needs a UCUM grammar parser, not pattern matching.
UMLS ^umls:C\d+$ ✅ No change needed.
UO ^UO:\d{7}$ ✅ No change needed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions