Assessing SPARQL capabilities of Large Language Models

Lars-Peter Meyer, Johannes Frey, Felix Brei, Natanael Arndt
9/9/2024
cs.DBcs.AIcs.CL

No official code found. Best implementation: AKSW/LLM-KG-Bench (59 stars, MPL-2.0, last commit 2026-03-10). 2 more below.

Abstract

The integration of Large Language Models (LLMs) with Knowledge Graphs (KGs) offers significant synergistic potential for knowledge-driven applications. One possible integration is the interpretation and generation of formal languages, such as those used in the Semantic Web, with SPARQL being a core technology for accessing KGs. In this paper, we focus on measuring out-of-the box capabilities of LLMs to work with SPARQL and more specifically with SPARQL SELECT queries applying a quantitative approach. We implemented various benchmarking tasks in the LLM-KG-Bench framework for automated execution and evaluation with several LLMs. The tasks assess capabilities along the dimensions of syntax, semantic read, semantic create, and the role of knowledge graph prompt inclusion. With this new benchmarking tasks, we evaluated a selection of GPT, Gemini, and Claude models. Our findings indicate that working with SPARQL SELECT queries is still challenging for LLMs and heavily depends on the specific LLM as well as the complexity of the task. While fixing basic syntax errors seems to pose no problems for the best of the current LLMs evaluated, creating semantically correct SPARQL SELECT queries is difficult in several cases.

View on arXivView PDF

Code Implementations(3)

AKSW/LLM-KG-BenchCommunity100%
MPL-2.0

LLM-KG-Bench is a Framework and task collection for automated benchmarking of Large Language Models (LLMs) on Knowledge Graph (KG) related tasks.

595HTML, ShellMay 24, 20237 months agoMPL-2.0
knowledge-graphlarge-language-modelsllmllm-benchmarkingrdf+1 more

Collection of results generated with LLM-KG-Bench

40ShellJul 4, 202310 months ago

results of SPARQL LLM-KG-Bench tasks for article "Assessing SPARQL capabilities of Large Language Models"

01May 12, 20241 years ago

Similar Papers

Cite this paper

@article{meyer2024assessing,
  title  = {Assessing SPARQL capabilities of Large Language Models},
  author = {Lars-Peter Meyer and Johannes Frey and Felix Brei and Natanael Arndt},
  year   = {2024},
  eprint = {2409.05925},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.05925v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2409.05925.svg)](https://codeofpaper.com/paper/2409.05925)

Discussion