arXiv:2610.08095cs.AIOct 2026

Manuscript Offprint

arXiv:2610.08095

Natural Language Questions as an Interface for Knowledge Graphs: QRAKEN Graph Distillation and Semantic Self-Healing

Remo Grillo, Lukas Klic, Giovanni Colavizza

Abstract

Natural-language access to RDF knowledge graphs is a core Semantic Web ambition, and large language models (LLMs) have recently made Text-to-SPARQL feasible at scale; yet the dominant failure mode, on graphs outside the LLM pretraining distribution, is not syntax but graph-grounded correctness: queries that parse, use real vocabulary, and still silently misrepresent the data model of the target graph. Existing approaches — online agentic exploration, fine-tuning or retrieval over question-query traces, and shape/metadata prompting — share a common limitation: generation is grounded in what the graph should contain according to an ontology or shape specification, rather than in how it is actually populated. We present QRAKEN, a training-free, ontology-agnostic neurosymbolic pipeline for question answering over RDF knowledge graphs. An offline distiller summarizes the populated graph into a TTQL file — a compact description of empirical multi-hop patterns, conditional frequencies, and path-conditioned literal examples — plus a co-occurrence matrix of classes and properties. Online, the NTQ module injects TTQL into the LLM context and passes the candidate SPARQL through deterministic syntactic, lexical, and data-model checks (grounded purely in the distilled empirical evidence), whose diagnostics feed a deterministic self-healing refinement loop. On CK25 (First International Text2SPARQL Challenge), under matched-condition recomputation on a QLever snapshot, QRAKEN exhibits a better performance among systems built on the same base model family: strict F1 0.643±0.0260.643 \pm 0.026 with GPT-4.1 mini and 0.652±0.0120.652 \pm 0.012 with GPT-5.4, +30% and +32% over the strongest recomputed participant. An ablation isolates TTQL pattern blocks as the dominant driver (+0.31 strict F1 over a shape-only baseline), while the self-healing loop acts as a cheap deterministic safety net that rejects queries whose triple patterns have zero support in the co-occurrence matrix. Against an auto-derived SHACL baseline, TTQL delivers +64% higher strict F1, confirming that its value lies in pattern-level empirical content, not mere schema exposure. The same pipeline driving two 35B 4-bit open-weight models locally, at zero marginal cost, performs on par with the strongest recomputed participant system, and both TTQL effects persist. Results come from a single, relatively small benchmark and should be read as an initial empirical signal; the main current limitation is monolithic TTQL injection on very open cross-domain graphs.

Keywords

knowledge graph question answering, Text-to-SPARQL, large language models, graph summarization, training-free prompting, neurosymbolic AI, linked open data

References (23)