Manuscript Offprint
arXiv:2610.13648SPARQL-LLM in the TEXT2SPARQL 2026 Challenge
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Querying distributed data represented as Knowledge Graphs (KGs) via SPARQL remains a difficult task, requiring fluency in query syntax, endpoint specifications, and schema details. Knowledge Graph Question Answering (KGQA) systems address this by automatically translating natural language into SPARQL, and recent advances in Large Language Models (LLMs) have made this translation increasingly feasible. In this paper, we describe SPARQL-LLM, our open-source KGQA system, in the context of the TEXT2SPARQL 2026 challenge. In this challenge, SPARQL-LLM ranks first overall among eight competing approaches across all datasets, achieving up to 59% higher accuracy than the second-best approach and supporting multilingual question answering in English, German, and Spanish. SPARQL-LLM is publicly released at https://github.com/sib-swiss/sparql-llm and deployed in production over decentralized bioinformatics KGs at https://www.expasy.org/chat.
Keywords
Large Language Models, SPARQL, TEXT2SPARQL, Bioinformatics, Knowledge Graphs
In this context, the TEXT2SPARQL Challenge , which was first launched in 2025, introduced a multi-dataset and multi-lingual text-to-SPARQL benchmark with the overall goal of challenging the participating systems to improve the accessibility of Knowledge Graphs through more intuitive querying interfaces. After a successful first edition with six participating approaches, TEXT2SPARQL was relaunched in 2026 with a second edition. In the 2026 edition, eight approaches competed, among them SPARQL-LLM [5], the system we present in this paper.
The key takeaways of our participation in the challenge are summarized as follows:
• SPARQL-LLM ranks first overall among eight competing approaches across all categories, achieving up to 59% higher accuracy than the second best approach;
• SPARQL-LLM supports multilingual question answering in English, German, and Spanish;
• SPARQL-LLM is released as an open-source project at https://github.com/sib-swiss/sparql-llm and deployed over decentralized bioinformatics KGs at https://www.expasy.org/chat.
Second International TEXT2SPARQL Challenge, Co-Located with Text2KG at ESWC26, May 10, 2026, Dubrovnik, Croatia.
*Corresponding author.
These authors contributed equally.
panayiotis.smeros@sib.swiss (P. Smeros); vincent.emonet@sib.swiss (V. Emonet); ruijie.wang@sib.swiss (R. Wang); ana-claudia.sima@sib.swiss (A. Sima); tarcisio.mendes@sib.swiss (T. Mendes de Farias)
© 2026 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
Table 1
LLM configuration of SPARQL-LLM; a detailed description of its architecture is provided in [5].
| System | LLM Provider | Version | Context | Temperature | Max Tokens | Seed | Knowledge Cutoff |
|---|---|---|---|---|---|---|---|
| SPARQL - LLM | OpenAI | GPT-5.2 | 400K | 0 | 16K | 42 | 08/2025 |
2. Related Work
In the 2025 edition of the TEXT2SPARQL challenge [6], several systems leveraging LLMs were submitted, which can be broadly organized by their main strategy: agent-based exploration, in which the LLM iteratively invokes tools to discover the schema of the KG [7, 8, 9]; fine-tuning of autoregressive models for query generation [10]; and RAG-based context construction, injecting retrieved example question-query pairs, data shapes, and ontology fragments into the prompt [11, 12]. Similarly, in the 2026 edition, some of these systems evolved, while new systems, including SPARQL-LLM [5], participated for the first time. Notably, the Liber-AI team, as part of their project named Neural SPARQL Machines, proposed two new approaches based on the Qwen and Claude models. Additionally, Iris proposed another system using the Qwen model, the InfAI team introduced three closely related variants of ARUQULA, and a team from the University of Freiburg proposed GRASP.
While the agentic methods proposed by these related approaches have some advantages, since accessing complex tools allows them to adapt to arbitrary queries, they also face critical limitations. First, efficiency remains a challenge; each new question often requires rediscovering schema patterns from scratch, resulting in long runtimes (e.g., dozens of tool calls) and high costs due to token usage. Second, complex query patterns remain difficult to handle; agents may fail to converge or require many iterations. SPARQL-LLM, on the other hand, follows a retrieval-based approach, aiming for real-time query generation with minimal interactions with the LLM. By assembling the context ahead of query time, it avoids both limitations by construction: the number of LLM interactions per question is fixed rather than data-dependent, and there is no agent loop that can fail to converge. In fact, in our experimental evaluation, we showcase that even with the real-time requirement, we can still achieve remarkable performance with respect to the correctness of the generated queries.
3. Experimental Evaluation
In this section, we describe the experimental evaluation framework, SPARQL-LLM and the other competing systems, and the corresponding results of the 2026 edition of the TEXT2SPARQL challenge.
3.1. Experimental Setup
Similarly to the 2025 edition of the challenge, the 2026 edition also comprises two subtasks: i) a task with a well-known and well-documented KG (DBpedia), consisting of 50 natural language questions in English and Spanish, and ii) a task with an unknown and undocumented KG regarding a private corporation (named Corporate), consisting of 50 questions in English and German.
3.2. SPARQL-LLM
A detailed description of the architecture of SPARQL-LLM is provided in [5]; specifically for this challenge, our LLM configuration is presented in Table 1. Furthermore, we provide two main types of context to SPARQL-LLM: i) existing examples of pairs of natural language questions and SPARQL queries, and ii) schema information of the SPARQL endpoints.
For DBpedia, we use the example sets proposed by the challenge organizers, which consist of the following: i) LC-QuAD [13], a template-generated KGQA corpus, ii) QALD-9+ [14], an aggregate of nine editions of the KGQA corpus, QALD, and iii) the test set of the 2025 edition of the challenge, which consists of 100 natural language questions in English and Spanish.


SPARQL-LLM
GRASP
IRIS
Liber
Liber
ARUQULA
ARUQULA
ARUQULA
Figure 1: Visualization of the overall results of the experiments produced by T2S-Metrics [15]. As we observe, SPARQL-LLM ranks first for both DBpedia and Corporate, with significant margin from the second best system.
As for Corporate examples, since the KG is completely unknown and undocumented, and the provided ontology is relatively small—13 classes and 30 properties, we utilized an LLM, appropriately prompted to generate pairs of natural language questions and SPARQL queries . The LLM we utilized (DeepSeek-V3) was released before the publication of the test questions of the challenge; thus, it had no access to these questions during its training. Finally, as an additional verification step, we run the generated queries against the SPARQL endpoint of the Corporate KG and discard queries with no results. Examples of such queries include: “List products with missing price information” and “Show agents with multiple areas of expertise”, which cover the basic SPARQL functionality and the basic knowledge of the KG. Similarly to DBpedia, we also provided as examples the test set of the 2025 edition of the challenge, which consists of 50 natural language questions in English.
3.3. Results
As shown in Figure 1, SPARQL-LLM is evaluated against four other systems, two of which were submitted with multiple variants to the challenge. In both DBpedia and Corporate subtasks, SPARQL-LLM showcases a substantial increase in F1 Score relative to the second-best performing system. In Tables 2, 3, 4, 5, we present the breakdown of the results by dataset and by language. SPARQL-LLM achieves the best result in all subtasks, as illustrated in the result tables, which demonstrates the robustness of the system and of the overall results. Indicatively, SPARQL-LLM achieves the best overall improvement for DBpedia in Spanish, a 59% higher F1 Score compared to the second-best system.
Finally, the total cost of all the LLM calls of SPARQL-LLM for TEXT2SPARQL 2026 was less than $3, confirming that it is not only the most accurate system but also a system with minimal operational cost.
4. Conclusion
We presented SPARQL-LLM, the top-ranked system in the TEXT2SPARQL 2026 challenge. SPARQL-LLM leverages lightweight metadata from SPARQL endpoints to construct an optimized context for the task of translating (multilingual) natural language questions to SPARQL queries. SPARQL-LLM outperformed all the other systems participating in the challenge, achieving the best accuracy at minimal operational cost. The system is available as an open-source project at https://github.com/sib-swiss/sparql-llm.
The prompt used for generating examples: You are an assistant that helps users formulate pairs of Natural Language Questions that correspond to SPARQL Queries. Your role is to generate {number} example pairs based on the provided ontology consisting of 13 classes and 30 properties: {ontology}
Table 2
English DBpedia results: SPARQL-LLM achieves 17% higher F1 Score than the second-best system (ARUQULA).
| System | F1-score | Recall | Precision |
|---|---|---|---|
| SPARQL-LLM | .7192 | .7359 | .7292 |
| GRASP | .3296 | .4964 | .2918 |
| IRIS | .2897 | .3312 | .2795 |
| .3235 | .3360 | .3360 | |
| .3129 | .3199 | .3110 | |
| .6142 | .6498 | .6211 | |
| .2539 | .3026 | .2767 | |
| .0000 | .0000 | .0000 |
Table 3
Spanish DBpedia results: SPARQL-LLM achieves 59% higher F1 Score than the second-best system (ARUQULA).
| System | F1-score | Recall | Precision |
|---|---|---|---|
| SPARQL-LLM | .7810 | .7936 | .7927 |
| GRASP | .3288 | .5536 | .2632 |
| IRIS | .2914 | .3374 | .2837 |
| .3730 | .3943 | .3653 | |
| .2361 | .2390 | .2385 | |
| .4904 | .5526 | .4798 | |
| .2200 | .2722 | .2835 | |
| .0000 | .0000 | .0000 |
Table 4
English Corporate results: SPARQL-LLM achieves 33% higher F1 Score than the second-best system (ARUQULA).
| System | F1/NDCG | Recall | Precision | F1 | NDCG |
|---|---|---|---|---|---|
| SPARQL-LLM | .8539 | .8467 | .8649 | .8510 | 1.0000 |
| GRASP | .5319 | .7980 | .4373 | .5262 | .7309 |
| IRIS | .2895 | .2923 | .3045 | .2896 | .3482 |
| .3208 | .3662 | .3151 | .3215 | .3482 | |
| .1745 | .2078 | .1660 | .1724 | .3316 | |
| .6409 | .6606 | .6428 | .6437 | .5000 | |
| .2067 | .2129 | .2061 | .1937 | .8485 | |
| .5211 | .6836 | .5524 | .5279 | .2760 |
Table 5
German Corporate results: SPARQL-LLM achieves 30% higher F1 Score than the second-best system (ARUQULA).
| System | F1/NDCG | Recall | Precision | F1 | NDCG |
|---|---|---|---|---|---|
| SPARQL-LLM | .8141 | .8166 | .8117 | .8104 | 1.0000 |
| GRASP | .4993 | .7598 | .3979 | .4892 | .8461 |
| IRIS | .1432 | .1541 | .1421 | .1460 | .0000 |
| .3497 | .4200 | .3368 | .3510 | .3482 | |
| .2399 | .2553 | .2385 | .2390 | .3482 | |
| .6242 | .6273 | .6268 | .6230 | .7686 | |
| .1125 | .1536 | .1076 | .1148 | .0000 | |
| .3792 | .4998 | .4230 | .3827 | .2311 |
Acknowledgments
This work was funded by the SNSF MetaboLinkAI project, grant: 10.002.786 and by SERI via the HORIZON-INFRA-2024-EOSC-01-05 project EOSC Data Commons under grant agreement 101188179.
Declaration on Generative AI
During the preparation of this paper, the authors used Claude (Anthropic) for grammar, spelling, paraphrasing, and stylistic edits. After using these services, the authors reviewed and edited the content as needed; hence, the authors take full responsibility of the content of this paper.
References
[1] E. L. McCarthy, B. P. Vandervalk, M. D. Wilkinson, SPARQL assist language-neutral query composer, BMC Bioinform. 13 (2012) S2. URL: https://doi.org/10.1186/1471-2105-13-S1-S2. doi:10.1186/1471-2105-13-S1-S2.
[2] Y. Lan, G. He, J. Jiang, J. Jiang, W. X. Zhao, J. Wen, A survey on complex knowledge base question answering: Methods, challenges and solutions, in: Z. Zhou (Ed.), Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI 2021, Virtual Event / Montreal, Canada, 19-27 August 2021, ijcai.org, Virtual Event / Montreal, Canada, 2021, pp. 4483–4491. URL: https://doi.org/10.24963/ijcai.2021/611. doi:10.24963/IJCAI.2021/611.
[3] D. Diefenbach, V. Lopez, K. Singh, P. Maret, Core techniques of question answering systems over knowledge bases: a survey, Knowledge and Information systems 55 (2018) 529–569.
[4] J. D'Abramo, A. Zugarini, P. Torroni, Investigating large language models for text-to-SPARQL generation, in: W. Shi, W. Yu, A. Asai, M. Jiang, G. Durrett, H. Hajishirzi, L. Zettlemoyer (Eds.), Proceedings of the 4th International Workshop on Knowledge-Augmented Methods for Natural Language Processing, Association for Computational Linguistics, Albuquerque, New Mexico, USA, 2025, pp. 66–80. URL: https://aclanthology.org/2025.knowledgenlp-1.5/. doi:10.18653/v1/2025.knowledgenlp-1.5.
[5] P. Smeros, V. Emonet, R. Wang, A.-C. Sima, T. M. de Farias, SPARQL-LLM: Real-time sparql query generation from natural language questions, arXiv preprint arXiv:2512.14277 (2025).
[6] E. Marx, P. do Carmo, M. Gôlo, S. Trump (Eds.), Preface of the First International TEXT2SPARQL Challenge (TEXT2SPARQL'25), CEUR Workshop Proceedings, Portorož, Slovenia, 2025.
[7] R. Dorsch, D. Henselmann, A. Harth, Graf von data: A knowledge graph question answering agent for organisational usage, in: First International TEXT2SPARQL Challenge, Co-Located with Text2KG at ESWC25, CEUR Workshop Proceedings, Portorož, Eslovënia, 2025, pp. 32–48.
[8] F. Brei, L. B’uhmann, J. Frey, D. Gerber, L.-P. Meyer, C. Stadler, K. Bulert, Aruqula - an llm based text2sparql approach using react and knowledge graph exploration utilities, in: First International TEXT2SPARQL Challenge, Co-Located with Text2KG at ESWC25, CEUR Workshop Proceedings, Portorož, Eslovënia, 2025, pp. 49–53.
[9] A. Perevalov, B. Andreas, Text-to-sparql goes beyond english: Multilingual question answering over knowledge graphs through human-inspired reasoning, in: First International TEXT2SPARQL Challenge, Co-Located with Text2KG at ESWC25, CEUR Workshop Proceedings, Portorož, Eslovënia, 2025, pp. 67–73.
[10] T. Soru, S. Joshi, S. Tiwari, M. Shahinmoghadam, A. Panchbhai, Question answering over dbpedia with fine-tuned autoregressive models, in: First International TEXT2SPARQL Challenge, Co-Located with Text2KG at ESWC25, CEUR Workshop Proceedings, Portorož, Eslovënia, 2025, pp. 20–31.
[11] J. G. Wardenga, T. K'after, Leveraging data shapes in large language model contexts for question answering on public and private knowledge graphs, in: First International TEXT2SPARQL Challenge, Co-Located with Text2KG at ESWC25, CEUR Workshop Proceedings, Portorož, Eslovënia, 2025, pp. 1–19.
[12] D. Berezin, R. Avdeev, O. Somov, Airi team in text2sparql challenge: Text-to-sparql executor for question-answering over knowledge graphs, in: First International TEXT2SPARQL Challenge, Co-Located with Text2KG at ESWC25, CEUR Workshop Proceedings, Portorož, Eslovënia, 2025, pp. 54–66.
[13] P. Trivedi, G. Maheshwari, M. Dubey, J. Lehmann, Lc-quad: A corpus for complex question answering over knowledge graphs, in: C. d'Amato, M. Fernández, V. Tamma, F. Lécué, P. Cudré-Mauroux, J. F. Sequeda, C. Lange, J. Heflin (Eds.), The Semantic Web - ISWC 2017 - 16th International Semantic Web Conference, Vienna, Austria, October 21-25, 2017, Proceedings, Part II, volume 10588 of Lecture Notes in Computer Science, Springer, Vienna, Austria, 2017, pp. 210–218. URL: https://doi.org/10.1007/978-3-319-68204-4_22. doi:10.1007/978-3-319-68204-4_22.
[14] A. Perevalov, D. Diefenbach, R. Usbeck, A. Both, Qald-9-plus: A multilingual dataset for question answering over dbpedia and wikidata translated by native speakers, in: 16th IEEE International Conference on Semantic Computing, ICSC 2022, Laguna Hills, CA, USA, January 26-28, 2022, IEEE, n.p., 2022, pp. 229–234. URL: https://doi.org/10.1109/ICSC52841.2022.00045. doi:10.1109/ICSC52841.2022.00045.
[15] Y. Taghzouti, T. Jiang, C. Juigné, B. Navet, F. Gandon, F. Michel, L.-F. Nothias, T2s-metrics: Unified library for evaluating sparql queries generated from natural language, 2026. URL: https://inria.hal.science/hal-05598018/.