ontology-term-resolution – Data & Science skill for AI agents
Resolves free-text scientific labels to ontology term IDs and validates existing CURIEs against the EBI Ontology Lookup Service (OLS4). Also looks up prefixes in Bioregistry, resolves compact identifiers via Identifiers.org, maps lab shorthand with ZOOMA, and builds Ontobee term pages. Use whenever an ontology identifi
Install the ontology-term-resolution skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/ontology-term-resolution-98f6a.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /ontology-term-resolution – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/ontology-term-resolution-98f6a.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $ontology-term-resolution – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/ontology-term-resolution-98f6a.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /ontology-term-resolution – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/ontology-term-resolution-98f6a.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /ontology-term-resolution – then describe the task you want done.
SKILL.md content
Ontology Term Resolution
When to use
Any time an ontology identifier is about to be written down or trusted: annotating a metadata
column, filling a submission template, auditing a table someone else produced, or checking whether
an ID in an old file is still current.
The rule
Never write an ontology ID from memory, and never accept one without checking it.
Ontology IDs are memorable in form and arbitrary in detail. A plausible-looking UBERON:0002108
is a real term (small intestine) that is not the liver, and nothing downstream will catch the
substitution — the ID is well-formed, the ontology is right, and the metadata is silently wrong.
Reviewers cannot spot it either, which is why these errors persist into published datasets.
OLS search and ZOOMA emit candidates. Validate each selected ID with OLS term detail,
then check its definition against the sample and the target schema before accepting it.
Bioregistry, Identifiers.org, ZOOMA, and Ontobee answer prefix, landing-page, and shorthand
questions — they do not replace that OLS check.
Which service
| Question | Script | Authority |
| --- | --- | --- |
| What is the term for "left ventricle"? | scripts/resolve_terms.py | OLS |
| OLS missed lab shorthand (PBMC, WT) | scripts/map_terms.py, then validate_terms.py | ZOOMA proposes; OLS validates the term |
| Is EFO:0001067 real, current, correctly labelled? | scripts/validate_terms.py | OLS |
| Is HPO a real prefix? Does HP:notanid match the pattern? | scripts/lookup_prefix.py | Bioregistry |
| Which landing page should this CURIE open? | scripts/lookup_prefix.py | Identifiers.org + Ontobee URLs |
All four scripts take single values or files, emit TSV or JSON, and need no packages beyond the
standard library. Full traps for the non-OLS services are in references/companion-apis.md.
Resolve text to terms
cd skills/ontology-term-resolution/scripts
# one string, constrained to the ontology that should define it
python3 resolve_terms.py "liver" --ontology uberonquery rank curie iri label ontology match_type strategy defining_ontology
liver 1 UBERON:0002107 http://purl.obolibrary.org/obo/UBERON_0002107 liver uberon exact_label exact true# a column of tissue names; anything not an exact hit is reported, not guessed
python3 resolve_terms.py --input tissues.txt --ontology uberon \
--exact-only --format tsv -o resolved.tsv
# accept fuzzy fallbacks, then review the partial hits by hand
python3 resolve_terms.py "left ventrical of heart" --ontology uberon --top 3The search escalates exact (label and synonym) → token → fulltext and stops at the first
strategy that returns candidates, reporting which one fired. --exact-only disables the ladder
and locally rejects partial, related, broad, narrow, and unscoped synonym matches. Searches
are bounded candidate lists (--top), not exhaustive ambiguity checks.
--branch UBERON:0000465 uses OLS hierarchical ancestry, including part-of/develops-from.
Read match_type before using a result. exact_label and exact_synonym establish lexical
agreement (the latter also requires an exact synonym annotation), not correct sample context.
related_synonym, broad_synonym, narrow_synonym, unspecified_synonym, and partial require
curation. Validate every selected ID; search does not expose obsolescence in its records.
unresolved is a legitimate output. See references/curation-rules.md before normalising input.
Validate existing IDs
python3 validate_terms.py UBERON:0002107 EFO:0001067 UBERON:9999999id status actual_label ontology replacement detail
UBERON:0002107 ok liver uberon
EFO:0001067 obsolete obsolete_parasitic infection efo MONDO:0005135 obsolete; replaced by MONDO:0005135
UBERON:9999999 not_found no such term in the ontology this prefix namesExit code is 1 if anything failed, 0 otherwise, 2 on usage or network trouble — so it works as a
CI gate on a metadata file:
# id + label columns; catches IDs that exist but are labelled as something else
python3 validate_terms.py --input metadata.tsv --strict
# a tissue column must hold UBERON anatomical entities and nothing else
python3 validate_terms.py --input tissue_ids.tsv \
--branch UBERON:0000465 --expect-ontology uberon| Status | Meaning | Verdict |
| --- | --- | --- |
| ok | Exists, current, consistent with everything asserted | pass |
| matched_synonym | Claimed label is a synonym; primary label differs | warn |
| imported_only | No defining copy was verified in OLS | warn |
| not_a_class | Term is a property or individual | warn |
| not_found | No such term | fail |
| obsolete | Obsoleted; replacement gives the successor when one exists | fail |
| label_mismatch | Claimed label matches neither primary label nor recorded synonyms | fail |
| wrong_ontology | Right kind of ID, wrong ontology for this column | fail |
| wrong_branch | Not a descendant of the required root | fail |
| malformed_curie | Not of the form PREFIX:local | fail |
--strict promotes warnings to failures. --expect-ontology checks the identifier namespace,
so a CL term imported into UBERON cannot pass a UBERON-only column. OLS ontology ids and
Bioregistry preferred prefixes are not interchangeable (ORPHA/Orphanet uses OLS ordo).
Use --branch-relation is-a for subclass-only validation; the default hierarchical also
includes part-of/develops-from. A missing/obsolete branch root is a usage error, not a negative
scientific result. not_found means absent from this OLS lookup, not proof of global nonexistence.
Check a prefix or compact identifier
python3 lookup_prefix.py HP HPO HP:0001250 HPO:0001250query status preferred_prefix canonical_curie pattern detail
HP ok HP ^\d{7}$
HPO synonym_prefix HP ^\d{7}$ 'HPO' is a synonym of preferred prefix HP
HP:0001250 ok HP HP:0001250 ^\d{7}$
HPO:0001250 synonym_prefix HP HP:0001250 ^\d{7}$ 'HPO' is a synonym of preferred prefix HPBioregistry accepts synonym prefixes. Identifiers.org does not — HPO:0001250 is HTTP 400.
Use the preferred prefix for Bioregistry, then verify the OLS namespace/IRI. The bundled
validator handles both ORPHA:558 and OLS’s Orphanet:558; this is not a universal alias rule. Landing-page columns come from
Bioregistry mappings (providers.miriam, mappings.ontobee), not from templating that
preferred prefix: ORPHA:558 is a 400, orphanet:558 is a 200, and OBA has no Identifiers.org
namespace at all. Empty cells mean the service does not host the prefix. This script does
not say the term exists; that is still validate_terms.py.
Map lab shorthand (ZOOMA)
# after resolve_terms.py returned unresolved / partial
python3 map_terms.py PBMC --ontology cl --high-confidence-only--ontology is required by this client; it requests defining terms in the selected ontologies.
The public v2 compatibility endpoint remains supported, while current ZOOMA docs also expose v3.
HIGH/GOOD are ranking buckets, not calibrated probabilities or exact matches. The legacy safe
column and zooma_safe label mean only HIGH/GOOD; --exact-only remains an alias for the
confidence filter. evidence/source come from underlying derivedFrom provenance, because
the outer wrapper can say ZOOMA_INFERRED_FROM_CURATED even for embedding matches.
Run validate_terms.py and review the meaning before accepting a candidate.
API behaviour that will mislead you
Reviewed on 2026-10-01 against current official documentation/source and public HTTP probes.
Counts and records are lookup-date snapshots. Full detail in references/ols4-api.md.
| Trap | Consequence |
| --- | --- |
| exact=true is exact token matching | liver returns 161 hits in UBERON; adding queryFields=label returns 1 |
| /search never returns is_obsolete or term_replaced_by | Named in fieldList they are dropped silently; only term detail can answer "is this ID still current" |
| ontology=efo returns MONDO and CL hits | Ontologies import each other; filter on the CURIE prefix yourself |
| The same term appears once per importing ontology | Deduplicate on obo_id, keep is_defining_ontology: true |
| An obo_id query can miss a term | IRI fallback remains necessary for Orphanet; the former MONDO index gap is now fixed |
| obsoletes=true on the v1 search API | Currently selects obsolete-only results; the helper merges two queries when inclusion is requested |
| synonym combines scopes | iecur is
… (full content is in the download package)
Related skills
- lambda-labs – On-demand GPU cloud instances for ML training.
- pacsomatic – Prepares and launches nf-core/pacsomatic matched tumor-normal PacBio HiFi genomics…
- llama-cpp – llama.cpp local GGUF inference + HF Hub model discovery.
- paper-lookup – Searches 18 scholarly APIs for papers, preprints, citations, open-access full text…
- base – Database management, forms, reports, and data operations with LibreOffice Base.
- parallel-web – Uses Parallel CLI for web search, URL extraction, deep research, structured data…
- binary-analysis-patterns – Comprehensive patterns and techniques for analyzing compiled binaries, understanding…
- preference-optimization – Align a fine-tuned model with preference data using DPO, ORPO, KTO, or SimPO. Use when…