SKILL·A6D910

ontology-term-resolution

K-Dense-AI
更新于 14 days ago
33,235
3,262
33,235
在 GitHub 上查看
开发aidata

关于

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.

快速安装

Claude Code

推荐
主要方式
npx skills add K-Dense-AI/claude-scientific-skills -a claude-code
插件命令备选方式
/plugin add https://github.com/K-Dense-AI/claude-scientific-skills
Git 克隆备选方式
git clone https://github.com/K-Dense-AI/claude-scientific-skills.git ~/.claude/skills/ontology-term-resolution

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

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

DirectionScriptQuestion answered
text → IDscripts/resolve_terms.pyWhat is the term for "left ventricle"?
ID → verdictscripts/validate_terms.pyIs 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) → tokenfulltext 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
StatusMeaningVerdict
okExists, current, consistent with everything assertedpass
matched_synonymClaimed label is a synonym; primary label differswarn
imported_onlyHome ontology no longer asserts this IDwarn
not_a_classTerm is a property or individualwarn
not_foundNo such termfail
obsoleteObsoleted; replacement gives the successor when one existsfail
label_mismatchID and claimed label describe different thingsfail
wrong_ontologyRight kind of ID, wrong ontology for this columnfail
wrong_branchNot a descendant of the required rootfail
malformed_curieNot of the form PREFIX:localfail

--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.

TrapConsequence
exact=true is exact token matchingliver returns 161 hits in UBERON; adding queryFields=label returns 1
/search never returns is_obsolete or term_replaced_byNamed in fieldList they are dropped silently; only term detail can answer "is this ID still current"
ontology=efo returns MONDO and CL hitsOntologies import each other; filter on the CURIE prefix yourself
The same term appears once per importing ontologyDeduplicate on obo_id, keep is_defining_ontology: true
The obo_id index has holesMONDO:0000001 is live but unindexed by obo_id; an IRI fallback is required to avoid a false not_found
IRIs are not all OBO PURLsEFO and Orphanet use their own namespaces — resolve IRIs, do not template them
OxO is retiredReturns HTML with HTTP 200; use term cross-references or SSSOM instead
A branch check does not exclude cell types from anatomyCARO 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 仓库

K-Dense-AI/claude-scientific-skills
路径: skills/ontology-term-resolution
0
agent-skillsai-scientistbioinformaticschemoinformaticsclaudeclaude-skills
FAQ

常见问题

什么是 ontology-term-resolution Skill?

ontology-term-resolution 是一个 Claude Skill,作者为 K-Dense-AI。Skill 将 Claude 按需加载的说明和资源打包,让 Claude 无需额外提示即可执行与 ontology-term-resolution 相关的任务。

如何安装 ontology-term-resolution?

使用本页的安装命令:将 ontology-term-resolution 作为插件添加到 Claude Code,或将其仓库克隆到 skills 目录,然后重启 Claude 以加载该 Skill。

ontology-term-resolution 属于哪个分类?

ontology-term-resolution 属于开发分类。

ontology-term-resolution 可以免费使用吗?

可以。ontology-term-resolution 已收录在 AIMCP,可免费安装。

相关推荐技能

qmd
开发

这是一个本地搜索和索引的CLI工具,支持BM25、向量搜索和重排序功能。开发者可以用它快速索引本地文件(如Markdown文档)并进行混合搜索,特别适合代码库或文档的本地检索。它还提供MCP模式,能轻松集成到Claude开发环境中使用。

查看技能
subagent-driven-development
开发

该Skill用于在当前会话中执行包含独立任务的实施计划,它会为每个任务分派一个全新的子代理并在任务间进行代码审查。这种"全新子代理+任务间审查"的模式既能保障代码质量,又能实现快速迭代。适合需要在当前会话中连续执行独立任务,并希望在每个任务后都有质量把关的开发场景。

查看技能
mcporter
开发

mcporter Skill 让开发者能在Claude中直接管理和调用MCP服务器。它支持列出可用服务器、调用工具、处理OAuth认证以及管理服务器守护进程。开发者可以通过命令行式交互快速执行`mcporter list`查看服务器,或使用`mcporter call`直接调用工具,简化了MCP工作流程。

查看技能
adk-deployment-specialist
开发

这是一个用于部署和编排Google Vertex AI ADK智能体的Claude Skill,专为构建生产级多智能体系统而设计。它支持通过A2A协议进行智能体通信,提供代码执行沙箱和记忆库功能,并能处理智能体发现与任务提交。当开发者需要部署ADK智能体或编排多智能体协作时,可使用此Skill来简化Vertex AI Agent Engine的部署流程。

查看技能