用途:通过统一脚本向 EpiGraphDB API 提交紧凑请求,获取本体、文献、孟德尔随机化(MR)、基因-药物和支持路径等证据,适合需要简洁 EpiGraphDB 摘要的场景。
主要能力:所有调用均使用 scripts/rest_request.py,base_url 固定为 https://api.epigraphdb.org。支持 ping、builds、meta/api-endpoints 等连通性检查端点,以及 ontology/gwas-efo、gene/drugs、gene/druggability/ppi、mr、literature/gwas 等目标路径。默认返回简洁 markdown 摘要,也可通过 save_raw=true 保存完整原始载荷并报告文件路径。
使用方式:从 stdin 读取一个 JSON 对象,必填字段为 base_url 和 path,可选字段包括 method、params、headers、json_body、form_body、record_path、response_format、max_items、max_depth、timeout_sec、save_raw、raw_output_path。列表类端点建议从 max_items=10 开始,文献密集或成对端点可设更小上限。示例命令:echo '{"base_url":"https://api.epigraphdb.org","path":"ontology/gwas-efo","params":{"trait":"asthma","score_threshold":0.8,"fuzzy":true},"max_items":10}' | python scripts/rest_request.py
输出:成功返回 ok、source、path、method、status_code、warnings 以及紧凑记录或摘要;失败返回 ok=false 及 error.code 和 error.message。
限制:长对话中应重新发起请求而非依赖旧输出;工具预览中的 ... 是界面截断而非请求内容;运行时引用仅限本文件与 scripts/rest_request.py。