Skip to content
Skillpedia
Documentation51k · #1919

ontology-term-resolution

Helps your agent find and validate scientific term identifiers. It's useful for ensuring accuracy and consistency when annotating biological data.

What it does

This tool helps find and verify scientific term identifiers. It converts descriptive names into unique codes (IDs) and confirms if existing codes are valid and current.

When to use it

  • ✓When annotating data with scientific terms.
  • ✓When filling out data submission forms.
  • ✓When checking the validity of codes in old files.

Example of what to ask your AI

“Find the ID for 'left ventricle' in the UBERON ontology.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/ontology-term-resolution/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/ontology-term-resolution/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool searches scientific databases for terms you describe or verifies codes you provide. It uses services like OLS and Bioregistry to ensure identifiers are correct and up-to-date.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add K-Dense-AI/scientific-agent-skills --skill ontology-term-resolution

Or download just the file:

curl -L https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/main/skills/ontology-term-resolution/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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 uberon
query   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 3

The 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: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

…
FAQ

What is an 'ontology ID'?

It is a unique, standardized code that represents a specific scientific concept, such as a cell type, disease, or body part.

Why is it important to check IDs?

Incorrect or outdated IDs can lead to errors in data analysis, making it difficult to understand and reproduce scientific results.

What does 'obsolete' mean for an ID?

It means the ID is no longer in use and has been replaced by a new one. The tool can suggest the replacement ID.

Details

Original description by the author

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 identifier must be produced or checked - annotating tissue, cell type, disease, phenotyp

repo: K-Dense-AI/scientific-agent-skills

Popularity

GitHub stars
51k
Ranking position
#1919
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills