Abstract
Current large language models (LLMs) can work with structured information and even assist developing program code, but can they support working with knowledge graphs (KGs) as well? Which LLM is offering the best capabilities in the field of semantic web and knowledge graph engineering (KGE)? Is it possible to determine this without manually checking many answers? The LLM-KG-Bench framework is designed to answer these questions. It consists of an extensible set of tasks for which the LLM answers are automatically evaluated, and covers different aspects of working with semantic technologies. This article gives a description of the LLM-KG-Bench framework, its main concepts, and the tasks implemented. In a benchmark run, a comprehensive dataset has been generated with it, evaluating more than 40 contemporary open and proprietary LLMs with 26 benchmark tasks, resulting in interaction logs and evaluations of roughly 45 000 LLM task dialogues. Finally, this dataset is used for an analysis of the SPARQL-related capabilities of the LLMs tested.
Introduction
The combination of large language models (LLMs) and knowledge graphs (KGs) offers great synergetic potential for various knowledge-driven applications and is still gaining more traction within the research community. However, the ongoing rapid development in the field of LLMs makes it difficult to keep up with the latest developments and put them into context of prior work. Several initiatives for automated benchmarking, like BIG-bench (Srivastava et al., 2023), HELM (Liang et al., 2023), or Chatbot-Arena (Chiang et al., 2024), address the need for systematic evaluation of LLM performance. However, the tasks in scope of these evaluations are very general and do not address topics specifically related to KGs.
With the benchmarking framework LLM-KG-Bench, we are particularly focusing on automatically assessing and comparing LLMs regarding their capabilities to cope with Semantic Web technologies. This includes basic capability checks to establish a scientific foundation, as well as more practical tasks. The existing tasks cover already the Knowledge Graph Engineering (KGE) areas, RDF KG serialization, KG construction, SPARQL and KG schema, and the framework is open to support more tasks. Connectors for many open weight and top-ranking commercial LLMs are included.
Our investigation has been guided by the following overarching research questions:
RQ 1: Can KGE-related capabilities of LLMs be evaluated in an automated way?
RQ 2: Should specific LLMs be favored for specific tasks or KG data formats? And if so, to which extent do their capabilities differ and how can it be measured which LLM fits best for which task?
And specific to SPARQL SELECT queries:
RQ 3: Can LLMs follow the syntactic rules of SPARQL SELECT queries?
RQ 4: Can LLMs parse the semantics of SPARQL SELECT queries and act accordingly?
RQ 5: Can LLMs write semantically correct SPARQL SELECT queries for a given question and KG?
We present here an overview on the current state of the LLM-KG-Bench framework together with an evaluation dataset on more than 40 current LLMs and an evaluation of their SPARQL-SELECT-query-related capabilities. The LLM-KG-Bench framework is developed for automated benchmarking of Knowledge-Graph-related capabilities of LLMs.
The main contribution of this article is threefold:
We provide a description of the current state of the framework, including main concepts, its API, supported model connectors and tasks. We present a dataset on the evaluation of more than 40 LLMs. The dataset includes detailed logs, interaction data and the evaluation result. This enables other researchers to extend this dataset, reproduce our analysis or run additional analyses, for example, by updating the framework code and using the framework’s reevaluation feature. As a demonstration of the frameworks’ analytical capabilities and the generated dataset, we evaluate the SPARQL-SELECT-query-related capabilities of the selected LLMs.
This is an extended version of previous work by Meyer et al. (2025) with a similar use case as the one presented in Meyer et al. (2024). The added contribution of this paper compared to our previous work consists of:
a unified source of truth for the current state of the LLM-KG-Bench framework, especially based on current conference and workshop articles (Heim et al., 2025; Meyer et al., 2024, 2025) a refined description of capabilities that an LLM needs to have in order to solve the benchmark tasks the enrichment of the previous result dataset by executing the benchmark framework against several top-ranked LLMs grouping and refining of the capability plots together with the computation and analysis of an aggregated score for the SPARQL-related capabilities of the LLMs tested an improvement of the analysis of using Turtle (TTL) versus JSON-LD RDF serialization format in tasks by including a per-model as well as a per-task summary.
Related Work
LLM Evaluation
Attempts on exploring and navigating the vast amount of LLMs are made in form of several LLM leaderboards, which provide evaluation services for LLMs in form of selections of benchmarks or workloads. We discuss here the most relevant ones that we discovered during our research.
Focusing mainly on commercial models, the Chatbot Arena 1 (Chiang et al., 2024) lists scores for MMLU 2 and MT-bench (Bai et al., 2024), and also calculates its own arena-score (based on prompts given by users, processed by two models side-by-side and evaluated by the same user voting for his preferred answer). For open models, the Open-LLM-Leaderboard 3 provides a list of benchmark results with over 2,000 tested models and several scores plus a carbon dioxide emission estimate. The most exhaustive list is provided by HELM 4 (Liang et al., 2023) which includes also domain-specific tests like LegalBench and MedQA. While a comparison of the individual benchmark suites would go beyond the scope of this paper, to the best of our knowledge, none of these general leaderboards addresses knowledge graph engineering (KGE) tasks.
Moreover, what is generally amiss is a benchmark execution framework that helps to deal with the particularities of RDF- and KG-related workloads (format parsing, syntax check feedback loops, execution and evaluation of queries toward KGs, etc.). Although early attempts have been made by BIG-bench (Srivastava et al., 2023), it is falling short of building an efficient base for evaluating LLM capabilities in the context of KGE tasks, due to insufficiencies of the provided Task API, along with the focus on multiple choice tasks and scores based on string or document similarities.
In the face of these issues, our LLM-KG-Bench framework aims to reduce complexity and facilitate creating, executing, evaluating, and analyzing KG-related tasks. Its procedures focus on the syntactically and semantically correct generation of RDF (i.e., in Turtle) and SPARQL.
Current efforts in benchmarking coding capabilities seem more closely related to characteristics of KGE capabilities benchmarking, at a conceptual level (e.g., with respect to output format requirements, instruction complexity, and response evaluation strategies). Several leaderboards, like the Big Code Models Leaderboard 5 for Java, Javascript, and CPP, or the EvalPlus Leaderboard 6 for Python assess the coding proficiency of LLMs. We included some of the models ranked there into our test set.
RDF-Related Evaluation
In the current literature 7 that explores the combination of LLMs and KGs (Meyer et al., 2023b; Pan et al., 2023, 2024), several attempts on evaluating the application of LLMs for KG-related tasks are made. However, these LLM evaluations often focus on details for a very selective problem in a specific task area, like Text to RDF (e.g., Mihindukulasooriya et al., 2023; Zhu et al., 2024), Knowledge Base Extraction from LLMs (e.g., Kalo et al., 2025; Petroni et al., 2019; Singhania et al., 2022), Knowledge Graph Question Answering (KGQA, e.g., Usbeck et al., 2019), Text2SPARQL (e.g., Kovriguina et al., 2023; Marx et al., 2025; Zahera et al., 2024) or generation of RDF mapping language (RML) mappings (e.g., Hofer et al., 2024). Unfortunately, many of these evaluations have been conducted manually, which causes scalability issues with respect to more repetitions and including more or newer models. In case an automated evaluation has been performed, the underlying code usually lacks adaptability to encompass new models or task variations. A benchmarking effort that is related to our interest in studying the JSON-LD capabilities, is StructuredRAG (Shorten et al., 2024). It consists of six tasks designed to assess LLM capabilities in following response format instructions according to JSON templates. Table 1 compares several of the mentioned LLM evaluation approaches with respect to the covered LLMs, addressed KGE tasks and their evaluation mode. Only the LLM-KG-Bench framework combines automatic evaluation for many covered LLMs and several KGE topics.
Comparison of Some of the LLM Evaluation Approaches Mentioned Here.
Comparison of Some of the LLM Evaluation Approaches Mentioned Here.
Best values are marked with bold font. Only the LLM-KG-Bench framework automatically evaluates several knowledge graph engineering (KGE) tasks and covers many LLMs in a benchmark run.
The interpretation and generation of the query language SPARQL, being a core technology for accessing KGs, is one especially relevant example of integrating Semantic Technology with LLMs.
Rangel et al. (2024) introduce a method for fine-tuning OpenLLaMA to generate SPARQL queries for question answering on life science knowledge graphs. Their approach leverages data augmentation techniques, such as the use of meaningful variable names and inline comments, which lead to improved accuracy in SPARQL query generation.
Bustamante and Takeda (2024) focus on enhancing the generation of SPARQL queries from natural language questions. They employ a GPT model to identify the most challenging aspects of the Text2SPARQL task, aiming to apply targeted solutions to these difficulties.
Avila et al. (2024) evaluate ChatGPT’s performance in answering natural language questions on knowledge graphs. Their method, Auto-KGQAGPT, explores translating such questions into SPARQL queries using prompts that include relevant knowledge graph fragments.
Li et al. (2024) address the performance drop seen in real-world conditions where high-quality annotated data are lacking. They propose the FlexKBQA framework, which uses template SPARQL queries that are converted into natural language questions via LLMs to produce synthetic training data. This data is used to fine-tune a lightweight SPARQL generator, further refined with real queries to bridge the gap between synthetic and real-world inputs.
Diallo et al. (2024) provide a thorough evaluation comparing pre-trained language models, non-pre-trained language models, and LLMs, along with various fine-tuning strategies. Their error analysis reveals that incorrect URIs, often caused by hallucinations, are a major source of failure in generated SPARQL queries. Hirigoyen et al. (2022) demonstrate that incorporating a copy mechanism can help mitigate such hallucinations.
Kovriguina et al. (2023) present SPARQLGEN, a one-shot generation technique that uses LLMs to produce SPARQL queries. Their method includes the full context comprising the question, a relevant RDF subgraph, and an example query within a single prompt.
Pliukhin et al. (2023) propose a similar approach to SPARQLGEN for query generation over the ORKG scholarly knowledge graph, enhanced with a more advanced subgraph extraction method. Zahera et al. (2024) extend this by incorporating chain-of-thought prompting and using the GERBIL QA system (Usbeck et al., 2019).
Lehmann et al. (2023) advocate the use of Controlled Natural Language (CNL) as a user interface due to its proximity to natural language. They show that CNL can be reliably and unambiguously translated into formal query languages like SPARQL, significantly reducing the need for large training datasets.
Diefenbach et al. (2017) introduce two datasets for training and benchmarking QA systems on Wikidata: One derived from the SimpleQuestions dataset (Bordes et al., 2015), and another based on user logs and feedback.
Dubey et al. (2019) extend the LC-QuAD dataset and introduce LC-QuAD 2.0 (Trivedi et al., 2017), which is compatible with both Wikidata and DBpedia. The dataset comprises 30,000 questions, including paraphrases and corresponding SPARQL queries.
Banerjee et al. (2022) explore various ways to integrate LLMs into standard knowledge graph workflows. Their focus is on models that can be fine-tuned with consumer-grade hardware, in contrast to approaches focusing on large-scale models used without additional training.
Frey et al. (2025) demonstrate the long-term value of automated benchmarking through the LLM-KG-Bench platform. They compare multiple LLM iterations with a focus on their ability to handle RDF Turtle syntax, preserving responses for future evaluation. Heim et al. (2025) is an example of such a separate evaluation.
Hofer et al. (2024), consistent with the findings by Frey et al. (2023; 2025), investigate LLM-driven RML mapping generation in Turtle. They find that while syntactic errors occur, most LLMs can correct these mistakes. Given that SPARQL is built on Turtle, the authors conduct their experiments as multi-turn dialogues with feedback loops for error correction.
The recently organized ”First International Text2Sparql Challenge” (Marx et al., 2025) shows the potential of best LLM agent-based approaches (Brei et al., 2025; Liu et al., 2024b; Perevalov & Both, 2025) for the Text2Sparql problem and a specific automatic evaluation approach roughly similar to the Text2Sparql evaluation used in LLM-KG-Bench. But it shows as well the open gap, as the best participants reached only scores of about
Nevertheless, none of these existing works reach the goal of automatic evaluation on many KGE-related tasks as presented here with the LLM-KG-Bench framework in version 3.
The LLM-KG-Bench Framework
Benchmarking LLMs involves significant time, financial costs, organizational effort, and the evaluation process can often be imprecise. LLM-KG-Bench is designed to simplify the creation of KG-related assessments while providing a foundational infrastructure for further development. Its main features are:
In the following sections, we describe the basic concepts and infrastructure of the LLM-KG-Bench framework in greater detail.
Architecture and Main Concepts
Figure 1 gives an overview on the LLM-KG-Bench framework and its execution flow. It is build around some main concepts we want to describe here. We start with the general concept of the Prompt-Answer-Evaluate loop before going further to LLM connectors, tasks, execution scopes, configuration, and scores.

Overview on the execution flow of the LLM-KG-Bench framework. A execution configuration defines some settings and selects LLM connectors as well as evaluation tasks from a benchmark configuration. In the benchmark execution all given combinations of evaluation tasks and LLM connectors are executed for the number of iterations each as task evaluation iteration. In the task evaluation iteration the task provides a prompt which is answered by the LLM via the LLM connector and the answer is evaluated by the task, maybe resulting in further Prompt-Answer-Evaluate rounds. All results and logs from the task executions is stored for later analysis, visualization or reevaluation. Source: LLM-KG-Bench documentation, updated version of Meyer et al. (2023a).
Prompt-Answer-Evaluate Loop. The evaluation of LLMs is based on dialogues, consisting of prompts and answers. This enables tasks to make use of the chat capability of modern LLMs and their bigger supported context size to get the answer closer to the correct one in an iterative way.
The Prompt-Answer-Evaluate loop starts with the generation of an initial prompt that is sent to an LLM. In the next step, the produced answer is evaluated. Based on the evaluation result, the framework can decide to start a new Prompt-Answer-Evaluate round or stop the dialogue. The process from initial prompt to the stop of the dialogue is named a task evaluation iteration.
The structure of these loops is shown in Figure 2(a) and an example dialogue is given in Figure 4. The prompt and evaluate parts are implemented in evaluation tasks and the answer is organized with the help of LLM connectors.

Overview of the evaluation workflow and execution scopes. (a) The Prompt-Answer-Evaluate loop for the task – LLM interaction as organized by the framework. Prompting and evaluation is covered by the task, the answer is generated by the LLM, and (b) different execution scopes: task evaluation iterations (includes one to many cycles of the Prompt-Answer-Evaluate loop), task evaluation execution (includes all iterations), benchmark execution (includes all task executions for all combinations of tasks and LLM models defined for all iterations).

UML class diagram of the Task API and its reference by some example evaluation tasks. All evaluation tasks implement the AbstractLlmKgBenchInterface via an inheritance connection. A task can be described with a TaskInfo object. A TaskExecutionInfo references this TaskInfo object for the documentation.

Fictive example dialogue for the RdfSyntaxFixList task with a missing dot in Turtle syntax. Some text left out is marked with ”…”. The LLM’s first answer is missing the expected code block with the fixed Turtle which is corrected in the second answer.
LLM Connectors and LLM Connector Classes. The LLM connectors (or model connectors) offer a consistent abstraction layer to interact with a specific LLM (or model). In the benchmark configuration the LLM connectors are defined by parametrizing LLM connector classes for specific LLMs. Several LLM connector classes classes are implemented in the LLM-KG-Bench framework as described in Section 3.3, adding support for many different LLMs.
Evaluation Tasks, Task Classes, and Parametrized Tasks. The evaluation tasks (or benchmark tasks) are the main building block of a benchmark and automatically evaluate the LLM answers. For the Prompt-Answer-Evaluate loop the tasks provide the prompt and evaluation functionality.
Task Classes and Parametrized Tasks. The evaluation tasks can be defined either direct in task classes or as parametrized task classes derived in the benchmark configuration from a task class with a task parameters definition.
Task Parameters. Several task classes support as task parameter a targeted task size or a serialization format parameter. The targeted task size task parameter defines the count of characters expected to be exchanged with the LLM connector in one task iteration.
List Tasks and Task Case Entries. List tasks have a list of task case entries, where each entry defines a distinct exercise resulting in a specific prompt and expected answer. For each task iteration one task case entry is selected from this list. All task case entries are evaluated by the same list task.
Task Evaluation Iterations. We name one task evaluation loop consisting of one or more Prompt-Answer-Evaluate rounds a task evaluation iteration (or a dialog), see also Figure 2(b).
Task Evaluation Executions. Since LLM answers are generated probabilistically, a configurable number of task evaluation iterations is executed, collectively forming a task evaluation execution for a specific task and a particular LLM, see also Figure 2(b).
Benchmark Executions. A benchmark execution consists of all task executions for all combinations of tasks and models defined in the execution configuration, see also Figure 2(b).
Result Reevaluation. LLM answers recorded in a benchmark execution can get reevaluated by repeating the task evaluation code with the LLM connector interactions substituted with the stored interactions. When looking at the Prompt-Answer-Evaluate loop given in Figure 2(a), the evaluate code is reexecuted but prompt and answer is taken from the recorded interaction. This makes it possible to reproduce evaluation results and even offers the chance to run updated evaluation code on given answers without the need of new maybe costly or differing LLM interactions.
Benchmark Configuration and Execution Configuration. A benchmark configuration specifies the tasks and models to be included in a benchmark run together with the number of iterations per task execution. A benchmark configuration can be executed as a whole or with a selection of tasks and models defined by command line parameters.
Evaluation Scores and Infos. An evaluation task should compute for each task evaluation iteration a key value dictionary containing one or more evaluation scores with values in the range of
Evaluation tasks are implemented following the Task API as a common interface between evaluation tasks and the framework. In LLM-KG-Bench framework Version 3, a major update of the Task API was introduced together with new helper classes. Figure 3 shows a UML class diagram of the new Task API.
All evaluation tasks in LLM-KG-Bench implement the interface AbstractLlmKgBenchTaskInterface. It defines the interface between evaluation tasks and the framework, including the method signatures for Evaluate and Prompt steps as well as task serialization and deserialization.
The following methods defined in the AbstractLlmKgBenchTaskInterface are especially important:
The abstract implementation AbstractLlmKgBenchTaskClass helps to reduce redundant code and eases the concrete task implementation. For the two main variations of tasks, single-prompt tasks and dialogue-tasks, specialized abstract classes are provided. The AbstractDialogTask class helps with handling the score and info values produced by each Prompt-Answer-Evaluate round and computes mean and max aggregate values for scores at the end of a task evaluation iteration. Tasks that store their task data in an encrypted file can benefit from the abstract class AbstractFileListTaskImplementation.
This task API is inspired by the BIG-bench (Srivastava et al., 2023) task classes but has a more detailed abstraction to let the framework orchestrate the tasks Prompt-Answer-Evaluate loop shown in Figure 2(a). Nonetheless the task API should be similar enough with the common generic benchmarking frameworks to keep the path of combining them open for the future. The new task API gives the central framework logic more flexibility in the orchestration, reduces error possibilities and reduces repeated code in tasks.
LLM Connectors and Supported Models
LLM connectors are responsible for offering standardized APIs to LLMs. They are defined similar to the BIG bench model class. The main method offered is
The LLM-KG-Bench framework offers several model connector classes:
Evaluation Tasks and Scores
Several tasks are implemented in the LLM-KG-Bench framework as described in several articles (Frey et al., 2023, 2025; Meyer et al., 2024, 2025, 2023a). The tasks range from basic RDF capability checks to establish a clean scientific foundation for further experiments, but include more practical tasks as well.
Here we list all task classes implemented at the moment together with the most important scores. More details are given in the referenced papers and in the tasks folder of the code repository
15
. Table 2 shows the relationship between the SPARQL-SELECT-query-related tasks and the research questions 3 to 5.
The most important score is The most important score is A former version is the The most important scores are
The most important score is The most important score is The most important score is The most important score is the previously explained The most important scores are The most important scores are the previously explained
Mapping of the Task Types to the Different Task Aspects and Research Questions Covered. Adopted from Meyer et al. (2024).
Mapping of the Task Types to the Different Task Aspects and Research Questions Covered. Adopted from Meyer et al. (2024).
Overview on the Different SPARQL-Related Tasks Implemented within LLM-KG-Bench Framework.
There are several benchmark datasets available which contain pairs of SPARQL SELECT queries and textual natural language questions for specific knowledge graphs. We selected and implemented benchmark tasks for a couple of current datasets for smaller and bigger knowledge graphs. Only English textual questions were used as we focus on SPARQL here and not language capabilities. A total of five tuples, each consisting of a question and corresponding SPARQL SELECT query, was manually selected from each dataset. This allows to rerun the tasks more often to reduce the random noise in the results.
Triples: Triples: Triples: Triples: Triples:
The list of SPARQL-related benchmark tasks created based on these resources in the LLM-KG-Bench framework is given in Table 3.
General Task Characterization
For a structured task characterization, we draw from frameworks from cognitive psychology and educational research. Bloom’s Taxonomy (Bloom, 1956) was originally developed to classify educational objectives based on the level of cognitive complexity required. It is based on behavioral observations of learning processes and was later revised to better fit modern views of cognitive psychology (Anderson & Krathwohl, 2001). Part of that revision includes the separation between what is known from what is done with it, leading to a Knowledge Dimensions framework (Anderson & Krathwohl, 2001). It distinguishes between types of knowledge required for different tasks. Relational Complexity Theory (Halford et al., 1998) was originally developed in developmental and comparative psychology and draws the notion of relational arity from formal systems in logic and computer science, including relational database theory. It models task difficulty as a function of the number of simultaneous relations that must be processed. Together, these models provide a basis for analyzing the cognitive-inspired and structural demands that the benchmark tasks impose.
The values in the characterization are assigned based on the minimal cognitive and structural requirements expected for successful task completion. Cognitive processes such as Understand are assigned when tasks require interpreting given information, while Apply corresponds to the execution of known procedures. Create is used when tasks involve generating new content and Analyze when tasks require decomposing and interpreting relations between elements. For knowledge dimensions, Factual knowledge is assigned when specific syntactic or terminological information is needed, Conceptual when structural or relational understanding is necessary and Procedural when correct application of methods is required. Relational complexity is rated as Low when tasks involve isolated or simple binary relations, and as Medium when multiple entities and relations must be coordinated simultaneously. Note that not all categories across the frameworks are represented, as the current set of tasks does not span the full theoretical space. The characterization is shown in Table 4.
Task Characterization According to Bloom’s Taxonomy (Bloom, 1956), the Knowledge Dimensions Framework (Anderson & Krathwohl, 2001) and Relational Complexity Theory (Halford et al., 1998).
Task Characterization According to Bloom’s Taxonomy (Bloom, 1956), the Knowledge Dimensions Framework (Anderson & Krathwohl, 2001) and Relational Complexity Theory (Halford et al., 1998).
We utilized the LLM-KG-Bench framework to evaluate a list of 41 LLMs with a selection of 26 tasks. The results containing the full dialog and evaluation data for all this about 45 000 LLM task dialogues (task Evaluation Iterations) is documented and publicly available for further analysis including reevaluation. Whenever new LLMs are of interest, their data can get added to the initial dataset (Meyer et al., 2025). An example for a statistical analysis on existing data generated is presented by Heim et al. (2025).
In the following section, we outline the experiment setup and some analysis results from this evaluation.
Experimental Setup
We adopted the default configuration to define the tasks and models included in this evaluation. As a trade-off between resource usage and confidence, we have decided to conduct 20 iterations for the proprietary LLMs and 50 iterations for the open LLMs. For the 41 LLMs selected and 26 selected evaluation tasks this get multiplied to 45 500 task evaluation iterations.
Selected Tasks
The benchmark was executed on the following 26 tasks that are described in Section 3.4 and in the code repository:
RdfSyntaxFixList (3 variations): For Turtle, JSON-LD and N-Triples as graph format RdfConnectionExplainStatic (4 variations): For Turtle, JSON-LD, RDF/XML and N-Triples as graph format RdfFriendCount (8 variations): For Turtle, JSON-LD, RDF/XML and N-Triples as graph format; 1 and 2 as additional link count SparqlSyntaxFixingList (1 variation): For LC-QuAD / Wikidata Sparql2AnswerList (1 variation): For Organizational graph Text2SparqlList (9 variations): For Organizational, Organizational-Numeric, Coypu-Mini and Beastiary
Selection of Proprietary LLMs
To get an overview on the current state-of-the-art proprietary models we selected three long-term high-ranked model families from the Chatbot Arena Leaderboard: OpenAI GPT, Google Gemini and Anthropic Claude. From these families, we selected the current models in various sizes and also included the latest GPT-3.5 for comparability with other results. The selected models together with their context size are shown in Table 5.
Details for the Models Selected for the Experiment Presented Here and the Iterations Evaluated Per Model and Task Combination.
Details for the Models Selected for the Experiment Presented Here and the Iterations Evaluated Per Model and Task Combination.
The parameter count of proprietary models is not documented and marked with a question mark (?) Here. proprietary model families are OpenAI-GPT, Google-Gemini and Anthropic-Claude.
We based our selection of state-of-the-art open LLMs on the Open LLM Leaderboard (Fourrier et al., 2024) and used the average score over all included benchmarks as our reference value. The selection criteria were that the model is instruction-finetuned, as required by the task construction of the LLM-KG-Bench framework, has less than 80B parameters because of a limited amount of available hardware resources and is a base model, that is, not a fine-tuned version of another model. With the latter requirement, we wanted to stick to mature and popularly used LLMs that are not just optimized to achieve a slightly higher score on one or few benchmarks than a base model.
The models fulfilling all our criteria and were among the TOP-4 models based on the average benchmark scores, disregarding models of the same family with lower scores, were Qwen2-72B-Instruct, Meta-Llama-3.1-70B-Instruct, solar-pro-preview-instruct and Phi-3.5-MoE-instruct. Here, we excluded solar-pro-preview-instruct from our selection since it only supports a context length of up to 4096 Tokens and not all prompts of tasks included in the run fitted within this limit. For the remaining three models, we also included all models of their larger model families that matched our requirements, that is, we also tested all models of the Llama3 (Grattafiori et al., 2024), Qwen2 (Hui et al., 2024; Yang et al., 2024), and Phi3 (Abdin et al., 2024) families fulfilling our requirements.
In addition, we wanted to test open LLMs that are fine-tuned or explicitly optimized on code since they could potentially better understand and produce structured data as required for the tasks included in the LLM-KG-Bench. Here, we consulted the EvalPlus Leaderboard (Liu et al., 2024a) and used the reported models’ Mostly Basic Python Programming (MBPP) Benchmark score as our reference value to assess the code-producing quality of the models. Again, we excluded models that were only finetuned versions of a code-finetuned or -optimized base model, had more than 80B parameters or were not instruction-finetuned. Moreover, we only searched for models that are fine-tuned or explicitly optimized on code. Finally, we included the Top-3 models satisfying the criteria in our runs, namely Qwen2.5-Coder-32B-Instruct (Hui et al., 2024), DeepSeek-Coder-33B-Instruct (Guo et al., 2024) and OpenCoder-8B-Instruct (Huang et al., 2024).
After this selection of 37 open LLMs and a first evaluation round end of 2024, we extended the list by the following 4 high ranking LLMs from this families with later release dates until April 2025: deepseek-R1, deepseek-chat-v3-0324, Llama-4.0-Maveric and Qwen3.0-235b-a22b.
Experimental Results
With the configuration described we generated a dataset containing the detailed conversations and the evaluations for 20 to 50 iterations per task and model. In the following section we show some analysis on tasks, models and the preference on input KG format.
Task Result Examples
For each task, a box plot was generated, containing the individual values for the most important score for each model tested. Due to limited space, we show a selection for three tasks in Figure 5. The rest is available in the dataset repository.

Selection of box plots for task score values of the LLMs evaluated. The arithmetic mean value is indicated with a circle, individual score values for each task iteration are indicated with crosses. (a) SparqlSyntaxFixing (SSF): max_combined score and (b) Sparql2Answer (S2A): combinedF1 score and (c) Text2Sparql (T2S) for Organizational-Numerical dataset: max_combined score.
Our evaluation of SPARQL-related capabilities is organized around the task types SparqlSyntaxFixing (SSF), Sparql2Answer (S2A) and Text2Sparql (T2S). For SSF and T2S we selected the
To get a quick overview on LLM models, the LLM-KG-Bench framework can create capability plots. They aggregate result scores for each model into categories according to a configuration file. For the analysis of SPARQL capabilities we use the following categories:
Figure 6 shows a selection of typical capability plots for LLMs. Plots for all LLMs evaluated can be found in the supplemental material.

Selection of typical capability plots for SPARQL SELECT query-related capabilities of the evaluated LLMs. The scores of the models are aggregated along the following capabilities: Syn-1 = SPARQL Syntax of first answer; Syn-max = SPARQL Syntax of best answer per iteration; Sem-R = SPARQL Semantic Read; Sem-W-1 = SPARQL Semantic Write of first answer; Sem-W-max = SPARQL Semantic Write of best answer per iteration. The black line shows the mean value, the blue area the standard deviation. Scores range from 0 to best value 1. (a) very good: Claude-3.5-Sonnet, and similar, for example, Qwen-2.5-Coder, GPT 4o, Gemini-1.5-Pro, Deepseek-R1, (b) some problems: Qwen-2.5-7B, and similar, for example, GPT-3.5, Phi-3.5 MoE, (c) more problems: Phi-3-Medium, and similar, for example, Phi-3-small, Llama-3.1-8B, Qwen-2.5-3B, (d) some problems with S2A task: DeepSeek-Coder and (e) high gain from dialog: Llama-3-8B, and similar Llama-3.1-8B, (f) Only Syntax good: Qwen-2.5-1.5B, and similar, for example, Qwen-2.0-1.5B and Phi-3-Mini.
About a quarter of the models have plots similar to Figure 6(a) showing an almost perfect result with only slight problems with the writing of semantically correct SPARQL SELECT queries. For these models the framework would benefit from the inclusion of more complex benchmark datasets.
The rest of the models had more problems with answering the tasks resulting in plots like Figures 6(b) and 6(c). Moreover, some very small models from Llama and Qwen family had even worse plots.
Two models, DeepSeek-Coder and OpenCoder revealed strong problems with the Sparql2Answer Task type resulting in low values for the Semantic Read capabilities. This is especially interesting, as their results in the rest of the categories are very good.
Figure 6(e) shows Llama-3-8B benefits from the correction infos in the dialog. The first answer was often improved during the dialog. Other LLMs evaluated here seem to have fewer benefit from the dialog.
Understanding the syntax of SPARQL SELECT queries seems to be much easier for LLMs than the other capabilities. Most models show syntax understanding capability scores that are higher than the rest of the capability scores. Especially small models have a capability plot similar to Figure 6(f), showing a good syntax understanding but big problems with the other capabilities.
Aside from the capability compasses, we also aggregated all scores in Table 6. Although the values behind these scores have a high variance, the scores can give a first impression of the SPARQL capabilities. Since the results are very close together near the top, it is hard to make out a clear winner. For these runs of experiments, Claude 3.5 Haiku has scored the best results, closely followed by other large commercial models. In order to distill a list of highest scoring models, we chose Claude 3.5 Haiku as our anchor point and conducted pairwise t-tests with each of the models below it to find the point at which a significant difference in performance could be observed. In other words, the first test was conducted between Claude 3.5 Haiku and Claude 3.5 Sonnet, the next test on Claude 3.5 Haiku and Qwen-2.5-Coder-32B, and so forth. We chose
Combined Scores of the SPARQL-related Capabilities of the LLMs Tested.
The categories combined into the single score are described in section 4.2.2. Models prefixed with a star (*) show no significant difference in performance compared to Claude 3.5 Haiku.
After running each task both on Turtle (TTL) and JSON-LD serializations of the same knowledge graph, we wanted to find out whether there is a preference for a certain format (i.e., a higher score when using one format over the other). To that end, we conducted several t-tests; both on the task level and the model level. The latter helps us understand if any given model has an overall preference for a certain input format, while the former gives us a better understanding on a per-task basis.
Looking at Table 7, we can see that seven models have an overall preference for TTL, while eight models performed overall better on JSON-LD serializations. In contrast to that, 25 models do not have any kind of preference, leaving us with the conclusion that there is no universally preferred format.
Result of Two-Sided t-Tests Checking for a Preference for Turtle (TTL) vs. JSON-LD Serialization.
Result of Two-Sided t-Tests Checking for a Preference for Turtle (TTL) vs. JSON-LD Serialization.
Preferences are expected if the confidence interval is at least 95%, Bold font indicates 99% or better.
Looking at the Table 7 as a whole, we can see that preferences for one format over the other appear roughly equally distributed. However, there are some clusters like the Llama family of models preferring JSON, or Qwen leaning more toward TTL.
This might have to do with the amount of training data that covers TTL versus that which covers JSON. Unfortunately, as not all training data is publicly available, we cannot investigate this further.
When looking at the global preferences per task, we find that the Text2Answer and Sparql2Answer tasks appear to be easier to solve when operating on a TTL-formatted KG. In contrast to that, counting friends seems to work better for JSON KGs. This could come from the fact that, in order to find the person with the most incoming connections, the model needs to be able to parse the knowledge graph and have some notion of what an array is and how to count. In contrast, extracting facts (or answers in that case) may profit from having the desired answers close to the question subjects , which is a strength of TTL.
Looking at the table, it is important to note that a model having no preference could mean one of these two things:
The model performs equally well on both formats and has no problem solving the task, no matter what. This is the case for Gemini 1.5 Pro, GPTo1 and some others. The model has big problems solving the task. This is, for instance, the case for Qwen2 0.5B.
The former is a desired state, as this relieves the user of the burden of having to choose a serialization that maximizes the quality of the results, while models having preferences in certain areas indicate that they are still growing toward that state. To find out whether a model falls into the former or the latter category, one should cross-reference the table with the corresponding capability compass.
Coming back to the research questions, the LLM-KG-Bench framework helps answering them.
RQ1. We showed here and in previous works (Frey et al., 2023; Meyer et al., 2024) the possibilities for automated evaluation of KGE-related capabilities. The LLM-KG-Bench framework is open for further development to support additional KGE task areas.
RQ2. In the analysis of the experiment result and in previous work (Frey et al., 2023, 2025; Heim et al., 2025; Meyer et al., 2024) we could identify ways to distinguish the KGE-related capabilities of different LLMs. For SPARQL SELECT queries we propose here the scores calculated in Table 6 as guidance.
RQ3. At least for the tasks evaluating the understanding of SPARQL SELECT queries syntax seems to be possible most of the time for most evaluated LLMs as shown in Figure 5(a) and in Meyer et al. (2024). Further work is needed to check this claim for more complex queries and errors.
RQ4. Figure 5(b) shows at least some LLMs seem to have no problems with working according to the semantics of SPARQL SELECT queries.
RQ5. At least for the evaluated tasks, the creation of semantically correct SPARQL SELECT queries seems to be possible most of the time for some LLMs, when looking at Figure 5(c) and the good capability plot type in Figure 6(a). However, this also needs to be checked for other more complex queries. Moreover, it is important to consider that the evaluation is currently only done based on the answer set, which does not necessarily mean that the semantic of the SPARQL SELECT query is correct.
Still There are Some Things to Keep in Mind. Some of the tasks, like Sparql2Answer or RdfFriendCount, can be answered with graph databases much more efficiently and reliable. But the measuring of this RDF-related capabilities is of a more fundamental scientific interest. On the other side, the focus on this basis tasks induce a risk of overestimating the KGE-related capabilities of LLMs, as real world scenarios are often of a more complex nature.
The answer quality of LLMs can vary even on small changes in prompt or task. We tested only with a limited amount of tasks and task entries.
The automated evaluation could miss important aspects of the answer. For example, the SPARQL SELECT queries generated were tested only extensionally on the result set generated, which does not always imply that the query was well formulated to match the expected semantics.
Although we tried to hide the benchmark data, we can not guarantee no LLM is trained with them, as we want to keep the benchmark and its results open and reproducible.
Further Work. is needed to include more datasets into the framework, extend the list of tasks to cover more aspects related to Knowledge Graphs and extend the analytical capabilities of the framework. The framework and the evaluation data generated is publicly available to enable contribution.
The framework would benefit from more datasets and especially more evaluation task classes. We see here on the one hand additional topics like OWL, RML, SHACL, and on the other hand more complex tasks and analyses like nested SPARQL queries or even the interaction with real graph databases.
As the number of LLMs published and the size of datasets generated with the framework grow, new ways to check the results are needed. Maybe one could utilize another level of LLMs to check on the automated evaluation results for details missed and highlight these findings for manual inspection. This way, the evaluation could remain deterministic and reproducible, but we gain another level of checks and maybe even insight.
Supplemental Material
sj-zip-1-swj-10.1177_22104968261461351 - Supplemental material for Evaluating Large Language Models for RDF Knowledge Graph-Related Tasks—The LLM-KG-Bench-Framework 3
Supplemental material, sj-zip-1-swj-10.1177_22104968261461351 for Evaluating Large Language Models for RDF Knowledge Graph-Related Tasks—The LLM-KG-Bench-Framework 3 by Lars-Peter Meyer, Johannes Frey, Felix Brei, Desiree Heim, Sabine Gründer-Fahrer, Sara Todorovikj, Claus Stadler, Markus Schröder, Natanael Arndt and Michael Martin in Semantic Web
Supplemental Material
sj-zip-2-swj-10.1177_22104968261461351 - Supplemental material for Evaluating Large Language Models for RDF Knowledge Graph-Related Tasks—The LLM-KG-Bench-Framework 3
Supplemental material, sj-zip-2-swj-10.1177_22104968261461351 for Evaluating Large Language Models for RDF Knowledge Graph-Related Tasks—The LLM-KG-Bench-Framework 3 by Lars-Peter Meyer, Johannes Frey, Felix Brei, Desiree Heim, Sabine Gründer-Fahrer, Sara Todorovikj, Claus Stadler, Markus Schröder, Natanael Arndt and Michael Martin in Semantic Web
Footnotes
Funding
The authors thank DFKI for running the experiments involving open LLMs on their GPU cluster. This work was partially supported by grants from the German Federal Ministry of Research, Technology and Space (BMFTR) to the projects StahlDigital (13XP5116B), ScaleTrust (16DTM312D), KupferDigital2 (13XP5230L) and PROVIDER (13N17700) as well as from the German Federal Ministry for Economic Affairs and Climate Action (BMWK) to the KISS project (01MK22001A) and CoyPu project (01MK21007A) and from the German Federal Ministry of Transport and Digital Infrastructure (BMDV) to the project ADA (19F2190B).
Declaration of Conflicting Interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Supplemental Material
Supplemental material for this article is available online.
ORCID iDs
Notes
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
