Manuscript Offprint
arXiv:2610.37809What Does an Ontology Catch? Curated, LLM-Generated and Data-Derived Ontologies as Checkers of LLM Agents over Knowledge Graphs
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Michal Orzechowski
ACK Cyfronet AGH
Krakow, Poland
AGH University of Krakow
Krakow, Poland
Sano Centre for Computational
Medicine
Krakow, Poland
Rund Tawfiq
Sano Centre for Computational
Medicine
Krakow, Poland
Tomasz Kosciolek
Sano Centre for Computational
Medicine
Krakow, Poland
AGH University of Krakow
Krakow, Poland
Abstract
LLM agents that answer questions over Web knowledge graphs are increasingly wrapped in checks derived from the graph's ontology, on the assumption that a formal schema makes a reliable judge. Yet a checker can be wrong as well: it can miss errors, and it can flag correct answers and push the agent into "fixing" them. Whether a curated ontology is worth its cost as such a judge, and how it compares with an ontology an LLM writes or a schema mined from the data, is unknown. We make the checker itself the object of study. Across curated, LLM-generated and data-derived ontologies, used as prompt context, as a checker, or both, and across open-weight and proprietary agents on public graphs and a private graph of nearly triples, we account for what ontology-derived checks catch and what they wrongly flag. We show how each source trades caught errors against false alarms, how a curated schema used as published can contradict its own data, which errors structural checks miss, and whether combining sources or giving the agent the checker's specific feedback pays off. On UniProt, the curated ontology flags more correct answers than either an ontology derived from the data or one an LLM derives from a summary of the data with masked identifiers. On real agent answers, its flags are only marginally more precise than random flags.
Keywords
knowledge graphs, ontologies, LLM agents, verification, SPARQL
Large language models (LLMs) have made knowledge graphs more accessible, as they translate natural language questions into SPARQL queries, run them against the endpoints, and report the retrieved results [16, 20, 29]. However, it is difficult to validate their results. A query can be syntactically valid, execute without error, yet answer a different question from the one asked [7, 21]. One way to assess an answer is to test whether its query fits what the graph's ontology states about its entities and relationships. If the ontology contains, in the Web Ontology Language (OWL) [33], a domain axiom stating that whatever has a birth date is a person and a disjointness axiom stating that no city is a person, a query for the birth date of a city contradicts it. These kinds of checks were built for SPARQL queries written by LLMs, where they are reported to increase accuracy [1], and testing a graph's data against its ontology with SPARQL is an established method to assess the quality of Linked Data [18].
Checks may still permit errors. They may accept incorrect answers or flag correct ones, prompting an LLM agent to revise a correct answer into an incorrect one, as has been observed in text-to-SQL refinement [13]. Accuracy alone reveals neither error. Checks based on ontologies are particularly prone to flagging correct answers, because axioms are read as constraints on the data [23] while published ontologies often do not describe all of it: in a crawl of Linked Data, 14.3% of triples used properties that were not defined in any of the crawled vocabularies [11], and a check that requires every property to be declared would reject correct answers that rely on them. Before an ontology can be used to judge an agent's answer, its suitability for that role must itself be assessed.
Existing approaches to ontology evaluation do not address this use. Ontologies are typically evaluated by comparison with a gold standard, by expert assessment, or by their coverage of a corpus or dataset [6]. Constraints derived from ontologies were also compared with constraints mined from the data to validate the data [8], where a constraint violation is interpreted as an error in the data. When an ontology is used to check an agent's answers, however, a violation may instead reflect an error in the ontology, resulting in a correct answer being rejected. We therefore evaluate ontologies in this application directly, measuring both the errors they detect and the correct answers they incorrectly flag.
This gap has implications for both knowledge graph publishers and agent developers. Publishers would benefit from knowing how expert curated ontologies compare with ontologies generated by LLMs [35], or ontologies derived from data [26] when used to assess agent answers. Developers may benefit from understanding whether an ontology is most useful as context for generating an answer, as a check on the answer, or both.
In this paper, we evaluate curated, LLM-generated, and data-derived ontologies as checks on agents' answers. We address three

Figure 1: The setting. An LLM agent answers a question with a SPARQL query; a check derived from an ontology passes the answer or flags it, and a flag triggers one retry. The same ontology can also be the agent's context.
research questions:
RQ1 Which errors do checks from curated, LLM-generated and data-derived ontologies catch, how often do they flag correct answers, and what do they cost to set up and to run?
RQ2 What causes the false alarms, and which errors do the checks miss?
RQ3 How does the ontology contribute at other stages of the process: as context for answer generation, in combination with another check, or as feedback to the agent after a check is triggered?
A fair comparison must address three concerns, and each shapes our design. First, executing a query can itself reveal errors, for example when it returns no results, so we distinguish errors caught by a check from those already exposed by query execution. Second, results on artificially introduced faults may not generalize to real errors [14, 24], so we evaluate each check on both real agent answers and faults introduced into correct queries. Third, LLMs may recall identifiers from public knowledge graphs [10], potentially biasing the ontologies they generate. We therefore also have LLMs build ontologies from a masked summary of the graph, in which identifiers are replaced with opaque names. Every check judges the same answers and faults, and each decision is compared with the pre-defined answer (Figure 1).
This paper makes three contributions:
- A comparison of curated, LLM-generated and data-derived ontologies as checks on LLM agents built on five open-weight and two proprietary models, confirmatory on UniProt and exploratory on other public graphs and a private graph of nearly triples.
- An analysis of why such checks go wrong: where a curated ontology as published disagrees with its own data, and which errors the checks miss.
- A released set of artificial faults introduced into correct queries, with their pre-defined correct answers, and a protocol that measures any check's catches and false alarms against a retry on empty results, without running an agent.
2 Related Work
LLM agents are increasingly used to interact with knowledge graphs. TogoMCP makes approximately sixty RDF databases accessible to LLMs through the Model Context Protocol (MCP) [16]. Other systems focus on generating and executing queries. SPINACH generates SPARQL queries and revises them based on
returned results, empty results, and execution errors [20]. SPARQL-LLM generates queries over federated life science endpoints using endpoint metadata and checks them against schema information before execution [29].
Beyond query generation, several methods explicitly check or constrain agent behavior. The Ontology-based Query Check flags queries that conflict with an ontology and prompts LLMs to revise them, which is reported to increase accuracy on an enterprise question answering benchmark [1]. NaVQA addresses queries that use ontology terms without mappings to the underlying data, which can silently produce empty results, by restricting the agent to ontology terms represented in the data [34]. These methods differ in what they check and how they intervene, but are typically evaluated by overall response accuracy. We instead vary the source of the ontology and evaluate each flag against the correct answer, distinguishing detected errors from false alarms.
Ontology axioms can be used to validate data, by interpreting them as constraints rather than only as a means for inference. Motik et al. showed that OWL axioms that resemble integrity constraints do not act as checks under standard first-order semantics, motivating a separate formalization for integrity constraints [23]. The W3C subsequently standardized SHACL for validating RDF data against structural constraints [17], and ShEx offers a comparable language [25]. Kontokostas et al. translated vocabulary axioms such as domain, range, and disjointness into SPARQL tests over Linked Data, and found that domain and range tests identified the most errors [18]. At the query level, Seifer et al. type-check SPARQL queries against an ontology and reject queries whose results must be empty on any database [28].
However, ontology-based checks depend on the suitability of the ontology itself. Linked Data uses terms without defined vocabularies [11], while combining widely used vocabularies under a closed-world interpretation can expose conflicting definitions [9]. In the biological domain, ontology-based constraints were used to evaluate annotations, which revealed limitations in the ontology itself [30]. We ask the same question of checks on agents' answers at query time, where an unsuitable ontology flags correct answers.
Ontologies and constraints may be generated by LLMs rather than domain experts. LLMs generated shape schemas for Wiki-data and YAGO which were evaluated against reference schemas [35]. Shapes mined from large knowledge graphs were filtered according to how frequently the data supports them [26], and constraints extracted from ontologies, mappings, schemas, and data were combined and used to evaluate a dataset [8]. In each case, the constraints are assessed against a reference or the data, not by how they perform as checks on downstream tasks.
The artificial faults, the code and the pre-registration are available at https://anonymous.4open.science/r/www-2027-replication-package-36D6; Appendix A lists the contents.
Checks are useful only when their feedback is reliable. LLM self-correction is more effective when guided by reliable external feedback than by the model's own judgement, except in tasks particularly suited to self-evaluation [15]. Consequences of unreliable checks have also been studied directly, where ErrorLLM measures how often refining a correct SQL query flagged by a detector changes its result [13]. In software engineering, static analyses used in Google's code review are required to keep effective false positives below 10%, reflecting the risk that false alarms erode developers' trust [27]. Queries that remain valid while expressing a different question than intended have been catalogued for SQL [7], and LLMs detect them in generated SQL with limited accuracy [21].
Evaluating checks requires care in how test cases are constructed. Artificially introduced faults provide controlled test cases, but may not represent the full range of real faults [14], and conclusions drawn from artificial faults do not always generalize to real ones [24]. Evaluation can also be affected by information leakage, where models may recall identifiers from public knowledge graphs even when those identifiers are masked in the input [10]. Building on these lessons from software testing, SQL, and code, we evaluate deterministic, ontology-derived checks for SPARQL agents on both real agent answers and artificial faults.
3 Ontologies as Checks
3.1 Ontology sources
We compare three types of ontologies: A curated ontology is published by the knowledge graph's authors, and we use it exactly as published to reflect what an agent developer would obtain in practice. A data-derived ontology summarizes the data itself, including the number of instances of each class, and, for each property, the classes of the instances that appear as its subjects and objects. Instances are counted under each of their asserted classes and their superclasses. A pattern is considered allowed only if it occurs at least five times in the data. It states domain and range but no disjointness axioms. An LLM-generated ontology is produced by Claude Opus 5.5 from the same summary used to construct the data-derived ontology, supplemented with a fixed sample of instances per class. Thus, the difference between these data-derived and LLM-generated ontologies is what the LLM adds, given the summary and a sample of instances. We also evaluate a baseline with no ontology.
3.2 Ontology uses
Each ontology is used in three ways. As context, the ontology is rendered as text in the agent's prompt. All ontology sources use the same rendering procedure where classes and hierarchy are provided first, followed by domain and range, disjointness, and labels, all within a common token budget. As a check on the agent's answer, each ontology is compiled using the same compiler, so differences between sources do not reflect differences in implementation. Both: the same ontology is supplied as context in the prompt and used as a check on the answer.
3.3 Check types
Checks examine either the query or its bindings, the solution mappings of its graph pattern. Query checks parse the SPARQL query and infer, from its triple patterns, the types required of each variable and constant, which they test against the ontology. The subject of a property must be an instance of the property's declared domain or one of its subclasses, its object must be an instance of the declared range or one of its subclasses, and no variable may be required to belong to two classes declared disjoint. A heuristic check, on in every condition, also flags a variable required to belong to two classes that share no subclass in the ontology, a closed-world counterpart of a missing disjointness axiom. A separate declaration check requires every class and property named by the query to be declared in the ontology. A datatype check flags a literal outside the datatype a property declares as its range. The data-derived ontology adds pattern checks on co-occurrence: they flag a property used with a class the data never combines with it, and a join of two triple patterns that no class supports at least five times.
Binding checks re-evaluate the query's graph pattern with every variable projected, collect the resulting bindings, and test the asserted types of the bound resources against the same axioms. Collection is limited to 10,000 triples per answer.
3.4 Axiom interpretation
We interpret ontology axioms as constraints on the data as it stands, following the closed-world reading of OWL axioms as integrity constraints [23]. A flag therefore indicates that the asserted data violates an axiom as written. Under OWL's open-world semantics [33], the same data might instead entail a class membership that has not been explicitly asserted. We do not resolve this difference between interpretations, and instead quantify it by attributing each false alarm to its cause (RQ2, Section 5).
We distinguish contradictions from mismatches. A contradiction is a violation under both readings, where the data witnesses an explicit logical clash, such as an instance belonging to two disjoint classes, a value violating a declared datatype, or a functional property with two distinct literal values for the same subject. A mismatch is a violation under the closed-world reading only, such as a subject with no asserted type in a property's declared domain, which OWL would instead use to infer that type.
3.5 Check verdicts
A check passes when the available evidence satisfies the constraint, and flags when it detects a violation. It returns unknown when the evidence needed to decide is unavailable, for example because the value is untyped, retrieval reaches its limit, or the query contains a construct outside the supported SPARQL fragment (Appendix B.1). A check is not applicable when there is no relevant axiom to test against the terms used in the query.
An answer is flagged if any check flags it. If none flags the answer but at least one returns unknown, the answer is classified as unknown; otherwise, it is passed. Unknown answers are not flagged and therefore do not trigger a retry. They count as unflagged in every rate, and their share is reported separately.
3.6 Scoring checks
There is a pre-defined correct answer for each question, and each check decision therefore falls into one of four categories. A caught answer is a flagged wrong answer. A missed answer is an unflagged
Curated ontology (excerpt)
ex:birthDate rdfs:domain ex:Person .
ex:Person owl:disjointWith ex:City .
ex:birthPlace rdfs:domain ex:Person .
ex:birthPlace rdfs:range ex:Place .
ex:population is used by the data but not declared.
Data (excerpt)
ex:Dublin rdf:type ex:City .
Caught. "When was Dublin founded?"
SELECT ?d WHERE { ex:Dublin ex:birthDate ?d }
Dublin is a city, and a city cannot have a birth date: flag. Running the query also returns nothing.
False alarm. "What is the population of Dublin?"
SELECT ?p WHERE { ex:Dublin ex:population ?p }
The query is right, but the ontology does not declare ex:population: flag. A data-derived ontology passes it.
Missed. "Who founded Dublin?"
SELECT ?p WHERE { ?p ex:birthPlace ex:Dublin }
The query returns the people born in Dublin. Every type fits the ontology, so every check passes a wrong answer.
Figure 2: Three answers checked against one curated ontology, in an invented vocabulary.
wrong answer. A false alarm (a false positive) is a flagged correct answer. A correctly passed answer is an unflagged correct answer. Figure 2 shows a caught answer, a false alarm and a missed answer. We report the catch rate (recall) as the proportion of wrong answers that are flagged, and the false-alarm rate as the proportion of correct answers that are flagged.
3.7 Retries
A flag triggers one retry. The agent resumes its conversation, and a fixed instruction tells it that its earlier answer has been set aside and asks for a final answer. It receives one of two messages: a specific message, which identifies the failed constraint and the part of the query that violated it without revealing the ontology source, or a generic message, "Please re-check your answer." The two messages are alternative conditions applied from the same state, so the message is the only difference between them. The retry has the same tools and limits as the first attempt, and its answer is final. A retry that fails or abstains counts as wrong.
We classify a wrong answer that becomes correct after retry as fixed, and a correct answer that becomes wrong as corrupted. These outcomes measure both the benefit of a flag and the risk of acting on a false alarm.
4 Study Design
Every confirmatory claim concerns one public graph, UniProt, and was registered with its test and margin before any test answer was examined (Section 4.6). The other graphs, the human-written questions and every analysis not registered in advance are exploratory.
4.1 Graphs
Table 1 lists the five graphs used in the study. We use the Swiss-Prot subset from UniProt [31] r2026_03 for all confirmatory claims. The curated ontology of this graph declares domain, range, and disjointness axioms, which allows all three kinds of checks to be evaluated. We use Rhea [3], which declares a class hierarchy but no domain, range or disjointness axioms in its curated ontology, for class membership checks. We also use a masked copy of Rhea,
Table 1: The graphs: size, what the curated ontology declares, and role.
| Graph | Triples | Curated ontology declares | Role |
| UniProt | 4.0 × 108 | domain, range, disjointness | confirmatory |
| Rhea | 5.5 × 106 | class hierarchy only | exploratory |
| Rhea, masked | 5.5 × 106 | as Rhea | exploratory |
| Corporate Private | 2.7 × 104 | domain, range; no disjointness | exploratory |
| ~109 | not described | rates only |
in which we replace class, property, and instance identifiers and labels with opaque identifiers, to test whether agents and LLM-generated ontologies rely on recognising a familiar vocabulary. We also use a corporate graph from outside the life sciences [22] and a private graph of nearly 10⁹ triples with its own curated ontology. Each graph is served from a triple store that answers queries over its asserted triples without reasoning, and the public graphs from QLever [4]. Results on graphs other than UniProt are exploratory, and we only report rates on the private graph.
4.2 Ontologies
Each graph has the three ontology sources defined in Section 3.1, and a baseline without an ontology. For UniProt, every ontology fits within the common token budget and is given to the agent in full. We draw three LLM-generated ontologies per graph; on the masked copy of Rhea they are drawn from its masked data summary. On UniProt we draw three more masked ontologies from a copy of the data summary in which identifiers are renamed and string values masked; they are used only as checks. C3 uses these masked draws, so that agreement with the curated ontology does not merely reflect recall of familiar identifiers; masking reduces the cues for recalling UniProt's published ontology, but it cannot establish that the model has never seen it (closed-book probes, Appendix D.3). Their domain and range axioms are a subset of the data-derived ontology's, and the LLM adds disjointness, so C3 compares the curated axioms with data-derived domain and range plus LLM-added disjointness. The properties of these draws are described in Appendix B.2.
Each ontology source can be used as context, as a check, or in both roles (Section 3.2). On UniProt, every model answers with no ontology, the curated or the data-derived ontology in its prompt, and Sonnet and Qwen3.8 also with the first LLM-generated one. The checks of every source, including the masked ontologies and the combined check, are applied to the first answers of every prompt condition. Retries are run on the answers given with no ontology: after a curated flag, once with the specific message and once, from the same state, with a generic request to re-check, and after each comparator's flags (Section 4.7).
4.3 Questions and correct answers
Questions are generated from each graph's structure using seven templates, ranging from single lookups to compositional questions involving joins, filters and, aggregation. Each question is paired with the SPARQL query that answers it on the graph. The result of that query is the question's pre-defined correct answer. Agent answers are scored mechanically by exact match using scorer rules fixed in advance. A guard rejects ambiguous questions: for each template, plausible alternative readings, such as including narrower classes or transitive membership, are run against the graph, and a question whose answer changes under one must state its scope or is not generated. Each correct query is re-executed against the graph. An independent LLM agent, given only the question text and not its paired query, produced queries matching the correct answers for all 30 questions in a sample from an earlier version of the set.
Because agents answered simple lookups almost perfectly on development data, the compositional tier was made harder in at most two rounds, each raising every compositional template one step along one axis, aiming at an accuracy of about 50–80% for Sonnet without an ontology on the development questions. For each graph, questions are divided into development (30%) and test (70%) sets within each template, resulting in 210 test questions on UniProt, 70 lookups and 140 compositional. In addition, we use 173 UniProt and 124 Rhea question–query pairs from a published collection [5] as a reference set that models may have seen during training, run for two models (Appendix C.3).
4.4 Agents
Seven models answer the questions: two proprietary models, Claude Sonnet 5.5 and Claude Haiku 5.5, and five open-weight models, Qwen3.8-27B, Qwen3-Coder-30B-A3B, GLM-5.3-Flash, Gemma-4-31B and DeepSeek-V4-Flash. Each agent queries the graph through a SPARQL tool and submits its answer as rows of identifiers and values. Each question is attempted three times per model and condition, as independent runs, subject to turn and time limits held constant across models.
4.5 Artificial faults
Agent errors are sparse and unevenly distributed, so we also introduce artificial faults in correct queries to measure checks independently of agent behaviour. Each fault applies a single operator to the correct query of a UniProt test question or of an additional question generated with the same templates, resulting in 1,260 questions. The operators form three classes: (1) invented identifiers absent from the graph. (2) swaps of a class, property, or constant for an item of a different type, drawn from the data-derived ontology's co-occurrence graph, whose nodes are properties and the classes and datatypes the data uses with them at least five times, and whose edges join a property to such a class or datatype. A swap replaces a class or property with a node of the same kind exactly two or four steps away, so that at two steps two classes share a property or two properties share a class; a constant is replaced by a member of a class at that distance from its own classes. (3) meaning changes that preserve the query form, such as replacing COUNT with COUNT DISTINCT, MIN with MAX, or dropping a grouping key. Swaps of a constant for another constant of the same type are reported as a separate stratum, which accounts for the four rows in Table 4.
Each faulty query is labelled according to whether it changes the answer. Unmodified correct queries and rewrites that preserve the answer are controls used to count false alarms. To evaluate any check without running an agent, the check is applied to each faulty query and each control. A flag on a faulty query counts as a catch only if the fault changes the answer, and a flag on a control counts as a false alarm. Since a query that returns no rows already signals a problem, rates are also reported separately for faults whose queries
still return rows, and compared with retrying only when a query returns no rows. Table 4 reports the composition of the fault set.
4.6 Claims and statistics
The claims, outcomes, tests, and margins were registered and frozen in a timestamped commit before any test question was run. Each claim answers one of the research questions, as labelled below.
RQ1, C2 As checks, compare the curated and data-derived ontologies on (i) false-alarm rate for correct queries and (ii) catch rate for type swap faults. C2 requires both differences in the same direction, each with a five-percentage-point margin.
RQ1, C3 As checks, compare the curated ontology with the mean over the three masked LLM-generated ontologies on false-alarm rate, with a five-percentage-point margin. This is the central comparison.
RQ3, C1 As context, compare curated and data-derived ontologies on agents' first-answer accuracy: C1a tests for a difference, pooled over the seven models, and C1b tests equivalence within accuracy points on Qwen3.8 and Sonnet, the two models fixed for it in advance, because a pooled equivalence could hide opposite effects in different models.
RQ3, C4 Compare the combined curated and data-derived checks with each check alone on net detection gain when wrong answers make up 25% of answers.
RQ3, C5 After a flag, compare the check's specific message with a generic request to re-check on accuracy after one retry.
C1a, C2 and C3 are two-sided tests, and C4 and C5 test for a gain. The margins are the smallest differences of interest; for C1b, and for C3 when read from its interval, they are equivalence bounds.
We control the family-wise error rate at with a weighted Holm procedure [12], with the most weight on C3, fixed in the pre-registration from simulations without any test data and after an independent statistical review. A claim is significant by the weighted-Holm decision on its calibrated p-value, written ; the unadjusted bootstrap p-values are in Appendix C.1. Non-significance establishes neither equivalence nor the absence of a benefit. Each test is a paired cluster bootstrap whose nominal level was calibrated on simulated data before the freeze, with the question as the unit of analysis. From the same simulations, C1b, C4 and C5 were declared in advance as expected to be inconclusive at their margins; we report them as bounds. Every other analysis is exploratory and labelled as such. Inference is conditional on the seven frozen question templates, the frozen artificial faults and the recipe for generating ontologies. Changes made after the freeze preserve comparisons within each model and graph and leave every registered decision unchanged; the Ontology-based Query Check, registered also on the artificial faults, was run on real answers only.
4.7 Baselines
In addition to retrying when a query returns no rows, four comparators run in the same harness: (1) an LLM judge given the question, query, results, and answer, implemented by the agent's own model for agent answers and by Claude Sonnet 5.5 and Haiku 5.5 for artificial faults; (2) SPARQL-LLM query validation [29], as published; (3) the Ontology-based Query Check rules [1], run from its paper's printed rules; and (4) trivial checks that always or never flag. Results are reported in the appendix.
5 Results
We address the three research questions in turn, using the UniProt knowledge graph unless stated otherwise. The real answer analysis includes the first answers to 210 test questions from seven LLM models, with three attempts per question, involving 4,410 answers. Of these, 3,383 contained a query that could be checked. We calculate exploratory rates per answer, pooled across models. For artificial faults, we pool rates across 9,753 artificial faults that change the answer, and 3,630 correct queries. Confirmatory comparisons weigh questions equally with 95% confidence intervals from a paired cluster bootstrap over questions.
RQ1: Curated checks raise more false alarms than data-derived and masked LLM-generated checks
RQ1 examines which errors each type of ontology catches when used as a check, how often it flags correct answers, and at what cost. The curated ontology raises more false alarms than both the data-derived ontology and the LLM-generated ontologies built from a summary with masked identifiers. On real agent answers, its flags are only marginally more precise than random flags. Table 2 reports catch and false alarm rates for each ontology on real agent answers and artificial faults. The first row shows a baseline that retries any query that returns no rows and does not require an ontology. Ontology-based checks only add value where they catch errors beyond this baseline. All checks read about the same number of triples per answer, so their costs mainly differ due to retries after a flag. The curated ontology check triggers more retries than the data-derived ontology check, incurring greater token usage and runtime (Appendix B.3).
Exploratory results on real answers reveal trade offs between catching errors and flagging correct answers. The curated ontology catches more wrong answers than the data-derived and masked LLM-generated ontologies, but most of its flags concern correct answers, and its flags are right hardly more often than those of a random flag at the same rate (Table 3). The data-derived and masked ontologies flag fewer correct answers and are more likely to be right when they flag an answer, but each catches fewer than one in ten wrong answers. The three LLM-generated ontologies written from the original summary vary from one generation to the next: two catch few wrong answers, whereas the third catches more than the curated ontology but also flags far more correct answers (Table 2).
All ontologies catch a smaller proportion of errors in real answers than in artificial faults. Most artificial faults produce empty query results, whereas almost all wrong agent answers return plausible results. Consequently, the empty result baseline catches few real wrong answers. Retrying flagged answers with the curated check's specific feedback corrects more than a quarter of the flagged wrong answers but corrupts about one in a hundred flagged correct answers (Table 2).
On the artificial faults, no single ontology catches as many faults as the retry on empty results, which raises no false alarm (Table 2). The two confirmatory comparisons for RQ1 are decided on the artificial faults, per question (Table 3). As checks, the data-derived ontology raises fewer false alarms on the control queries than the curated ontology and catches more type swaps, both by more than the registered 5-point margin (C2). The curated ontology also raises more false alarms than the mean of the masked LLM-generated ontologies, by more than the margin (C3).
Two features of the design favour the data-derived ontology in C2. It is built from the graph on which the checks run, so it cannot flag a pattern that occurs at least five times in the data. The type swaps were also generated from its co-occurrence graph, so nearly all of them form patterns absent from the data, which executing the query would also reveal (Table 2). The difference in type swap catch rate arises from swaps four steps apart on the co-occurrence graph; for swaps two steps apart it is not established (exploratory; Table 3). A lower false-alarm rate does not by itself make a better check: the masked ontologies also catch fewer of the faults whose queries still return rows than either the curated or the data-derived ontology.
Sonnet and Qwen3.8 are far less accurate on the human-written questions than on the generated ones, so these leave checks much more to catch. On the UniProt questions Sonnet's curated check beats a random flag; on the Rhea questions it does no better than one (Appendix C.3). Among the comparators (Appendix C.2), an LLM judge, the agent's own model reading the question, the query, the results and the answer, catches more wrong answers than either the curated or the data-derived ontology at a false-alarm rate similar to the curated check's, and its flags are right more often than a random flag's (Table 3). Acting on its flags was not beneficial: retries informed by the judge's reason corrupted more flagged correct answers than they fixed wrong ones, unlike the curated check's. Results per model and on the other graphs are in Appendices C.1 and C.4.
Table 4 shows the distribution of artificial faults by class. The classes differ in how often the faulty query still returns rows, and so in how much a check can add to running the query. Invented identifiers and type swaps mostly do not return rows, so a retry on empty results already catches most of them; the ontologies differ mainly on type swaps. Constants swapped for others of the same type and changes of meaning mostly still return rows, and every ontology catches far fewer of them than a random flag at the curated check's rate would.
RQ2: Domain, range and declaration checks raise the curated ontology's false alarms, and ontology checks miss changes of meaning
RQ2 asks what causes the false alarms and which errors the checks miss. The curated ontology's false alarms come from its domain and range axioms and its requirement that every term be declared, and each curated ontology we studied disagrees with its own data; the curated, data-derived and masked ontologies catch none of the changes of meaning among the artificial faults. Evaluating the curated ontology one axiom type at a time (Table 2, the curated rows) shows that class membership and subsumption alone produce almost no false alarms; adding rdfs: domain and rdfs: range axioms raises them, and requiring every class and property in the query to be declared raises them the most. On real answers, domain and range checks flag correct and incorrect answers at similar rates,
Table 2: Each ontology as a check on UniProt, in %: real answers of seven models, and artificial faults. Bold, per column: the highest catch rate, precision and share fixed; the lowest false-alarm rate, share unknown and share corrupted.
| Check from | Real answers | Artificial faults | fixed / corrupted | ||||||
|---|---|---|---|---|---|---|---|---|---|
| catch | false alarm | unknown | catch, all | catch, rows returned | false alarm | precision at 25% wrong | |||
| Retry on empty result (reference) | 2.5 | 0.1 | — | 79.2 | — | 0.0 | 100 | 15.4 / 0.0 | |
| Curated ontology, specific message | 18.9 | 16.8 | 1.8 | 60.1 | 54.3 | 15.0 | 57.1 | 28.3 / 1.0 | |
| same flags, generic message | 18.9 | 16.8 | 1.8 | 60.1 | 54.3 | 15.0 | 57.1 | 20.2 / 0.2 | |
| class checks only | 3.1 | 0.6 | — | 17.0 | — | 1.1 | 83.4 | — | |
| class, domain and range | 8.0 | 8.8 | — | 26.8 | — | 6.1 | 59.5 | — | |
| Data-derived ontology | 8.2 | 3.5 | 1.6 | 75.6 | 62.1 | 9.7 | 72.3 | 7.0 / 1.0 | |
| LLM-generated, draw 1 | 6.7 | 3.2 | 2.0 | 54.5 | 46.7 | 1.2 | 93.7 | 11.4 / 24.2 | |
| LLM-generated, draw 2 | 8.6 | 6.6 | 1.9 | 57.1 | 47.5 | 6.3 | 75.3 | 13.3 / 12.7 | |
| LLM-generated, draw 3 | 43.4 | 24.3 | 1.5 | 69.6 | 53.7 | 29.4 | 44.1 | 30.8 / 6.0 | |
| LLM-generated, masked (three) | 5.0 | 1.8 | 2.0 | 55.2–56.4 | 47.2–48.5 | 1.2–1.3 | 93.4–93.7 | not run | |
| Curated and data-derived combined | 19.5 | 17.8 | 1.4 | 80.0 | 67.3 | 23.6 | 53.1 | 29.4 / 1.0 | |
Table 3: Registered claims and exploratory comparisons on UniProt, in points, with 95% intervals; for the claims, the margin and the adjusted (). Bold: established.
| Comparison | Estimate (95% CI) | Margin | |
|---|---|---|---|
| RQ1: as checks, on artificial faults | |||
| C2: false alarms on controls, curated – data-derived | +8.6 (6.0, 11.2) | 5 | 0.013 |
| type-swap catches, curated – data-derived | -22.3 (-23.5, -21.0) | 5 | |
| C3: false alarms on controls, curated – masked LLM-generated | 15.7 (13.7, 17.9) | 5 | 0.025 |
| RQ3: accuracy, and net detection for C4 | |||
| C1a: context, curated – data-derived | -2.1 (-3.4, -0.9) | — | 0.003 |
| C1b: the same, Qwen3.8 | -1.1 (-4.2, 1.9) | ±3 | 1.000 |
| Sonnet | -0.8 (-2.7, 0.9) | ±3 | |
| C4: combined – curated check | -0.5 (-1.5, 0.4) | 1 | 1.000 |
| combined – data-derived check | -10.6 (-12.2, -9.2) | 1 | |
| C5: specific – generic message, per flagged answer | 0.2 (-3.2, 3.1) | 10 | 1.000 |
| Exploratory, no test | |||
| C2's type swaps two steps apart | -1.3 (-2.6, 0.1) | ||
| C5 weighted by each model's flags | +0.7 (-1.2, 3.0) | ||
| Real answers: precision – random flag, curated the same, LLM judge | +1.6 (-2.3, 6.3)+15.8 (12.5, 19.3) | ||
| Curated check: curated – data-derived in the prompt | -14.3 (-19.9, -9.3) | ||
| Data-derived check: data-derived – curated in the prompt | -4.8 (-8.7, -1.0) |
Table 4: Catch rates by class of artificial fault on UniProt, in %. LLM-m: masked LLM-generated, mean of three; rand.: a random flag at the curated check's rate. Bold: a random flag catches more than every ontology.
| Class | n | no rows | cur. | data | LLM-m | rand. |
|---|---|---|---|---|---|---|
| Invented identifier | 2,986 | 80.5 | 77.4 | 77.5 | 74.5 | 48.1 |
| Type swap | 6,413 | 80.0 | 55.3 | 78.4 | 49.9 | 48.0 |
| Same-type constant | 1,554 | 46.8 | 3.1 | 5.8 | 0.0 | 47.9 |
| Change of meaning | 245 | 41.2 | 0.0 | 0.0 | 0.0 | 44.9 |
| Correct items (false alarm) | 3,630 | 0.0 | 15.0 | 9.7 | 1.2–1.3 | — |
so their flags are right no more often than random ones, while the flags from class membership and term declarations do better than random (Appendix D.1). In the curated and masked ontologies, disjointness axioms do not contribute to flags: neither the seven pairs of the curated ontology nor the 73 to 759 pairs added by the LLM in the masked ontologies flag any answer not already flagged by another axiom type. C3's difference therefore rests on domain and range axioms and term declarations. The data-derived ontology's checks are analysed in the same way in Appendix D.1.
Table 5 shows where each curated ontology disagrees with its own data: with logical contradictions in UniProt, with omissions of properties the data uses extensively and the graph's documentation describes in Rhea, and mostly through naming on the private graph, whose curated checks flag most correct answers (Appendix C.4).
In a blind audit of a sample of the curated check's false alarms, two annotators judged the cause of each (Table 6, top; Appendix D.2). Most came from a term the ontology does not declare and most of
Table 5: Where a curated ontology, as published, disagrees with its own data.
| Graph | Disagreement |
|---|---|
| UniProt | Contradictions: up: maximum is declared xsd :float, but all 139 of its values are integers; 5 data properties declared functional have two distinct values for some subjects (82 entries for one property, 3,859 citations for four others). No instance of two disjoint classes. |
| Rhea | Omissions: 4 properties the data uses (between 15,032 and 90,295 times each) are not declared. |
| Private | 94.2% of triples use an identifier other than the ontology's own, mostly renamings of declared terms; 19.9% use a term with no counterpart in it; 1.46% have a subject typed outside the property's declared domain (a mismatch). |
Table 6: Why checks go wrong, in a blind audit of a sample: the curated check's false alarms by judged cause (top) and missed wrong answers by kind of error (bottom), counted where both annotators gave the same code, out of 32 and 64 items; Cohen's 0.77 and 0.54.
| False alarm | undeclared term | closed world | data clash | schema too narrow | checker defect | other | ||
|---|---|---|---|---|---|---|---|---|
| Curated | 17 | 11 | 0 | 0 | 0 | 0 | ||
| Missed | aggregation | wrong constant | filter or scope | path | shape | gold or question | scorer | other |
| Answers | 0 | 2 | 13 | 21 | 3 | 1 | 1 | 0 |
the rest from a closed-world reading, and every audited false alarm was indeed a correct answer.
On the artificial faults, the curated, data-derived and masked ontologies catch none of the changes of meaning in Table 4 and few of the constants swapped for others of the same type, whereas a random flag at the curated check's rate would catch many of both. One LLM-generated ontology built from the original summary catches 25.7% of the changes of meaning and 17.2% of the same-type swaps, but it also flags the most correct items (Table 2). An LLM judge, given the question, catches all 41 changes of meaning it judged (Appendix C.2). On real answers, two annotators blind to the model, the condition and the checks' verdicts, coded a sample of the wrong answers that no check flagged (Table 6, bottom). Most missed wrong answers took a wrong path through the graph or a wrong filter or scope, and almost none could be flagged by a structural check even over a correct schema.
RQ3: Data-derived context does better; combining and specific messages show no gain
RQ3 asks whether the ontology improves performance beyond its use as a single check, and we examine three uses: providing the ontology as context to the agent, combining checks derived from two ontology sources, and including the check's specific message when the agent retries a flagged answer. As context, the data-derived ontology gives higher accuracy than the curated one; combining the two checks shows no net gain in detection, and passing the check's specific message to the agent no gain in accuracy, with intervals that bound any gain at a few points. Table 3 gives each estimate with its interval and registered margin.
As context, the data-derived ontology yields higher accuracy than the curated ontology pooled over the seven models (C1a). Equivalence within 3 points is not established for Qwen3.8 and Sonnet, the two models fixed for it in advance (C1b).
A net detection gain from combining the curated and data-derived checks is not established (C4). The combination catches more faults than either check alone but also raises more false alarms than either (Table 2), so it does no better than the curated check alone and worse than the data-derived check alone.
The check's specific message does not detectably improve on a generic request to re-check (C5), whether the seven models are weighted equally or by their flags. The specific message fixed more of the flagged wrong answers than the generic request, but also corrupted more of the flagged correct ones (Table 2). C1b, C4 and C5 were declared in advance as expected to be inconclusive, and we interpret them as bounds on the size of the effects, not as evidence that the effects are absent.
A setting an agent developer is likely to deploy uses the data-derived ontology as context and the curated ontology as the check. On this configuration, the retry resulted in a small gain in accuracy, or none, for each of the seven models (exploratory; Appendix C.4). On the other graphs where retries were run the change was smaller or negative (Appendix C.4).
Using the same ontology as context and as the check is associated with fewer catches (exploratory). The curated check catches fewer of the wrong answers produced with the curated ontology in the prompt than of those produced with the data-derived ontology in the prompt; the data-derived check shows the same pattern with the roles reversed, more weakly (Table 3).
6 Discussion
Implications for knowledge graph publishers. Published, curated ontologies are not necessarily reliable as checks. On the published UniProt knowledge graph, ontologies derived from the data, either summarized directly or written by an LLM from masked identifiers at a cost of under one US dollar each (Appendix B.3), raised fewer false alarms than the curated ontology. These curated ontologies often disagree with the published data and knowledge graphs (Table 5), and these disagreements have direct consequences. Because checks require every class and property used in a query to be declared, each property missing from the ontology produces a false alarm on every correct answer that uses it. An ontology is a reliable check only if it declares every term its data uses and its axioms are satisfied by that data. The curated ontologies used in this study
do not meet this standard, and a summary derived from the data itself is sufficient to reveal where they fall short. Publishers could therefore release summaries alongside the ontology, or directly use the summary to validate the ontology before each release.
Implications for agent developers. For developers of agents, a check earns its place only on errors that running the query does not already reveal, so any check should be compared with a retry on empty results before it is deployed. False alarms deserve the same scrutiny as catches: static analyses at Google are required to keep effective false positives below 10% to retain developers' trust [27], and a check that sends an agent to revise correct answers reduces trust in the same way. Measured comparably, as the proportion of a check's flags that fall on correct answers, every ontology check and the LLM judge exceed this threshold by a wide margin on the agents' answers to the generated questions, most of which are correct. On questions written by humans, where most answers are wrong, most flags fall on wrong answers. This proportion therefore depends on how often the agent errs, which is why we compare each check with a random check that flags the same proportion of answers. In the configuration a developer is most likely to deploy, with the data-derived ontology as context and the curated ontology as the check, retries improved accuracy slightly on UniProt, and yielded smaller gains or losses on the other graphs on which they were run (Section 5). An LLM judge detected more errors than either the curated or the data-derived ontology, but acting on its flags corrupted more correct answers than it fixed, and it requires a model call for every answer it checks, whereas an ontology-derived check requires none.
Limitations. The confirmatory claims apply for UniProt's frozen questions, artificial faults and ontologies. The other graphs show how far they extend. The LLM-generated ontologies were produced by a single model. Ontologies written by two open-weight models flag substantially more correct queries on average and vary widely between draws (Appendix B.2). On Rhea, whose curated ontology declares no domain, range or disjointness axioms, the curated check flags far more correct answers than on UniProt, whereas the data-derived ontology flags few (Appendix C.4). We do not report results on Rhea's artificial faults, which were provisional and partly inspected during development. The difference between ontologies used as context that we observed on UniProt was not replicated on Rhea. Finally, the private graph is not publicly available, so its results cannot be independently reproduced, and no conclusion rests on it alone.
7 Conclusion and Future Work
An ontology used to check an LLM agent's answers is itself a judge that can be wrong, and we measured how: on the same answers and the same artificial faults, for a curated ontology, an LLM-generated one and one derived from the data, with every comparison fixed before any test answer was seen. The curated ontology raised more false alarms than the data-derived one and the LLM-generated ones written from masked names, and on real answers its flags were right hardly more often than random ones. Beyond checking, the data-derived ontology served the agents better as context, and neither combining the two checks nor passing the check's specific message to the agent showed a gain. Our artificial faults let anyone measure a new check's catches and false alarms without running an agent.
Our measurements rely on knowing the correct answer to every question, and real use does not. We will apply these checks to agents that help biologists analyse a large knowledge graph of genomes, proteins and the computational predictions made about them, where no correct answer is known in advance and a flag is the only automatic sign that an answer may be wrong. The rates measured here will decide which checks such an agent runs, beside a new check that every value traces back to its source.
Acknowledgments
This work is co-financed by the project of the Minister of Science and Higher Education (MEiN/2023/DIR/3796) and by the subvention assigned to AGH University of Krakow. We acknowledge ACK Cyfronet AGH (PLGINT/2026/020157, Gaia/AIF/101314359, LAIF/AIF/101234208) for providing computational resources. T.K. and R.T. are supported by the National Science Centre, Poland grant 2023/05/Y/NZ2/00080.
Large language models are the subject of this study: they serve as the agents and the LLM judge, and they write the LLM-generated ontologies (Sections 3 and 4). They were also used as tools for experiment orchestration and design, data analysis, and copy-editing of the manuscript. All content was reviewed and validated by the authors.
References
[1] D. Allemang and J. Sequeda. 2024. Increasing the Accuracy of LLM Question-Answering Systems with Ontologies. In The Semantic Web – IWSC (Lecture Notes in Computer Science, Vol. 15233). Springer. doi:10.1007/978-3-031-77847-6_18
[2] M. Arenas and J. Pérez. 2011. Querying Semantic Web Data with SPARQL. In Proceedings of the 30th ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems (PODS '11). ACM, 305–316. doi:10.1145/1989284.1989312
[3] P. Bansal, A. Morgat, K. B. Axelelsen, V. Muthukrishnan, E. Coudert, L. Aimo, N. Hyka-Nouspikel, E. Gasteiger, A. Kerhornou, T. Batista Neto, M. Pozzato, M.-C. Blatter, A. Ignatchenko, N. Redaschi, and A. Bridge. 2022. Rhea, the reaction knowledgebase in 2022. Nucleic Acids Research 50, D1 (2022), D693–D700. doi:10.1093/nar/gkab1016
[4] H. Bast and B. Buchhold. 2017. QLever: A Query Engine for Efficient SPARQL+Text Search. In Proceedings of the 2017 ACM on Conference on Information and Knowledge Management (CIKM '17). ACM. doi:10.1145/3132847.3132921
[5] J. Bolleman, V. Emonet, A. Altenhoff, A. Bairoch, M.-C. Blatter, A. Bridge, S. Duvaud, E. Gasteiger, D. Kuznetsov, S. Moretti, P.-A. Michel, A. Morgat, M. Pagni, N. Redaschi, M. Zahn-Zabal, T. Mendes de Farias, and A. C. Sima. 2025. A large collection of bioinformatics question-query pairs over federated knowledge graphs: methodology and applications. GigaScience 14, Article giaf045 (2025). doi:10.1093/gigascience/giaf045
[6] J. Brank, M. Grobelnik, and D. Mladenic. 2005. A Survey of Ontology Evaluation Techniques. In Proceedings of the Conference on Data Mining and Data Warehouses (SiKDD 2005). https://aile3.ijs.si/dunja/SiKDD2005/Papers/BrankEvaluationSiKDD2005.pdf
[7] S. Brass and C. Goldberg. 2006. Semantic errors in SQL queries: A quite complete list. Journal of Systems and Software 79 (2006). doi:10.1016/j.jss.2005.06.028
[8] X. Duan, D. Chaves-Fraga, O. Derom, and A. Dimou. 2024. SCOOP All the Constraints' Flavours for Your Knowledge Graph. In The Semantic Web – ESWC 2024 (Lecture Notes in Computer Science, Vol. 14665). Springer, 217–234. doi:10.1007/978-3-031-60635-9_13
[9] K. C. Feeney, G. Mendel Gleason, and R. Brennan. 2018. Linked data schemata: Fixing unsound foundations. Semantic Web 9 (2018). doi:10.3233/SW-170271
[10] A. Gashkov, A. Perevalov, M. Eltsova, and A. Both. 2025. SPARQL Query Generation with LLMs: Measuring the Impact of Training Data Memorization and Knowledge Injection. In Web Engineering – ICWE 2025 (Lecture Notes in Computer Science, Vol. 15749). Springer, 177–192. doi:10.1007/978-3-031-97207-2_14
[11] A. Hogan, A. Harth, A. Passant, S. Decker, and A. Polleres. 2010. Weaving the Pedantic Web. In Proceedings of the WWW2010 Workshop on Linked Data on the Web (LDOW 2010) (CEUR Workshop Proceedings, Vol. 628). C. Bizer, T. Heath,
T. Berners-Lee, and M. Hausenblas (Eds.). CEUR-WS.org. https://ceur-ws.org/Vol-628/ldow2010_paper04.pdf
[12] Sture Holm. 1979. A Simple Sequentially Rejective Multiple Test Procedure. Scandinavian Journal of Statistics (1979). https://www.jstor.org/stable/4615733
[13] Z. Hong, H. Chen, Z. Yuan, Q. Zhang, L. Zhuang, Q. Liao, F. Huang, Y. Song, and X. Huang. 2026. ErrorLLM: Modeling SQL Errors for Text-to-SQL Refinement. In Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining V.2 (KDD '26). ACM, 1710–1721. doi:10.1145/3770855.3818164
[14] R. Just, D. Jalali, L. Inozemtseva, M. D. Ernst, R. Holmes, and G. Fraser. 2014. Are Mutants a Valid Substitute for Real Faults in Software Testing?. In Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering (SIGSOFT/FSE'14). ACM, 654–665. doi:10.1145/2635868.2635929
[15] R. Kamoi, Y. Zhang, N. Zhang, J. Han, and R. Zhang. 2024. When Can LLMs Actually Correct Their Own Mistakes? A Critical Survey of Self-Correction of LLMs. Transactions of the Association for Computational Linguistics 12 (2024), 1417–1440. doi:10.1162/tacl_a_00713
[16] A. R. Kinjo, Y. Yamamoto, S. Bustamante-Larriet, J.-E. Labra-Gayo, and T. Fujisawa. 2026. TogoMCP: natural language querying of life-science knowledge graphs via schema-guided LLMs and the Model Context Protocol. Database 2026, Article baag042 (2026). doi:10.1093/database/baag042
[17] H. Knulbauch and D. Kontokostas. 2017. Shapes Constraint Language (SHACL). W3C Recommendation, 20 July 2017. https://www.w3.org/TR/shacl/
[18] D. Kontokostas, P. Westphal, S. Auer, S. Hellmann, J. Lehmann, R. Cornelissen, and A. Zaveri. 2014. Test-driven Evaluation of Linked Data Quality. In Proceedings of the 23rd International Conference on World Wide Web (WWW '14). ACM, 747–758. doi:10.1145/2566486.2568002
[19] J. Lehmann, R. Isele, M. Jakob, A. Jentzsch, D. Kontokostas, P. N. Mendes, S. Hellmann, M. Morsey, P. van Kleef, S. Auer, and C. Bizer. 2015. DBpedia – A large-scale, multilingual knowledge base extracted from Wikipedia. Semantic Web 6, 2 (2015), 167–195. doi:10.3233/SW-140134
[20] S. Liu, S.J. Semnani, H. Triedman, J. Xu, I. D. Zhao, and M.S. Lam. 2024. SPINACH: SPARQL-Based Information Navigation for Challenging Real-World Questions. In Findings of the Association for Computational Linguistics: EMNLP 2024. Association for Computational Linguistics. doi:10.18653/v1/2024.findings-emnlp.938
[21] X. Liu, S. Shen, B. Li, N. Tang, and Y. Luo. 2025. NL2SQL-BUGs: A Benchmark for Detecting Semantic Errors in NL2SQL Translation. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V.2 (KDD '25). ACM, 5662–5673. doi:10.1145/3711896.3737427
[22] E. Marx, S. Tramp, P. do Carmo, and M. Gólo. 2026. Second International TEXT2SPARQL Challenge (TEXT2SPARQL26). Challenge website. Retrieved October 22, 2026 from https://text2sparqlaksw.org/2026/
[23] B. Motik, I. Horrocks, and U. Sattler. 2009. Bridging the gap between OWL and relational databases. Journal of Web Semantics 7, 2 (2009), 74–89. doi:10.1016/j.websem.2009.02.001
[24] S. Pearson, J. Campos, R. Just, R. Abreu, M. D. Ernst, D. Pang, and B. Keller. 2017. Evaluating and Improving Fault Localization. In 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE). IEEE, 609–620. doi:10.1109/ICSE.2017.62
[25] E. Prud hommeaux, J. E. Labra Gayo, and H. Solbrig. 2014. Shape Expressions: An RDF validation and transformation language. In Proceedings of the 10th International Conference on Semantic Systems (SEM '14). ACM, 32–40. doi:10.1145/2660517.2660523
[26] K. Rabbani, M. Lissandini, and K. Hose. 2023. Extraction of Validating Shapes from Very Large Knowledge Graphs. Proceedings of the VLDB Endowment 16, 5 (2023), 1023–1032. doi:10.14778/3579075.3579078
[27] C. Sadowski, E. Aftandilian, A. Eagle, L. Miller-Cushon, and C. Jaspan. 2018. Lessons from Building Static Analysis Tools at Google. Commun. ACM 61, 4 (2018), 58–66. doi:10.1145/3188720
[28] P. Seifer, M. Leinberger, R. Lammel, and S. Staab. 2019. Semantic Query Integration With Reason. The Art, Science, and Engineering of Programming 3, 3, Article 13 (2019). doi:10.22152/programming-journal.org/2019/3/13
[29] P. Smeros, V. Emonet, R. Wang, A.-C. Sima, and T. Mendes de Farias. 2026. SPARQL-LLM: Real-Time SPARQL Query Generation from Natural Language Questions. ACM Transactions on the Web 20, 4 (2026), 1–21. doi:10.1145/3847195
[30] R. Tawfiq, M. Kulmanov, and R. Hoehndorf. 2026. Evaluating completeness, coherence, and consistency of genome-scale function annotations. Briefings in Bioinformatics 27, 3, Article bbg336 (2026). doi:10.1093/bib/bbg336
[31] The UniProt Consortium. 2025. UniProt: the Universal Protein Knowledgebase in 2025. Nucleic Acids Research 53, D1 (2025), D609–D617. doi:10.1093/nar/gkae1010
[32] D. Vrandečić and M. Krötzsch. 2014. Wikidata: a free collaborative knowledgebase. Commun. ACM 57, 10 (2014), 78–85. doi:10.1145/2629489
[33] W3C OWL Working Group. 2012. OWL 2 Web Ontology Language Document Overview (Second Edition). W3C Recommendation, 11 December 2012. https://www.w3.org/TR/owl2-overview/
[34] G. Xiao, H. Xue, L. Ren, Y. Geng, G. Qi, S. Zhang, D. Guo, M. Di Panfilo, D. Lanti, and L. Ding. 2026. NaVQA: Mitigating Silent Failures in Question Answering over Virtual Knowledge Graph. In Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence (IJCAI-26). International Joint Conferences on Artificial Intelligence Organization, 4088–4096. doi:10.24963/ijcai.2026/455 [35] B. Zhang, Y. He, L. Pintscher, A. Merodio-Peñuela, and E. Simperl. 2025. Schema Generation for Large Knowledge Graphs Using Large Language Models. In Findings of the Association for Computational Linguistics: EMNLP 2025. Association for Computational Linguistics. doi:10.18653/v1/2025.findings-emnlp.671
A The replication package
The replication package is available at https://anonymous.4open.science/r/www-2027-replication-package-36D6. It holds the code, under the MIT licence; the frozen inputs and configurations; each model's final settings; the commands that run the study; and the analysis that reproduces every number reported here, with the data under CC BY 4.0. The private graph contributes rates only: its data, its alignment mapping, its generated ontologies and the checks' messages on it are not released.
B The method in detail
This part describes how the study was carried out, beyond Sections 3 and 4. It lists the checks, describes the LLM-generated ontologies, and gives the cost of checking.
B.1 The checks in detail
Table 7 lists every check, what it reads, and when it cannot decide. The checks are compiled from the ontology into SPARQL queries over the bindings of a query, and into tests on the parsed query. The supported fragment includes basic graph patterns, OPTIONAL, negation, aggregates, and fixed-length paths; constructs outside it, including UNION and subqueries, give an unknown verdict rather than a pass or a flag. The numbers-traceable check needs no ontology and enters no comparison between ontologies.
Table 7: The checks: what each reads, and when it reports unknown.
| Check | Reads | Unknown when |
|---|---|---|
| Term exists | the query | — |
| Class membership | query; bindings | a value has no type |
| Domain and range | query; bindings | a value has no type |
| Disjointness | query; bindings | a value has no type |
| Datatype range | bindings | — |
| Numbers traceable | answer and results | — |
B.2 The LLM-generated ontologies
The three ontologies an LLM wrote from the masked UniProt summary keep 87–90% of the data-derived ontology's domain and range pairs and add none of their own, so their property sets almost coincide with it (Jaccard similarity 0.93), and they add 73, 759 and 77 disjointness pairs, for which the data-derived ontology has no layer. Their domain and range overlap little with the curated ontology's (Jaccard similarity 0.21–0.22).
The model that writes the ontologies matters. Claude Opus 5.5, DeepSeek-V4-Flash and Qwen3.8-27B each wrote three ontologies by the same recipe; on UniProt's artificial faults and averaged over each model's three ontologies, Opus's ontologies catch 60.4% of the faults that change the answer and flag 10.3% of the untouched correct queries, DeepSeek's catch 84.1% and flag 59.5%, and Qwen's catch 81.9% and flag 61.0%. Whether a model's ontology misses its own agent's errors was also registered, as an interaction I between two models predicted to be negative; the result is inconclusive: of the two pairs whose agents both give at least 20 wrong answers,
Table 8: What checking costs on UniProt, per kind of ontology, pooled over the seven models (median, with the 90th percentile in parentheses).
| Check from | Setup (US$) | Per answer checked triples read | Per answer flagged | |
|---|---|---|---|---|
| tokens | time (s) | |||
| Curated | — | 25 (277) | 65,976 (435,066) | 46.0 (420.0) |
| same flags, generic message | — | — | 60,927 (308,426) | 49.2 (309.7) |
| Data-derived | — | 25 (269) | 28,076 (202,405) | 17.2 (112.3) |
| LLM-generated, draft 1 | 0.43 | 24 (267) | 42,027 (181,818) | 22.4 (170.5) |
| LLM-generated, draft 2 | 0.47 | 25 (269) | 58,719 (455,836) | 29.5 (456.1) |
| LLM-generated, draft 3 | 0.39 | 24 (267) | 65,030 (369,424) | 25.7 (342.7) |
| LLM-generated, masked (three) | 0.48–0.98 | 25 (269) | — | — |
| Combined | — | 50 (552) | 63,819 (429,171) | 28.7 (337.5) |
the one on the masked copy of Rhea has ( to ), and the one on UniProt, DeepSeek and Qwen3.8, has ( to ).
B.3 The cost of checking
Table 8 reports what checking costs on UniProt, per kind of ontology. Setup is incurred once per graph. The curated ontology is used as published, and the cost of authoring it is borne by its publisher; each ontology Claude Opus 5.5 wrote for UniProt cost under one US dollar at batch prices; the time to build the data-derived ontology and the time a check takes were not recorded. Aligning the private graph's curated ontology with the data's identifiers took an expert three hours (Appendix C.4). What differs is the retry after a flag: one after a curated flag uses more tokens and time than one after a data-derived flag, and the curated check's specific message costs about as much as a generic request to re-check.
C Beyond the pooled comparison
This part asks whether the comparison behind RQ1 holds beyond the pooled UniProt results of Table 2. It repeats the comparison per model and under the registered sensitivities, against the comparators, on human-written questions, and on the other graphs.
C.1 Per model and under the registered sensitivities
Table 9 gives each model's accuracy with each kind of ontology in the prompt, the change in accuracy the curated check makes through its retry, and the effect of the check's specific message per flagged answer. Table 10 gives each model's catch and false-alarm rates on its answers given with no ontology: for each of the six models with enough correct answers (all but Qwen3-Coder), the curated check flags more correct answers than the data-derived and masked LLM-generated ontologies and catches more wrong ones, so the pooled pattern of Table 2 is not one model's. Sonnet and Haiku are wrong on fewer than 30 answers and Qwen3-Coder gives 44 answers, so their rates rest on few answers. The per-model rate of invented identifiers, registered for this appendix, was not computed.
Re-running or excluding the attempts disturbed by time-outs (4.8% of all attempts) leaves every registered decision unchanged and moves no estimate by more than 0.3 points; the data-derived ontology gives identical rates on real answers at frequency thresholds of 2 and 20 instead of 5; and no attempt was missing or refused. Under the earlier version of the scorer's rules (the frozen rules only add correct verdicts), C1a is points ( to ), and excluding
Table 9: Per model, on UniProt: accuracy with each ontology in the prompt, in %, and the curated check's net change after its retry and the specific message's effect per flagged answer (C5), in points.
| Model | Accuracy, ontology in the prompt | Curated check | ||||
|---|---|---|---|---|---|---|
| none | curated | data-derived | LLM-generated | net change message effect | ||
| Claude Sonnet 5.5 | 95.6 | 95.2 | 96.0 | 97.5 | 0.3 | 0.9 |
| Claude Haiku 5.5 | 95.7 | 93.8 | 93.0 | — | 0.2 | 1.0 |
| Qwen3.8-27B | 80.8 | 79.7 | 80.8 | 81.9 | 0.8 | 0.0 |
| Qwen3-Coder-30B-A3B | 1.6 | 5.9 | 9.0 | — | -0.2 | -7.1 |
| GLM-5.3-Flash | 82.4 | 86.5 | 87.1 | — | 0.6 | -1.8 |
| Gemma-4-31B | 15.7 | 44.4 | 52.7 | — | 1.0 | 6.2 |
| DeepSeek-V4-Flash | 82.2 | 84.8 | 86.2 | — | 1.0 | 2.0 |
Table 10: Each model's checks on UniProt, on its answers with no ontology in the prompt: catch / false alarm, in %. The three masked LLM-generated ontologies give identical rates.
| Model | Curated | Data-derived | LLM-generated, masked |
|---|---|---|---|
| Claude Sonnet 5.5 | 7.1 / 17.4 | 0.0 / 1.7 | 0.0 / 1.2 |
| Claude Haiku 5.5 | 14.8 / 15.9 | 0.0 / 5.0 | 0.0 / 2.2 |
| Qwen3.8-27B | 13.2 / 16.7 | 0.8 / 3.5 | 0.0 / 2.0 |
| Qwen3-Coder-30B-A3B | 32.4 / 30.0 | 35.3 / 10.0 | 14.7 / 0.0 |
| GLM-5.3-Flash | 14.3 / 18.1 | 1.9 / 5.6 | 1.9 / 2.7 |
| Gemma-4-31B | 30.2 / 19.2 | 24.0 / 6.1 | 16.7 / 5.1 |
| DeepSeek-V4-Flash | 19.6 / 15.1 | 4.5 / 1.4 | 2.7 / 0.4 |
the two questions whose curated prompt contains a correct answer value leaves it at -2.0 (-3.3 to -0.8). The unadjusted bootstrap p-values are 0.002 (C1a), 0.113 (C1b), <0.001 (C2), <0.001 (C3), 1.000 (C4) and 0.457 (C5), and a cluster-robust (CR2) Wald test agrees. Three registered source sensitivities and a registered selective check were not run.
C.2 Comparators
Table 11 places the ontology-derived checks beside the comparators of Section 4.7. The LLM judge reads the question, the query, the results and the answer; it is played by the agent's own model on real answers and by Claude Sonnet 5.5 and Haiku 5.5 on the 2,238 artificial faults whose question has a text. On real answers it catches more wrong answers than the curated or the data-derived ontology, at about the data-derived ontology's precision; on artificial faults it catches nearly every fault, including every change of meaning, and flags 30–38% of the faulty queries whose answer is nonetheless correct. SPARQL-LLM's validator does better than a random flag at its rate. The Ontology-based Query Check's eight rules together flag most answers, wrong and correct alike. Acted on, the judge's flags corrupted more correct answers than they fixed wrong ones, and the other checks' retries changed few answers. Combining the curated and data-derived checks adds 3 catches to the curated check's at 28 more false alarms, and 59 to the data-derived check's at 407 more.
C.3 Human-written questions
SIB's published human-written questions were also run with no ontology in the prompt, for Sonnet and Qwen3.8 on UniProt and Rhea (Table 12); they are analysed apart from the generated questions. Of SIB's 173 primary UniProt questions, 170 are analysed, since three ask for a graph, not an answer; of its 124 Rhea examples, 101, after excluding 18 with a SERVICE clause, by a rule fixed before the gold run, and 5 with an empty gold answer. The agents are far less accurate than on the generated questions, and most of their
Table 11: Comparators on UniProt, in %, on real answers and on artificial faults with a question text. Vs rand.: points by which precision beats a random flag at the same rate; fix / corr.: answers fixed and corrupted after one retry; the judge on faults: Sonnet / Haiku.
| Check | Real answers | Artificial faults | ||||||
|---|---|---|---|---|---|---|---|---|
| catch | false al. | prec. | vs rand. | fix / corr. | catch | false al. | prec. | |
| Retry on empty | 2.5 | 0.1 | 81.3 | +65.8 | 2 / 0 | 80.4 | 0.0 | 100 |
| Curated | 18.9 | 16.8 | 17.1 | +1.6 | 28 / 5 | 59.7 | 13.2 | 60.1 |
| Data-derived | 8.2 | 3.5 | 29.9 | +14.4 | 3 / 1 | 75.5 | 9.3 | 73.0 |
| Combined | 19.5 | 17.8 | 16.7 | +1.3 | 30 / 5 | — | — | — |
| LLM judge | 40.3 | 16.2 | 31.3 | +15.8 | 40 / 83 | 98.7 / 98.0 | 11.4 / 11.6 | 74.2 / 73.8 |
| SPARQL-LLM | 5.5 | 6.5 | 13.5 | -2.0 | 2 / 1 | — | — | — |
| Query Check, 8 rules | 87.8 | 90.2 | 15.1 | -0.4 | — | — | — | — |
| Query Check, 1–6 | 34.8 | 22.1 | 22.3 | +6.9 | — | — | — | — |
| Always flag | 100 | 100 | 15.5 | — | — | 100 | 100 | 25.0 |
| Never flag | 0.0 | 0.0 | — | — | — | 0.0 | 0.0 | — |
Table 12: Human-written questions (SIB) on UniProt and Rhea, no ontology in the prompt: accuracy and each check's catch / false alarm, in %. Vs rand.: points by which precision beats a random flag; LLM-generated: range over three.
| Sonnet, UniProt | Sonnet, Rhea | Qwen3.8, Rhea | Qwen3.8, UniProt | |
|---|---|---|---|---|
| Questions | 170 | 101 | 101 | 170 |
| Accuracy | 11.8 | 11.9 | 9.2 | 9.0 |
| Curatedvs rand. | 34.3 / 11.7+8.7 | 41.8 / 41.70.0 | 35.3 / 46.4-3.2 | 35.3 / 4.3+10.7 |
| Data-derived | 0.8 / 0.0 | 2.8 / 0.0 | 1.0 / 0.0 | 5.6 / 0.0 |
| LLM-generated | 2.4–18.4 / 5.0–28.3 | 3.3–6.6 / 8.3 | 4.8–8.7 / 7.1 | 0.9–18.0 / 6.5–19.6 |
| LLM judgevs rand. | 53.2 / 8.3+11.5 | 29.6 / 0.0+14.5 | — | — |
submitted answers are wrong. On the UniProt questions the LLM judge, the curated check and the data-derived ontology keep their order by catch rate, and Sonnet's curated check beats a random flag at its rate (by 8.7 points, 1.9 to 15.5); on the Rhea questions it does no better than one. The false-alarm rates rest on few correct answers, so they are not compared with those on the generated questions.
C.4 The other graphs
Table 14 repeats the central comparison on the four exploratory graphs, for the two confirmatory models, on real answers. Rhea's curated ontology declares no domain, range or disjointness axioms, so only class and declaration checks apply to it, and as context every ontology on Rhea is truncated to the prompt budget. Some of Rhea's provisional artificial faults were exposed, so no artificial-fault result is reported for Rhea.
On Rhea the pattern of Table 2 repeats, at a higher cost for the curated check: over the six models with enough correct answers (all but Qwen3-Coder), it flags 23.2–63.0% of them, against 15.1–19.2% on UniProt and more than any other ontology, while the data-derived ontology and the first two LLM-generated ones flag few. The context difference seen on UniProt does not carry over: of the seven models, the data-derived ontology in the prompt gives the higher accuracy only for Gemma (83.0% against 40.6%) and Qwen3-Coder (16.7% against 9.4%), the two weakest; for GLM the two are nearly equal (87.9% and 87.8%).
On the masked copy of Rhea, the three LLM-generated ontologies, written from masked names, stay within a few points of one another and of the data-derived ontology, flagging few correct answers and catching few wrong ones for every model, while the curated check's rates vary widely across models. On the corporate
Table 13: The checks layer by layer on UniProt, caught / false alarms in %: type swaps and untouched correct queries (artificial faults, per question), and real answers. C: class; DR: domain and range; +DJ: plus disjointness (J: the data-derived co-occurrence patterns); LLM-generated: mean of three.
| Ontology | Artificial faults (caught / false alarms) | Real answers (caught / false alarms) | ||||||
|---|---|---|---|---|---|---|---|---|
| C | C+DR | +DJ (J) | full | C | C+DR | +DJ (J) | full | |
| Curated | 26.5 / 0.0 | 41.3 / 7.1 | 41.3 / 7.1 | 56.3 / 15.7 | 3.1 / 0.6 | 8.0 / 8.8 | 8.0 / 8.8 | 18.9 / 16.8 |
| Data-derived | 46.8 / 0.0 | 73.7 / 0.0 | 78.5 / 7.1 | 78.5 / 7.1 | 1.0 / 0.2 | 1.0 / 0.3 | 4.8 / 2.1 | 8.2 / 3.5 |
| LLM-generated, masked | 31.9 / 0.0 | 50.4 / 0.0 | 50.4 / 0.0 | 50.4 / 0.0 | 1.0 / 0.2 | 1.0 / 0.3 | 1.0 / 0.3 | 5.0 / 1.8 |
| LLM-generated, ordinary | 30.4 / 0.0 | 46.8 / 0.0 | 46.8 / 0.1 | 55.3 / 10.3 | — | — | — | — |
Table 14: The central comparison on the exploratory graphs, real answers of Sonnet and Qwen3.8: accuracy, and each check's catch / false alarm, in %. LLM-generated: one range on the masked copy; identical on the corporate and private graphs. †Very few wrong answers.
| Graph | accuracy | Curated | Data-derived | LLM-generated | |
|---|---|---|---|---|---|
| drafts 1–2 | draft 3 | ||||
| Rhea, Sonnet | 96.0 | 8.0 / 63.0 | 0.0 / 2.1 | 0.0 / 3.0–3.3 | 36.0 / 9.8 |
| Rhea, Qwen3.8 | 92.1 | 20.4 / 39.1 | 0.0 / 3.3 | 0.0 / 4.5–4.7 | 16.3 / 11.4 |
| Masked Rhea, Sonnet | 68.3 | 58.8 / 57.0 | 0.0 / 0.0 | 0.5–4.0 / 0.0–3.7 | |
| Masked Rhea, Qwen3.8 | 30.0 | 25.9 / 20.6 | 1.9 / 2.6 | 0.9–2.8 / 2.6–3.7 | |
| Corporate, Sonnet | 99.4 | 50.0† / 24.8 | 0.0† / 0.5 | 0.0† / 0.0 | |
| Corporate, Qwen3.8 | 94.3 | 22.2 / 25.9 | 2.8 / 1.3 | 2.8 / 1.3 | |
| Private, Sonnet | 100.0 | — / 71.1 | — / 1.6 | — / 1.6 | |
| Private, Qwen3.8 | 98.1 | 50.0† / 70.1 | 0.0† / 0.5 | 0.0† / 0.5 | |
graph, whose curated ontology declares domain and range axioms but no disjointness, no model is less accurate with either ontology in the prompt, and the curated check flags 20.5–25.9% of the correct answers of the six models with enough of them (all but Qwen3-Coder), while the data-derived and LLM-generated ontologies flag almost none. The setting a developer is likely to deploy, a data-derived context with a curated check, gains a little on UniProt but less, nothing or a loss on the other graphs: pooled over the seven models on UniProt, one retry raises accuracy by 1.0 point; one retry changes Sonnet's accuracy by at most 0.5 point on each of the four graphs where it was run, and Qwen3.8's by +1.6 points (0.3 to 3.0) on UniProt and by −3.8 (−5.9 to −1.9) on the corporate graph.
On the private graph, with no ontology in the prompt, Sonnet, Haiku, Qwen3.8, GLM and DeepSeek answer at least 92.9% of the questions correctly, Gemma 59.2%, and Qwen3-Coder rarely submits an answer. The curated check flags 56.3–72.8% of the correct answers of the six models, while the data-derived ontology and the three LLM-generated ones, which give identical results, flag almost none. Only GLM and Gemma give enough wrong answers to compare catch rates: the curated check catches 73.0% and 74.0% of them, and the other ontologies none of GLM's and 13.0% of Gemma's. An expert also aligned the curated ontology's terms with the data's identifiers, in three hours for 115 terms. On the answers given with no ontology in the prompt, alignment raised the share of correct answers the checks flag for each of the six models, from 56.3–72.8% to 69.7–85.1%; the results with an ontology in the prompt are in the replication package. Leaving out the 20 questions that the triple store's known query faults can affect keeps every model's accuracy within its interval.
D Where false alarms come from
This part collects the evidence behind RQ2 and behind the masked ontologies of C3. It switches the checks on layer by layer, describes the audit of false alarms and misses, and measures how far agents
Table 15: Closed-book probes, exact match in %: an answer (a) and a query (b) written from memory; and the agents' accuracy with no ontology, masked Rhea minus Rhea, in points with 95% intervals.
| Model | a: UniProt | b: query from memory | agent accuracymasked – Rhea | |||
|---|---|---|---|---|---|---|
| UniProt | Rhea | masked Rhea | corporate | |||
| Sonnet | 4.9 | 53.7 | 46.0 | 1.1 | 46.3 | -27.8 (-32.6, -22.9) |
| Haiku | 1.4 | 39.0 | 24.8 | 1.3 | 0.0 | -35.2 (-40.6, -29.8) |
| Qwen3.8 | 0.8 | 0.0 | 4.9 | 0.0 | 26.7 | -62.1 (-68.2, -55.8) |
| Qwen3-Coder | 0.0 | 1.0 | 0.0 | 1.1 | 0.0 | -2.1 (-3.4, -0.9) |
| GLM | 1.7 | 26.7 | 21.7 | 0.0 | 37.5 | -52.9 (-58.0, -47.6) |
| Gemma | 0.0 | 0.6 | 0.0 | 1.0 | 0.0 | -26.5 (-32.3, -21.0) |
| DeepSeek | 0.2 | 1.9 | 1.4 | 0.6 | 0.0 | -50.5 (-56.2, -44.8) |
and LLMs rely on recognising a graph's vocabulary.
D.1 The checks layer by layer
Table 13 switches each ontology's checks on one layer at a time: class checks with the heuristic of Section 3.3, then domain and range, then disjointness (for the data-derived ontology, its checks on co-occurrence patterns instead), then the declaration check, which completes the full set. On real answers, the precision of the curated ontology's domain and range flags differs from that of a random flag at the same rate by -1.2 points (95% CI -5.5 to 5.1), and that of its class membership and term-declaration flags by +8.0 points (1.8 to 15.3). In the data-derived ontology, the class, domain and range axioms catch more type swaps than the same axioms in the masked ontologies; without the heuristic they catch 37.2% of type swaps, against 73.4% with it, pooled over items, and most of the data-derived ontology's false alarms arise from its checks on co-occurrence patterns.
D.2 The audit
Two annotators coded a seeded, stratified sample of 145 answers from the test questions, one answer per question within each stratum: 64 wrong answers that no check flagged and 32 correct answers that the curated check flagged, spread evenly over the four public graphs (the missed answers also over Claude and the open-weight models), 16 wrong answers given with the curated ontology in the prompt that the curated check passed, ten of each of the first two kinds on the private graph, and 13 items allocated by a fixed rule. Annotators saw the question, the correct and the agent's query and answer, and the check's message or the ontology where relevant, but not the model or the condition. They coded each missed answer's kind of error, each false alarm's cause, and whether a wrong answer of the third kind follows from a wrong or misleading statement in the ontology. Cohen's κ over the 112 main items is 0.54 (kind of error), 0.79 (structural detectability), 0.77 (cause of a false alarm) and 0.33 (whether a wrong answer follows from the ontology); Table 6 counts the codes both annotators gave. Few wrong answers of the third kind followed from a statement in the ontology. On the private graph, every audited false alarm came from an undeclared term, and no missed answer could be flagged by a structural check.
D.3 Recognising a graph's vocabulary
Each model was also asked, with no tools, to answer each test question from memory (probe a) or to write its query from memory, run on the graph (probe b, public graphs only; GLM on 40 questions per graph); the registered expectations were near zero for answers
everywhere, and for queries clearly above zero on UniProt and Rhea and near zero on masked graphs (Table 15). Answers from memory are exact for at most 9.8% of the questions on any public graph and 1.1% on the private graph. Queries from memory are exact for many questions on UniProt and Rhea for Sonnet, Haiku and GLM, and for almost none on the masked copy of Rhea, for every model. The other four models score low, but many of their replies contained no usable query, so their low scores do not by themselves show an absence of recall. The agents' own accuracy also falls on the masked copy, for every model and prompt. Probes on the human-written questions were registered but not run.