English

GRASP: Generic Reasoning And SPARQL Generation across Knowledge Graphs

Computation and Language 2026-01-12 v2 Databases Information Retrieval

Abstract

We propose a new approach for generating SPARQL queries on RDF knowledge graphs from natural language questions or keyword queries, using a large language model. Our approach does not require fine-tuning. Instead, it uses the language model to explore the knowledge graph by strategically executing SPARQL queries and searching for relevant IRIs and literals. We evaluate our approach on a variety of benchmarks (for knowledge graphs of different kinds and sizes) and language models (of different scales and types, commercial as well as open-source) and compare it with existing approaches. On Wikidata we reach state-of-the-art results on multiple benchmarks, despite the zero-shot setting. On Freebase we come close to the best few-shot methods. On other, less commonly evaluated knowledge graphs and benchmarks our approach also performs well overall. We conduct several additional studies, like comparing different ways of searching the graphs, incorporating a feedback mechanism, or making use of few-shot examples.

Keywords

Cite

@article{arxiv.2507.08107,
  title  = {GRASP: Generic Reasoning And SPARQL Generation across Knowledge Graphs},
  author = {Sebastian Walter and Hannah Bast},
  journal= {arXiv preprint arXiv:2507.08107},
  year   = {2026}
}

Comments

Accepted for publication at ISWC 2025. This version of the contribution has been accepted for publication, after peer review but is not the Version of Record. The Version of Record is available online at: https://doi.org/10.1007/978-3-032-09527-5_15

R2 v1 2026-07-01T03:55:28.537Z