D4R -- Exploring and Querying Relational Graphs Using Natural Language and Large Language Models -- the Case of Historical Documents
To address the challenge non-technical users—particularly historians—face in efficiently querying relational knowledge graphs, this paper proposes an LLM-driven end-to-end framework for natural language-to-graph query translation. Methodologically, it tightly couples large language models with domain-specific historical texts to automatically parse natural language questions into precise Cypher queries for retrieval against a Neo4j knowledge graph; it further introduces a lightweight web-based graphical interface enabling dynamic discovery and visual analytics of entities, events, and spatiotemporal relationships. The key contribution lies in the first implementation of three-layer alignment—semantic, syntactic, and graph-structural—tailored to historical scholarship, thereby balancing domain specificity with low-barrier interactivity. Experimental evaluation on real historical source materials achieves 86.3% query accuracy and demonstrates promising cross-domain transferability.