Graph databases are powerful tools for representing complex, interconnected knowledge, but their structure and semantics pose significant challenges for natural language interaction. In this work, we present a guided approach based on the Retrieval-Augmented Generation (RAG) schema to assist large language models in generating queries over graph-based databases. By incorporating semantically relevant paths into the prompt, our method reduces the reasoning complexity that the model must handle, enabling more accurate query generation. We evaluate the performance of different language models under two schema interaction paradigms—full schema exploration and path-specific guidance—across queries related to risk assessment in passenger and flight data. Our preliminary results show that path-specific guidance significantly improves model performance, particularly for smaller models. That semantic pre-filtering of the graph structure enhances the model’s ability to focus on relevant information.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Schema-Based Inference for Query Expansion and Completion over Knowledge Graphs

  • Bartolome Ortiz-Viso,
  • Karel Gutiérrez-Batista,
  • M. Dolores Ruiz,
  • Maria J. Martin-Bautista

摘要

Graph databases are powerful tools for representing complex, interconnected knowledge, but their structure and semantics pose significant challenges for natural language interaction. In this work, we present a guided approach based on the Retrieval-Augmented Generation (RAG) schema to assist large language models in generating queries over graph-based databases. By incorporating semantically relevant paths into the prompt, our method reduces the reasoning complexity that the model must handle, enabling more accurate query generation. We evaluate the performance of different language models under two schema interaction paradigms—full schema exploration and path-specific guidance—across queries related to risk assessment in passenger and flight data. Our preliminary results show that path-specific guidance significantly improves model performance, particularly for smaller models. That semantic pre-filtering of the graph structure enhances the model’s ability to focus on relevant information.