Knowledge Graph Question Answering (KGQA) has advanced through structured query generation, yet most efforts target RDF/SPARQL, leaving Cypher and property graphs underexplored, despite increasing demand for unified KGQA in industry settings. We propose UniQGen, a novel constraint-based framework that employs LLM agents to dynamically extract and refine representative graph query clauses into executable, intent-aligned graph queries across query languages. The foundation of our method is a variant of Chase & Backchase, a family of algorithms for query optimization and reformulation. We extend Chase & Backchase with a dynamic reasoning process over query constraints that also interact with LLMs for query quality estimation. With a Cypher-supported Freebase graph deployed on Amazon Neptune, we extensively evaluate our approach on popular KGQA benchmarks (GraphQ, GrailQA, and WebQSP). We demonstrate that UniQGen outperforms state-of-the-art graph query generation techniques in both accuracy and efficiency, with F1 gains of 31.6% on GraphQ and 4.9% on GrailQA. Unlike prior methods, our framework does not require fine-tuning for schema matching, making it more extensible to schema-less graphs and semantics in query workloads, and is more suitable for enterprise-grade KGQA. We release Cypher outputs and a Neptune-ready Freebase snapshot to support reproducible, cross-language KGQA research.
翻译:知识图谱问答(KGQA)通过结构化查询生成取得了进展,然而大多数研究针对RDF/SPARQL,对Cypher和属性图的探索不足,而工业场景中对统一KGQA的需求日益增长。我们提出UniQGen,一种新颖的基于约束的框架,利用大语言模型智能体动态提取并精炼代表性图形查询子句,生成跨查询语言的、可执行且与意图对齐的图形查询。该方法的核心是Chase & Backchase算法族的一个变体,该算法族用于查询优化与重构。我们通过一个对查询约束的动态推理过程扩展了Chase & Backchase,该过程还与LLM交互以评估查询质量。借助部署在Amazon Neptune上的支持Cypher的Freebase图谱,我们在主流KGQA基准(GraphQ、GrailQA和WebQSP)上广泛评估了我们的方法。我们证明,UniQGen在准确性和效率上均优于最先进的图形查询生成技术,在GraphQ上F1值提升31.6%,在GrailQA上提升4.9%。与先前方法不同,我们的框架无需为模式匹配进行微调,因此更易于扩展到无模式图谱和查询负载的语义分析,更适合企业级KGQA。我们发布了Cypher输出结果和一个Neptune就绪的Freebase快照,以支持可复现的跨语言KGQA研究。