ontology-term-resolution
它能做什么
这个工具可以帮你查找并核实科学术语的标识符。它能把描述性名称转换成唯一的编码(ID),并确认现有编码是否有效且是最新的。
适用场景
- ✓当你需要用科学术语为数据添加注释时。
- ✓当你在填写数据提交表单时。
- ✓当你需要检查旧文件中的编码是否有效时。
技能链接
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/ontology-term-resolution/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在 UBERON 本体中查找 'left ventricle' 的 ID。”
每周 5 个新技能,1 分钟读完。
工作原理
工具会在科学数据库中搜索你描述的术语,或者核实你提供的编码。它会使用 OLS 和 Bioregistry 等服务,确保标识符正确且是最新的。
技术内容(原始 SKILL.md)
作者在 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
…
常见问题
什么是“本体 ID”?
它是一个唯一的标准化编码,代表某个特定的科学概念,比如细胞类型、疾病或身体部位。
为什么要检查 ID?
错误或过时的 ID 可能导致数据分析出错,让科学结果难以理解和复现。
ID 的 'obsolete' 是什么意思?
表示这个 ID 已经不再使用,并被新的 ID 取代。工具可以提示你对应的替代 ID。
详情
作者的原始描述
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
热度
- GitHub 星标
- 51k
- 排名
- #3511
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …