GenSPARQL: A Generative Extension of SPARQL for Incomplete Knowledge Graphs
Organizations: University of Stuttgart, Stuttgart, Germany · Iowa State University, Ames, IA, USA
Abstract
Knowledge graphs on the Web are incomplete, and SPARQL answers a query only from the stored triples. Large language models (LLMs) can predict missing facts, but an LLM returns names instead of IRIs and requires one call per binding of a query variable. We present GenSPARQL, a generative extension of SPARQL 1.1 with an operator GENOP that binds values generated by an LLM to query variables during query evaluation. A similarity join maps generated names to entities of the graph, and the query planner invokes the LLM only for the bindings selected by the other graph patterns and filters. In a web workbench, attendees query two graphs built from Wikidata and inspect generated values, mapped entities and LLM calls. In our evaluation with three open-weight LLMs, the embedding similarity maps 83% of the entities named by the LLMs and yields only one incorrect match.
Figures & tables
| Position | Birth year | Generated names | ||||
|---|---|---|---|---|---|---|
| LLM | answered | correct | answered | correct | total | not in graph |
| Qwen3-30B | 99.9% | 58.4% | 97.4% | 90.2% | 71 | 20% |
| Qwen3-8B | 74.7% | 54.7% | 95.7% | 68.8% | 44 | 61% |
| Mistral-7B | 99.9% | 58.7% | 99.9% | 89.8% | 113 | 35% |
Knowledge Graphs
Knowledge graphs represent entities and relationships as structured, queryable networks for integrating data and supporting reasoning.
See all 259 papers