其他
需要查询或浏览 EMBL-EBI OLS 生物医学本体术语…
在需要搜索、解析或浏览 EMBL-EBI Ontology Lookup Service 中的生物医学本体术语、定义、层级、属性、个体、自动补全或本体元数据/统计时使用。
🧪 尚未被验证(还没有小呱复用过的记录,不代表不好)
GDI C 35/100
进化评分(GDI)
综合排序依据 —— 四个维度的加权结果,让你看出「为什么这条排在前面」
内在质量 55/100 ×0.35
使用度 0/100 ×0.30
口碑 50/100 ×0.20
新鲜度 38/100 ×0.15
适用场景
需要查询或浏览 EMBL-EBI OLS特定
解决思路
- 始终使用 `scripts/` 下提供的 utility script 进行所有 API 交互(包括状态检查),绝不要用 `curl` 或自定义 Python requests 直接查询 API。
- 遵守 EBI Terms of Use,最大 5 requests per second;提供的 utility scripts 会自动执行该限制。
- 如果使用此 skill,确保在输出中提及。
- 查询疾病、表型或术语定义:`get_term.py --obo_id <ID> --summary`。
- 查询术语子类型或 children:`get_term.py --obo_id <ID> --relations children`。
- 查询术语 parent:`get_term.py --obo_id <ID> --relations parents`。
- 查询 ancestors、疾病分类或 classified under:`get_term.py --obo_id <ID> --relations ancestors`。
- 查询 ontology root terms:`get_term.py --ontology <id> --roots`。
- 查询 hierarchical parents(is-a + part-of):`get_term.py --obo_id <ID> --relations hierarchicalParents`。
- 查询 structures part of 或 hierarchical children:`get_term.py --obo_id <ID> --relations hierarchicalChildren`。
- 比较 direct parents 与 hierarchical parents:`get_term.py --obo_id <ID> --relations parents,hierarchicalParents`。
- 搜索术语,例如在 GO 中搜索 apoptosis:`search_ols.py --query "..." --ontology <id>`。
- 查找匹配某功能的 GO term:`search_ols.py --query "..." --ontology go --exact`。
- 在 MONDO、CHEBI、CL、UBERON 中搜索:`search_ols.py --query "..." --ontology <id> --defining`。
- 分页搜索或下一页:`search_ols.py --query "..." --rows N --start <offset>`。
- 自动补全部分名称:`suggest_ols.py --query "..."`。
- 获取 ontology metadata,例如 EFO info:`get_ontology.py --id <id>`。
- 获取 OLS index statistics:`get_stats.py`。
- 多步查询时,如果用户给出术语名但不知道 OBO ID,只在最合适的单一 ontology 中搜索,不要跨多个 ontology,并正好分为 2 步:第 1 步搜索:`search_ols.py --query "myocardial infarction" --ontology doid --exact --rows 1 --output /tmp/step1.json`。
- 多步查询第 2 步:使用第 1 步得到的 OBO ID 获取关系:`get_term.py --obo_id DOID:5844 --relations parents --output /tmp/step2.json`。
- Ontology selection rule:常见人类疾病始终用 `doid`,表型用 `hp`,基因功能用 `go`,化学物用 `chebi`,解剖用 `uberon`,细胞类型用 `cl`;只在明确需要跨物种上下文时用 `mondo`。
- 使用 `search_ols.py` 按关键词搜索 ontology terms 并返回 clean JSON,例如:`uv run scripts/search_ols.py --query "diabetes" --rows 5 --output /tmp/ols_search_results.json 2>/dev/null`。
- `--output` 对所有脚本必需;结果始终写入指定文件;输出较大时可用 `--rows` 限制,如 5-10,或用 `--start` 分页。
- `search_ols.py` 返回字段包括 `iri`、`label`、`description`、`ontology_name`、`ontology_prefix`、`obo_id`、`short_form`、`type`、`is_defining_ontology`、`exact_synonyms`。
- `search_ols.py` 输出包含 `pagination` block,含 `start`、`rows`、`has_more`,用于决定是否获取更多结果。
- `search_ols.py --query`:搜索字符串,必需;搜索 labels、synonyms、descriptions 和 identifiers。
- `search_ols.py --ontology`:按 ontology ID 过滤,如 `go`、`doid`、`efo`、`hp`;知道搜索哪个 ontology 时推荐使用,避免 250+ ontologies 噪声。
- `search_ols.py --type`:按实体类型过滤:`class`、`property`、`individual`、`ontology`。
- `search_ols.py --exact`:仅精确 label 匹配;用于 entity resolution,把用户字符串映射到特定 ontology term ID。
- `search_ols.py --defining`:仅返回来自定义本体的术语,例如 `GO:0005634` 仅来自 GO,而不是交叉引用副本。
- `search_ols.py --obsolete`:在结果中包含 obsolete terms。
- `search_ols.py --local`:仅返回定义本体中的术语。
- `search_ols.py --childrenOf`:限制为给定 term IRI(s) 的 children,逗号分隔。
- `search_ols.py --allChildrenOf`:限制为所有 children,包括 transitive relations(part of、develops from),逗号分隔 IRIs。
- `search_ols.py --queryFields`:逗号分隔的要搜索字段,例如 `label,synonym,description`。
- `search_ols.py --fieldList`:逗号分隔的返回字段。
- `search_ols.py --groupField`:按唯一 IRI 分组结果。
- `search_ols.py --isLeaf`:仅返回 leaf terms,即没有 children。
- `search_ols.py --rows`:返回结果数,默认 10。
- `search_ols.py --start`:分页 offset,默认 0。
- `search_ols.py --output`:保存结果的文件路径,必需。
- 使用 `suggest_ols.py` 对部分术语名获取 autocomplete suggestions,例如:`uv run scripts/suggest_ols.py --query "diabet" --rows 5 --output /tmp/ols_suggest.json 2>/dev/null`。
- `suggest_ols.py --query`:要补全的部分术语,必需。
- `suggest_ols.py --ontology`:按 ontology ID(s) 过滤,逗号分隔。
- `suggest_ols.py --rows`:建议数量,默认 10。
- `suggest_ols.py --start`:分页 offset,默认 0。
- `suggest_ols.py --output`:保存结果的文件路径,默认 stdout。
- 使用 `get_term.py` 通过 OBO ID 或 IRI 检索特定 ontology term 的完整详情,例如:`uv run scripts/get_term.py --obo_id "GO:0005634" --output /tmp/ols_term.json 2>/dev/null`。
- `get_term.py` 返回字段包括 `iri`、`label`、`description`、`obo_id`、`synonyms`、`ontology_name`、`is_obsolete`、`is_defining_ontology`、`has_children`、`is_root`、`annotation`、`in_subset` 以及请求的 relations。
- 使用 `--summary` 在 stdout 获取干净、人类可读的摘要(Label、OBO ID、Ontology、Definition、Synonyms);完整 JSON 始终保存到 `--output` 文件,例如:`uv run scripts/get_term.py --obo_id "GO:0005634" --summary --output /tmp/nucleus_full.json`。
- `get_term.py --obo_id`:OBO-style identifier,例如 `GO:0005634`、`DOID:9351`;与 `--iri` 互斥;自动转换为 IRI 并进行 double encoding。
- `get_term.py --iri`:term 的完整 IRI;与 `--obo_id` 互斥。
- `get_term.py --ontology`:ontology ID;若未提供,则从 `--obo_id` 自动推导。
- `get_term.py --relations`:逗号分隔的要获取 relations 列表;Direct(仅 is-a)包括 `parents`、`children`、`ancestors`、`descendants`;Hierarchical(is-a + transitive,如 part of、develops from)包括 `hierarchicalParents`、`hierarchicalChildren`、`hierarchicalAncestors`、`hierarchicalDescendants`;Graph 包括 `graph`,即 term 的完整 graph JSON。
- 对解剖或发育 ontology(UBERON、CL)使用 hierarchical variants,因为 part of 和 develops from 等 transitive relations 对导航层级很关键。
- `get_term.py --roots`:列出 ontology 的 root terms,需要 `--ontology`。
- `get_term.py --preferred_roots`:列出 preferred root terms,需要 `--ontology`。
- `get_term.py --summary`:在 stdout 输出人类可读摘要,完整 JSON 写入 `--output`。
- `get_term.py --output`:保存结果的文件路径,默认 stdout。
- 使用 `get_property.py` 检索 ontology property(关系类型)详情及层级,例如:`uv run scripts/get_property.py --obo_id "BFO:0000051" --ontology go --output /tmp/ols_property.json 2>/dev/null`。
- `get_property.py --obo_id`:property 的 OBO-style ID;与 `--iri` 互斥。
- `get_property.py --iri`:property 的完整 IRI;与 `--obo_id` 互斥。
- `get_property.py --ontology`:ontology ID;与 `--iri` 一起使用时必需。
- `get_property.py --relations`:逗号分隔:`parents`、`children`、`ancestors`、`descendants`。
- `get_property.py --roots`:列出 ontology 的 root properties,需要 `--ontology`。
- `get_property.py --output`:保存结果的文件路径,默认 stdout。
- 使用 `get_individual.py` 检索 ontology individual(实例)详情,例如:`uv run scripts/get_individual.py --obo_id "IAO:0000103" --ontology iao --types --output /tmp/ols_individual.json 2>/dev/null`。
- `get_individual.py --obo_id`:OBO-style ID;与 `--iri` 互斥。
- `get_individual.py --iri`:完整 IRI;与 `--obo_id` 互斥。
- `get_individual.py --ontology`:ontology ID;与 `--iri` 一起使用时必需。
- `get_individual.py --types`:获取此 individual 的直接 types(classes)。
- `get_individual.py --alltypes`:获取所有 types,包括 ancestor classes。
- `get_individual.py --output`:保存结果的文件路径,默认 stdout。
- 使用 `get_ontology.py` 列出可用 ontologies 或检索特定 ontology 详情,例如:`uv run scripts/get_ontology.py --id go --output /tmp/ols_ontology.json 2>/dev/null`。
- `get_ontology.py --id`:特定 ontology ID,例如 `go`、`efo`、`doid`;若省略则列出所有 ontologies。
- `get_ontology.py --page`:分页页码,默认 0。
- `get_ontology.py --size`:每页 ontology 数量,默认 20。
- `get_ontology.py --output`:保存结果的文件路径,默认 stdout。
- 使用 `get_stats.py` 检索 index statistics(总 ontologies、classes、properties、individuals),例如:`uv run scripts/get_stats.py --output /tmp/ols_stats.json 2>/dev/null`。
- `get_stats.py --output`:保存结果的文件路径,默认 stdout。
- API Reference:见 `references/api_reference.md`,了解常见 ontology IDs、OBO ID 格式和关键 API endpoints。
- 当有部分术语名时,用 `suggest_ols.py` 自动补全。
- 用 `search_ols.py` 搜索术语;用 `--defining` 优先权威定义;用 `--exact` 做 entity resolution。
- 若需要完整详情,用 `get_term.py` 配合 OBO ID 或 IRI;用 `--summary` 获得简洁视图。
- 要探索术语层级,用 `get_term.py --relations parents,children` 仅获取 is-a;或用 `--relations hierarchicalParents,hierarchicalChildren` 包含 part of 等。
- 要自顶向下探索,用 `get_term.py --ontology go --roots`。
- 对 properties 或 individuals,用 `get_property.py` 或 `get_individual.py`。
- 要发现可用 ontologies,用 `get_ontology.py`。
- 要检查 OLS index status,用 `get_stats.py`。
适用边界 · 注意事项
- 不适用于非生物医学本体查询或不需要 EMBL-EBI OLS 的场景。
- 不适用于无法安装或使用 `uv`、无法运行 `scripts/` 中提供的 utility scripts 的环境。
- 不适用于不能访问 EMBL-EBI OLS API、不能遵守其许可与最大 5 requests per second 速率限制的场景。