ontology-term-resolution
About
This skill resolves free-text labels to ontology term IDs and validates existing CURIEs using the EBI Ontology Lookup Service. It's essential for annotating biological metadata, preparing data for major repository submissions, and auditing or mapping ontology identifiers. Use it whenever you need to produce, verify, or manage standardized ontology terms in your applications.
Quick Install
Claude Code
Recommendednpx skills add K-Dense-AI/claude-scientific-skills -a claude-code/plugin add https://github.com/K-Dense-AI/claude-scientific-skillsgit clone https://github.com/K-Dense-AI/claude-scientific-skills.git ~/.claude/skills/ontology-term-resolutionCopy and paste this command in Claude Code to install this skill
Documentation
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.
Every ID this skill emits comes from a live OLS lookup. Every ID it is handed gets verified.
Two directions
| Direction | Script | Question answered |
|---|---|---|
| text → ID | scripts/resolve_terms.py | What is the term for "left ventricle"? |
| ID → verdict | scripts/validate_terms.py | Is EFO:0001067 real, current, and labelled what this file claims? |
Both take single values or files, emit TSV or JSON, and need no packages beyond the standard library.
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 uberon
query rank curie label ontology match_type strategy defining_ontology
liver 1 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 3
The search escalates exact (label and synonym) → token → fulltext and stops at the first
strategy that returns anything, reporting which one fired. --exact-only disables the ladder.
--branch UBERON:0000465 restricts candidates to descendants of a term.
Read match_type before using a result. exact_label and exact_synonym are safe;
partial means OLS returned its best guess for a string that does not exist as written, and
needs a human decision. unresolved is a legitimate output — see references/curation-rules.md
for the normalisations worth retrying first.
Validate existing IDs
python3 validate_terms.py UBERON:0002107 EFO:0001067 UBERON:9999999
id 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 names
Exit 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 | Home ontology no longer asserts this ID | 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 | ID and claimed label describe different things | 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.
API behaviour that will mislead you
These are verified against the live service and are the reason this skill ships scripts rather
than a recipe. 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 |
The obo_id index has holes | MONDO:0000001 is live but unindexed by obo_id; an IRI fallback is required to avoid a false not_found |
| IRIs are not all OBO PURLs | EFO and Orphanet use their own namespaces — resolve IRIs, do not template them |
| OxO is retired | Returns HTML with HTTP 200; use term cross-references or SSSOM instead |
| A branch check does not exclude cell types from anatomy | CARO puts cell under anatomical structure; constrain the prefix too |
Choosing the ontology
MONDO for disease, HP for phenotype, UBERON for tissue, CL for cell type, EFO for assay, ChEBI for
compounds, NCBITaxon for organism, PATO for sex and for normal. Prefix-to-OLS-id mappings (HP
is served as hp, Orphanet as ordo), branch roots for --branch, and the overlapping-ontology
judgement calls are in references/ontology-registry.md.
Reporting results
Give the ID and the label, and say how each was matched. A table of bare IDs cannot be reviewed. State unresolved terms explicitly rather than filling them with the nearest hit.
References
references/ols4-api.md— endpoints, parameters, response fields, and every verified trap.references/ontology-registry.md— prefix/ontology-id table, branch roots, which ontology owns which concept.references/curation-rules.md— candidate-selection procedure, normalisations to retry, auditing an existing table, obsolete terms, cross-ontology mapping.
GitHub Repository
Frequently asked questions
What is the ontology-term-resolution skill?
ontology-term-resolution is a Claude Skill by K-Dense-AI. Skills package instructions and resources that Claude loads on demand, so Claude can perform ontology-term-resolution-related tasks without extra prompting.
How do I install ontology-term-resolution?
Use the install commands on this page: add ontology-term-resolution to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does ontology-term-resolution belong to?
ontology-term-resolution is in the Development category.
Is ontology-term-resolution free to use?
Yes. ontology-term-resolution is listed on AIMCP and free to install.
Related Skills
qmd is a local search and indexing CLI tool that enables developers to index and search through local files using hybrid search combining BM25, vector embeddings, and reranking. It supports both command-line usage and MCP (Model Context Protocol) mode for integration with Claude. The tool uses Ollama for embeddings and stores indexes locally, making it ideal for searching documentation or codebases directly from the terminal.
This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.
The mcporter skill enables developers to manage and call Model Context Protocol (MCP) servers directly from Claude. It provides commands to list available servers, call their tools with arguments, and handle authentication and daemon lifecycle. Use this skill for integrating and testing MCP server functionality in your development workflow.
This skill deploys and orchestrates Vertex AI ADK agents using A2A protocol, managing AgentCard discovery, task submission, and supporting tools like Code Execution Sandbox and Memory Bank. It enables building multi-agent systems with sequential, parallel, or loop orchestration patterns in Python, Java, or Go. Use it when asked to deploy ADK agents or orchestrate agent workflows on Google Cloud.
