Schema Injection Strategies for LLM-Based Text-to-Cypher Query Translation: An Empirical Study
Journal of Information & Knowledge Management · 2026-10 · 25 (10)
DOI: 10.1142/s0219649226500541 ↗Kurz gefasst
Fachartikel in der Zeitschrift Journal of Information & Knowledge Management, online erschienen am 30.06.2026. Verfasst von Shady Hegazy und 4 weiteren Autor:innen. Die Arbeit nennt 27 Literaturangaben.
Abstract (Originalsprache)
Software ecosystems generate complex data traces which can be represented through graph models and stored in graph databases. While large language models (LLMs) offer promising no-code interfaces for querying such databases by translating natural language to database queries, their effectiveness heavily depends on how database schema information is provided. This paper presents a comprehensive evaluation of different schema injection techniques for LLM-driven graph database query generation. We systematically evaluate four key dimensions: schema source, prompt placement, query categories, and results relevancy. Our automated evaluation pipeline records execution outcomes across 50 test queries spanning five query categories. In addition, a human evaluation is conducted for the returned data from each query execution. Results show that LLM-generation of Cypher queries is sensitive to schema source and injection point. In addition, results show that providing the dynamically generated schema through the APOC.meta.graph method yields more relevant and executable queries on average compared to static schema summaries, while injecting schema information in the system prompt outperforms injection in the user prompt. The evaluation provides actionable insights for optimising LLM-driven graph database interfaces and highlights the need for advanced context and software engineering to enable reliable LLM-based solutions.
Zitieren
APA
Hegazy, S., Ammar, M., Elsner, C., Bosch, J., & Olsson, H. H. (2026). Schema Injection Strategies for LLM-Based Text-to-Cypher Query Translation: An Empirical Study. Journal of Information & Knowledge Management, 25(10). https://doi.org/10.1142/s0219649226500541
Vancouver
Hegazy S, Ammar M, Elsner C, Bosch J, Olsson HH. Schema Injection Strategies for LLM-Based Text-to-Cypher Query Translation: An Empirical Study. Journal of Information & Knowledge Management. 2026;25(10). doi:10.1142/s0219649226500541
BibTeX
@article{Hegazy2026,
author = {Hegazy, Shady and Ammar, Muhammad and Elsner, Christoph and Bosch, Jan and Olsson, Helena Holmström},
title = {Schema Injection Strategies for LLM-Based Text-to-Cypher Query Translation: An Empirical Study},
journal = {Journal of Information & Knowledge Management},
year = {2026},
volume = {25},
number = {10},
doi = {10.1142/s0219649226500541}
}
EUVIMED