Schema Injection Strategies for LLM-Based Text-to-Cypher Query Translation: An Empirical Study

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.

Authors

Institutions

Publication Details

Journal
Journal of Information & Knowledge Management
Published
2026-06-30
DOI
https://doi.org/10.1142/s0219649226500541
Primary Topic
Graph Theory and Algorithms
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Schema Injection Strategies for LLM-Based Text-to-Cypher Query Translation: An Empirical Study

Jan Bosch, Helena Holmström Olsson, Shady Hegazy, Christoph Elsner et al.
Journal of Information & Knowledge Management
Graph Theory and Algorithms
article

Schema Injection Strategies for LLM-Based Text-to-Cypher Query Translation: An Empirical Study

Jan Bosch, Helena Holmström Olsson, Shady Hegazy, Christoph Elsner, Muhammad Ammar
article en

Abstract

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.

Journal of Information & Knowledge Management
Siemens (Germany) (DE), Malmö University (SE), Chalmers University of Technology (SE)
Life in Land
Openalex Percentile: Top 8%
Graph Theory and Algorithms
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Schema Injection Strategies for LLM-Based Text-to-Cypher Query Translation: An Empirical Study — Jan Bosch, Helena Holmström Olsson, et al. · Journal of Information & Knowledge Management (2026) | TGRS Research Map | TGRS