arXiv:2609.01780cs.IRSep 2026

Manuscript Offprint

arXiv:2609.01780

KGVoyager: Knowledge Graph Agnostic Question Answering via Agentic Navigation

Essam Wisam, Chengkai Li

Abstract

Knowledge Graph Question Answering (KGQA) over RDF graphs remains challenging in domain-specific settings, where formal ontologies and curated text-SPARQL pairs are often unavailable. We present KGVoyager, a KG-agnostic agentic architecture that generates SPARQL queries from natural language questions by dynamically discovering graph structure and semantics, requiring only a query endpoint of the underlying graph. Using a think-act-observe loop with search, exploration, and execution tools, KGVoyager maps terms to graph IRIs, uncovers structure, and refines queries through execution feedback—all without pre-existing ontologies or examples. Unlike the prior state of the art, KGVoyager requires only a lightweight class index which renders it applicable for far more real-world endpoints. Across four benchmarks, KGVoyager improves F1 by ~8 points while cutting cost and runtime by ~22% each.

1 Introduction

RDF knowledge graphs (KGs) provide a robust framework for representing complex, interconnected data across diverse domains [15, 33]. However, utilizing them effectively requires understanding graph-specific data models and technical query languages such as SPARQL [17, 12, 20, 1]. Natural language interfaces that map user questions to SPARQL queries lower this barrier and have driven significant research interest in knowledge graph question answering (KGQA) [8, 13, 21, 40, 30, 18].

LLM-based KGQA systems have achieved state-of-the-art benchmark performance [8] over earlier machine-learning [5], deep-learning [39, 30, 3], template, and rule-based approaches [12]. These solutions fundamentally leverage ontologies and example text-query pairs for grounding and guiding query generation. Ontologies encode classes, attributes, relationships, and constraints

that help models produce semantically valid queries [11, 22, 25]. In addition to ontologies, example text-SPARQL pairs improve performance of such natural language interfaces by serving as in-context examples or facilitating fine-tuning [37, 40, 32].

This dual reliance on ontologies and text-query pairs parallels SQL-based DBQA, where systems depend on the database schema and text-SQL pairs to ground query construction [41].

However, unlike SQL-based systems, which benefit from inherent database schemas, SPARQL interfaces for knowledge graphs often lack such resources, due to the flexible, schema-optional design of the RDF framework. In particular, we identify three distinct challenges, as follows. (1) Ontology deficiency: Many knowledge graphs lack a formal ontological structure. They may define entities, classes, and properties without specifying pivotal semantic relationships such as class hierarchies, property characteristics, and other semantic attributes. (2) Ontology opacity: Even when knowledge graphs do incorporate ontological structure, they predominantly lack documentation that exposes or explains such structure and related constraints [14]. (3) Example scarcity: Creating example text-SPARQL pairs for new domain-specific knowledge graphs is expensive and challenging. It requires human experts who possess deep domain knowledge, advanced SPARQL proficiency, and awareness of the underlying ontology. This is corroborated by the pronounced scarcity of query examples for domain-specific knowledge graphs [28, 26].

These challenges hinder the development of effective KGQA systems for domain-specific settings. Most recent natural language to SPARQL systems [21, 40, 30, 18, 3, 9, 32, 37] avoid these constraints by focusing on open-domain knowledge graphs such as Wikidata and DBpedia, which benefit from inherent knowledge in LLMs [13, 37], curated text-SPARQL datasets [10, 34, 35], and community ontology tooling [21, 40]. These assets are rarely available for arbitrary domain-specific knowledge graphs.

As ontologies may be unavailable or opaque and example pairs scarce, we treat a SPARQL query endpoint as the sole universally assumable resource. Our system thereby aims to enable natural language interfaces for arbitrary knowledge graphs given only query endpoint access. To achieve this goal, our system must simulate the exploratory learning process a human expert would undertake when first encountering an unfamiliar knowledge graph. To this end, we present KGVoyager, an agentic architecture that uses a suite of KG-agnostic tools to dynamically discover latent graph structure, semantics, and instance data. KGVoyager then uses this discovered information to generate SPARQL queries that answer user questions. Specifically, we design a set of searching, sampling, and navigation tools that enable systematic exploration of arbitrary knowledge graphs. Using these tools within a think-act-observe loop [38], the agent identifies relevant classes and properties, maps local graph structure, and validates query drafts through execution feedback until it derives an accurate SPARQL query.

To the best of our knowledge, the only prior work sharing a similar endpoint-only, KG-agnostic objective is GRASP [36], which also targets zero-shot SPARQL generation over arbitrary knowledge graphs but relies on a complete entity index that builds for only ~21% of Jena-served and 0% of QLever-served okn.us [26] endpoints. KGVoyager's lightweight class-level index builds on up to ~97% of the same endpoints; other fundamental differences are detailed in Section 2. Across four domain-specific benchmarks, KGVoyager improves F1 by ~8 points on average while reducing cost and runtime by ~22% each.

In summary, our key contributions are:

  • KGVoyager, an agentic architecture that leverages a suite of KG-agnostic tools to generate SPARQL queries that answer user questions without relying on pre-existing ontologies or curated example pairs.

  • Evaluation of KGVoyager against the current state-of-the-art across diverse domain-specific knowledge graphs, demonstrating superior performance in correctness, efficiency, and applicability.

  • Open-source release of KGVoyager, enabling practitioners to deploy the system against any SPARQL endpoint with minimal configuration.

The codebase, datasets, experiment results, and demo recordings are available at https://anonymous.4open.science/r/nl2sparql2-C171.