Passage: Ensuring Completeness and Responsiveness of Public SPARQL Endpoints with SPARQL Continuation Queries

Thi Hoang Thi Pham, Gabriela Montoya, Brice Nédelec, hala skaf-molli, Pascal Molli

TL;DR

PASSAGE introduces a "save game" mechanic for SPARQL queries, allowing public database endpoints to enforce strict time limits without leaving users with incomplete data. By returning a standard SPARQL "continuation query" alongside partial results, PASSAGE ensures full result completeness while maintaining the high responsiveness required for public web services.

What Problem Does This Paper Address?

Public Knowledge Graphs like Wikidata and DBpedia are goldmines of information, but querying them is notoriously difficult. Because these endpoints are shared resources, providers enforce "fair use" policies—usually a hard timeout (e.g., 60 seconds). If your query is complex, the server simply cuts you off, returning partial, often useless results.

This creates a "Completeness vs. Responsiveness" dilemma. You can have a responsive server that cuts people off, or a "complete" server that lets one massive query block everyone else (the "convoy effect"). Existing solutions like Linked Data Fragments (LDF) move the work to the client but are painfully slow, while "Web Preemption" techniques like SaGe require non-standard protocols that most existing tools can't speak.

Methods

The authors propose PASSAGE, a system that formalizes the concept of SPARQL Continuation Queries.

The core idea is "Logical Preemption." When a query hits its time quota, the server doesn't just stop; it calculates exactly where it left off in the logical execution plan. It then generates a new, standard SPARQL query that represents the "remaining work." * Deterministic Offsets: PASSAGE relies on the fact that most SPARQL engines (like Blazegraph) use B-Tree indexes, which allow for deterministic, ordered scanning. This lets PASSAGE use OFFSET and LIMIT logic at the triple-pattern level to track progress. * Query Rewriting: For complex operations like Joins and Optionals, PASSAGE rewrites the continuation query into a UNION. One branch of the union handles the remaining items for the current mapping, while the other branch handles the remaining mappings from the previous step. * Smallest-Branch-First: To prevent the continuation queries from growing exponentially in size (the "query expansion" problem), PASSAGE always prioritizes evaluating the smallest branch of a union first.

Datasets

The researchers evaluated PASSAGE using WDBench, a real-world benchmark based on Wikidata containing approximately 1.25 billion triples. They specifically selected:

  • 49 Basic Graph Patterns (BGPs) and 38 Optional queries (OPTs) that were known to time out or take significant time on standard Blazegraph setups.

Key Insights and Ideas

  • Statelessness is King: Unlike previous preemption efforts that required the server to save the "physical state" of a query (which is hard to scale), PASSAGE is stateless. The "state" is encoded entirely within the continuation query itself.
  • Standard Compliance: Because the continuation is just another SPARQL query, any standard-compliant client can use it. The authors integrated PASSAGE with the Comunica smart client, allowing it to handle even the SPARQL operators that PASSAGE doesn't yet support natively.
  • The Cost of Parsing: The authors found that the main overhead in their approach isn't the data processing, but the need to re-parse and re-optimize the continuation query every time it's sent back to the server.

Key Results

  • Performance: On a single-core setup, PASSAGE-60s (with a 60-second timeout) was the fastest engine for both BGPs and OPTs, performing slightly better than a standard Blazegraph and significantly outperforming Apache Jena.
  • Completeness: PASSAGE successfully completed queries that caused Jena to time out even after 10 minutes.
  • Overhead: The cost of interrupting a query and generating a continuation was roughly 900ms. While slightly higher than the physical preemption used in SaGe (~681ms), the trade-off for standard SPARQL compliance is minimal.
  • Query Size: Despite the theoretical risk of query expansion, the "smallest-branch-first" strategy kept continuation queries very small, averaging around 0.8 KB.

Limitations and Future Work

  • Parallelism: Currently, PASSAGE does not support intra-query parallelism (using multiple CPU cores for a single query), which is why a standard Blazegraph setup still wins on multi-core hardware.
  • Operator Support: The current implementation focuses on "Core SPARQL" (Joins, Unions, Optionals, Filters). It does not yet natively support complex aggregations like COUNT, GROUP BY, or DISTINCT.
  • Client-Side Logic: Some complex operators are still offloaded to the Comunica client. The authors plan to gradually move more of this logic to the server to further reduce data transfer.

Summary updated

BibTeX
@inproceedings{pham2025passage,
  author = {Thi Hoang Thi PHAM and Gabriela Montoya and Brice Nédelec and hala skaf-molli and Pascal Molli},
  title = {{Passage: Ensuring Completeness and Responsiveness of Public SPARQL Endpoints with SPARQL Continuation Queries}},
  booktitle = {The Web Conference},
  year = {2025},
  doi = {10.1145/3696410.3714757},
}
Figure