1. lkm-openapi
literature-sage
  • lkm-openapi
    • 搜索知识:对科学命题/研究问题等进行召回
      POST
    • 搜索推理链:对文献推理过程进行召回
      POST
    • 查询论文对应的完整知识图谱
      POST
    • 查询命题对应的推理链
      GET
    • 批量查询:按知识节点 ID 列表取详情
      POST
    • 问题反馈
      POST
  1. lkm-openapi

批量查询:按知识节点 ID 列表取详情

POST
/variables/batch
这个接口用于批量水合 LKM variable(claim/question) 的完整详情。给定一组已知 variable ID,返回每个 variable 的内容、类型、代表性 local 成员、来源论文等信息。适合“先检索拿到 ID,再批量回查详情”的场景。常用于搜索结果补全、批量详情页、Agent 后处理和前端列表水合。
这个接口不是检索接口。如果还没有 ID,请先用 /search 或 /reasoning/search。如果想按论文拿完整 graph,请用 /papers/graph。如果想看单条 claim 的推理链,请用 /claims/{id}/reasoning。

ID 怎么拿#

ids 里应该传 LKM 全局 variable ID。
常见形式是 gcn_...,例如 gcn_654cd35dcb814a0c。
可以从 /search 返回的 data.variables[].id 获取。
也可以从 graph 节点的 global_id 获取,例如 /reasoning/search?format=graph 或 /papers/graph 中的 conclusion、subproblem、weak point、highlight 节点。
不要传 graph 本地节点 ID。
例如 paper:812481689673531392::conclusion_6 是 graph 内部节点 ID,不是本接口要的 variable ID。
这类 ID 通常不会让整个请求失败,但会出现在 not_found 里。
不要传 paper ID 或 package ID。
812481689673531392 是论文 ID,不是 variable ID。
paper:812481689673531392 是论文 package ID,不是 variable ID。
要按论文查结构化图谱时,应使用 /papers/graph。

请求行为#

ids 必填。
至少 1 个,最多 100 个。
传空数组会返回 290002。
超过 100 个会返回 290002。
ids 里不要放空字符串。
空字符串不会被自动忽略。
只要数组里出现空字符串,请求就可能返回 290002。
重复 ID 会被去重。
返回结果不会保留重复项。
不要依赖重复 ID 来得到重复结果。
部分 ID 未命中不影响整体成功。
只要请求参数合法,命中的 variable 会正常返回。
未命中的 ID 会放在 data.not_found。

响应怎么看#

先看业务码。
HTTP 状态通常是 200,业务是否成功看响应体里的 code。
code = 0 表示请求成功;成功不代表每个 ID 都命中。
再看变量结果。
data.variables 是命中的 variable 列表。
每个 variable 通常包含 id、type、title、content、visibility、representative_lcn、local_members、provenance 等字段。
type 常见值包括 claim、question。
title 不一定存在;例如部分 question 可能只有 content。
再看未命中结果。
data.not_found 是未命中的 ID 列表。
如果传入了 graph 本地 ID、paper ID、错误 ID,通常会出现在这里。
再看论文元数据。
data.papers 是按 package_id 组织的论文元数据对象。
key 通常形如 paper:<数字>。
可以用 variable 里的 representative_lcn.package_id、local_members[].package_id 或 provenance.source_packages[] 去关联 data.papers。

variable 字段说明#

id 是 LKM 全局 variable ID。
通常形如 gcn_...。
后续如果要继续查询 claim 推理链,也应使用这种全局 ID。
type 表示 variable 类型。
claim 表示声明、结论、前提、弱点等 claim 类内容。
question 表示问题、研究动机或 subproblem 类内容。
content 是 variable 的正文内容。
展示时优先使用 content。
title 可作为简短标题,但不保证每个 variable 都有。
representative_lcn 是代表性 local 成员。
包含 local_id、package_id、version。
适合用来定位该 variable 最典型的一处论文内来源。
local_members 是该 variable 关联到的本地成员列表。
每个成员通常包含 local_id、package_id、version、content。
同一个全局 variable 可能来自一篇或多篇论文中的多个 local 成员。
provenance 是来源信息。
provenance.representative_lcn 通常与 representative_lcn 对应。
provenance.source_packages[] 列出来源论文 package ID。
metadata 和 parameters 需要防御式解析。
它们可能是空字符串、JSON 字符串或数组字符串。
调用方不要假设它们一定是已经解析好的对象。

常见错误#

入参为空:290002。
常见原因是 body 里没有 ids。
常见原因是 ids: []。
ID 格式不合法:290002。
常见原因是 ids 里混入空字符串。
调用方应在请求前过滤空值。
ID 数量超限:290002。
最多 100 个 ID。
超过 100 个需要调用方自行分批。
ID 未命中:code = 0,但出现在 data.not_found。
这不是整体失败。
常见原因是传了 graph 本地节点 ID、paper ID、package ID 或不存在的 gcn_...。
查询异常:290001。
表示查询失败,可以重试一次。
如果仍失败,建议减少批量大小或检查 ID 来源。
鉴权错误:2000。
表示未授权,通常是请求头缺少有效 accessKey。

使用建议#

先从检索接口拿 ID,再用本接口批量水合。
/search 适合按关键词或语义拿 variable ID。
/reasoning/search 适合从 graph 节点的 global_id 收集 variable ID。
请求前先清洗 ID 列表。
去掉空字符串和 null,去重,分批控制在 100 个以内。
展示时要处理部分命中。
data.variables 里展示命中的结果。
data.not_found 可用于日志、降级提示或排查 ID 来源。
关联论文时使用 package ID。
从 representative_lcn.package_id、local_members[].package_id 或 provenance.source_packages[] 取 key。
再到 data.papers[package_id] 读取论文标题、DOI、期刊、发表时间等元数据。
业务展示不要只依赖接口返回。
接口会返回 visibility 字段。
调用方如有展示权限、场景过滤或业务上下文限制,应在业务层自行处理。

请求参数

Header 参数

Body 参数application/json必填

示例
{
    "ids":["gcn_654cd35dcb814a0c","gcn_9523aa7f1fd04d8a"]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location 'https://open.bohrium.com/openapi/v1/lkm/variables/batch' \
--header 'accessKey;' \
--header 'Authorization: Bearer 5cc6462133d64251bf6ab64815c0e9xx' \
--header 'Content-Type: application/json' \
--data '{
    "ids":["gcn_654cd35dcb814a0c","gcn_9523aa7f1fd04d8a"]
}'

返回响应

🟢200
application/json
业务错误,按响应体 code / msg 分类
Bodyapplication/json

示例
{
    "code": 0,
    "data": {
        "variables": [
            {
                "id": "gcn_654cd35dcb814a0c",
                "type": "claim",
                "content": "Unencapsulated Pc-applied perovskite solar cells subjected to continuous heating at 85 °C in an N₂-filled glove box retain a power conversion efficiency drop of less than 5% after more than 1000 h, demonstrating thermal stability comparable to or exceeding that of metal-phthalocyanine-based devices. The result indicates that Pc itself is thermally stable and effectively suppresses out-diffusion and thermally induced volatilization of perovskite constituents, while also maintaining the doping components Li-TFSI and tBP at elevated temperature.",
                "visibility": "public",
                "content_hash": "aa034f5bdf4fea9467e634662316fea0c7019aca2bb98a3865b7913159e42d22",
                "title": "Outstanding thermal stability of Pc-based PSCs at 85 °C",
                "parameters": "[]",
                "metadata": "",
                "provenance": {
                    "source_packages": [
                        "paper:812481689673531392"
                    ],
                    "representative_lcn": {
                        "local_id": "paper:812481689673531392::conclusion_6",
                        "package_id": "paper:812481689673531392",
                        "version": "2.0.0"
                    }
                },
                "representative_lcn": {
                    "local_id": "paper:812481689673531392::conclusion_6",
                    "package_id": "paper:812481689673531392",
                    "version": "2.0.0"
                },
                "local_members": [
                    {
                        "local_id": "paper:812481689673531392::conclusion_6",
                        "package_id": "paper:812481689673531392",
                        "version": "2.0.0",
                        "content": "Unencapsulated Pc-applied perovskite solar cells subjected to continuous heating at 85 °C in an N₂-filled glove box retain a power conversion efficiency drop of less than 5% after more than 1000 h, demonstrating thermal stability comparable to or exceeding that of metal-phthalocyanine-based devices. The result indicates that Pc itself is thermally stable and effectively suppresses out-diffusion and thermally induced volatilization of perovskite constituents, while also maintaining the doping components Li-TFSI and tBP at elevated temperature."
                    }
                ],
                "created_at": "2026-05-23T00:50:09+08:00"
            },
            {
                "id": "gcn_9523aa7f1fd04d8a",
                "type": "claim",
                "content": "Unencapsulated perovskite solar cells (FTO/TiO2/Cs0.06FA0.94PbI3/PTAA/Au) incorporating PRA‑TFSI additives in the PTAA layer were aged in a nitrogen atmosphere at 85 °C (358 K) in the dark and showed no significant PCE loss during a 1000 h thermal stability test reported here (short‑term heating for 30 min at 85 °C likewise produced no PCE decrease), and across the extended test the PRA‑TFSI‑containing devices retained higher absolute PCEs than Li‑TFSI controls under these inert, dark thermal conditions.",
                "visibility": "public",
                "content_hash": "5554dcdf7fe384eb5618feb0d4fde5ef333ba1f3684867ce4449246abf51b4e1",
                "title": "Devices with PRA‑TFSI additives retain PCE under 85 °C thermal ageing in nitrogen for 1000 h",
                "parameters": "[]",
                "metadata": "",
                "provenance": {
                    "source_packages": [
                        "paper:1250272624886415367"
                    ],
                    "representative_lcn": {
                        "local_id": "paper:1250272624886415367::conclusion_6",
                        "package_id": "paper:1250272624886415367",
                        "version": "2.0.0"
                    }
                },
                "representative_lcn": {
                    "local_id": "paper:1250272624886415367::conclusion_6",
                    "package_id": "paper:1250272624886415367",
                    "version": "2.0.0"
                },
                "local_members": [
                    {
                        "local_id": "paper:1250272624886415367::conclusion_6",
                        "package_id": "paper:1250272624886415367",
                        "version": "2.0.0",
                        "content": "Unencapsulated perovskite solar cells (FTO/TiO2/Cs0.06FA0.94PbI3/PTAA/Au) incorporating PRA‑TFSI additives in the PTAA layer were aged in a nitrogen atmosphere at 85 °C (358 K) in the dark and showed no significant PCE loss during a 1000 h thermal stability test reported here (short‑term heating for 30 min at 85 °C likewise produced no PCE decrease), and across the extended test the PRA‑TFSI‑containing devices retained higher absolute PCEs than Li‑TFSI controls under these inert, dark thermal conditions."
                    }
                ],
                "created_at": "2026-05-18T12:29:29+08:00"
            }
        ],
        "not_found": [],
        "papers": {
            "paper:1250272624886415367": {
                "id": "1250272624886415367",
                "doi": "10.26434/chemrxiv-2025-j0pmk",
                "publication_id": "137749",
                "publication_name": "chemRxiv-Materials Science",
                "zh_title": "自发钙钛矿钝化剂与PTAA空穴传输材料在钙钛矿太阳能电池中的有效结合",
                "en_title": "Spontaneous Perovskite Passivators Effectively Combined with PTAA Hole Transport Materials in Perovskite Solar Cells",
                "authors": "Naoyuki Nishimura | Hiroyuki Kanda | Takurou N. Murakami",
                "publication_date": "",
                "available_online": "2025/02/17",
                "cover_date_start": "2025-02-17",
                "area": "",
                "research_categories": "",
                "keywords": "",
                "created_at": "2026-04-12T18:17:02+08:00"
            },
            "paper:812481689673531392": {
                "id": "812481689673531392",
                "doi": "10.1002/smtd.202001248",
                "publication_id": "2098",
                "publication_name": "Small Methods _ Small Methods",
                "zh_title": "无金属酞菁作为高效稳定钙钛矿太阳能电池的空穴传输材料和表面钝化剂",
                "en_title": "Metal‐Free Phthalocyanine as a Hole Transporting Material and a Surface Passivator for Efficient and Stable Perovskite Solar Cells",
                "authors": "Seung‐Woo Kim | Geunjin Kim | Chan su Moon | Tae‐Youl Yang | Jangwon Seo",
                "publication_date": "2021-5",
                "available_online": "2021-3-31",
                "cover_date_start": "2021-03-31",
                "area": "Material science",
                "research_categories": "[\"Chemical Sciences\", \"Macromolecular and Materials Chemistry\", \"Physical Chemistry\", \"Engineering\", \"Materials Engineering\"]",
                "keywords": "[{\"ch_name\":\"空穴传输材料\",\"en_name\":\"hole transporting materials\"},{\"ch_name\":\"钙钛矿太阳能电池\",\"en_name\":\"perovskite solar cells\"},{\"ch_name\":\"酞菁\",\"en_name\":\"phthalocyanine\"},{\"ch_name\":\"热稳定性\",\"en_name\":\"thermal stability\"}]",
                "created_at": "2022-12-21T16:32:11+08:00"
            }
        }
    }
}
修改于 2026-06-18 08:24:33
上一页
查询命题对应的推理链
下一页
问题反馈
Built with