arXiv:2508.01815cs.CLcs.AI2025-08被引 1

让AI在多个知识图谱中精准找对结构,生成可执行的查询语句。

From Graph Retrieval to Schema Realization: Counterfactual Validation for Text-to-SPARQL over Heterogeneous Knowledge Graphs

  • 基于问题动态匹配最适配的图谱结构片段
  • 在Spider4SPARQL上执行准确率提升至64.18%
  • 适合处理多源异构知识图谱的问答任务

文本转SPARQL旨在将自然语言问题转化为可在RDF知识图谱上执行的SPARQL查询。尽管标准评估通常固定目标图谱,但在实际知识图谱问答(KGQA)中,常需面对包含不同模式、部分对齐和不完整元数据的异构图谱集合。此时,查询生成不仅依赖SPARQL语法,还需识别能支持问题中谓词、实体类型、连接、过滤和约束的图谱模式。本文提出SchemaForge,一种基于模式的智能体框架,用于异构知识图谱集合上的文本转SPARQL。其核心机制为条件化模式切片对齐:先通过弱图证据筛选可能图谱,再以强模式证据判断局部模式切片是否能实现预期查询。选定的模式切片用于约束查询生成与验证,再执行。当仅有一个图谱可用时,该方法退化为标准单图谱文本转SPARQL并带模式对齐。在LC-QuAD 2.0、QALD-9 Plus、QALD-10和Spider4SPARQL四个公开基准上,SchemaForge相较最强基线模型平均提升执行准确率11.50个百分点。在Spider4SPARQL上,执行准确率从54.86%提升至64.18%,图谱分配准确率达到Top-1 73.0%、Top-3 97.0%。结果表明,从弱图证据转向基于模式的查询承诺,并结合反事实答案集验证,显著提升了异构知识图谱上的可执行查询生成能力。

原文摘要 · Abstract (English)

Text-to-SPARQL maps natural-language questions to executable SPARQL queries over RDF knowledge graphs. While standard evaluations often fix the target graph in advance, practical knowledge graph question answering (KGQA) may involve heterogeneous graph collections with different schemas, partial alignments, and incomplete metadata. In this setting, query generation depends on more than SPARQL syntax: the system must identify a graph schema that can support the predicates, entity types, joins, filters, and constraints required by the question. We present SchemaForge, a schema-grounded agentic framework for text-to-SPARQL over heterogeneous KG collections. Its central mechanism is question-conditioned schema-slice alignment: weak graph evidence first identifies plausible graphs, while stronger schema evidence determines whether a local schema slice can realize the intended query. The selected schema slice then constrains query generation and verification before execution. When only one graph is available, the same formulation reduces to standard single-KG text-to-SPARQL with schema grounding. We evaluate SchemaForge on LC-QuAD 2.0, QALD-9 Plus, QALD-10, and Spider4SPARQL. Across the four public benchmarks, SchemaForge improves execution accuracy over the strongest matched agent baseline by 11.50 percentage points on average. On Spider4SPARQL, SchemaForge improves execution accuracy from 54.86% to 64.18% and achieves 73.0% Top-1 and 97.0% Top-3 graph allocation accuracy. These results show that moving from weak graph evidence to schema-specific query commitments, together with counterfactual answer-set checks, improves executable query generation over heterogeneous knowledge graphs.

知识图谱文本转查询异构图谱SPARQL

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。