TL;DR
This paper tackles the challenge of executing complex SPARQL property path queries on online knowledge graphs, which are often interrupted by server quotas. They introduce a novel "Partial Transitive Closure" (PTC) operator integrated with a preemptable SPARQL server, allowing clients to retrieve complete results efficiently without excessive data transfer or query decomposition.
What Problem Does This Paper Address?
SPARQL 1.1 introduced property paths, a powerful feature for navigating RDF knowledge graphs. However, querying large, public knowledge graphs like Wikidata or DBPedia online is problematic. These services often impose quotas on query execution time or resource usage, leading to queries being interrupted and returning incomplete or no results. Existing solutions involve "smart clients" that decompose these complex queries into smaller, guaranteed-to-terminate subqueries. While this ensures completeness, it can generate a massive number of subqueries, leading to significant data transfer and poor performance due to network latency. This paper aims to bridge this gap by enabling complete property path query evaluation online with improved efficiency.
Methods
The core innovation is the Partial Transitive Closure (PTC) operator, built upon a depth-limited search (DLS) algorithm. Unlike standard transitive closure algorithms that can be resource-intensive, PTC computes the closure up to a predefined depth limit (k). This allows the server to process a significant portion of the query preemptively.
The system works in tandem:
- Preemptable SPARQL Server with PTC: The server is extended with a preemptable PTC operator. This operator can be suspended and resumed efficiently, crucial for handling server quotas. When the depth limit
kis reached, the server identifies "frontier nodes" – nodes at the boundary of the explored closure. - Smart Client with PTC: The client receives these frontier nodes along with control tuples. It then generates new, targeted queries to explore these frontier nodes, effectively continuing the transitive closure computation. This process is iterative, with the client requesting further exploration until the entire closure is complete. This approach avoids breaking down complex property paths into numerous triple patterns on the client side, reducing the number of HTTP calls and data transfer.
Datasets
The paper uses the gMark framework to generate synthetic graph instances and query workloads. Specifically, they use the "Shop" use-case configuration, resulting in a graph of 7,533,145 triples and 30 queries. These queries are designed to include 1 to 4 transitive closure expressions, with numerical occurrences replaced by Kleene plus operators.
Key Insights and Ideas
- Preemption is Key for Online Queries: The paper highlights that for online querying of large KGs, the ability to preempt and resume queries is essential to work within server constraints.
- Depth-Limited Transitive Closure as a Sweet Spot: Instead of full transitive closure (which can be too slow or resource-intensive for online queries) or no closure (requiring client-side computation), a partial transitive closure up to a server-defined depth offers a practical balance.
- Client-Server Collaboration for Completeness: The PTC approach elegantly combines server-side processing (up to depth
k) with client-side intelligence to complete the query. This avoids the performance pitfalls of purely client-side decomposition. - Reduced HTTP Calls and Data Transfer: By processing more of the query on the server and avoiding client-side joins for property paths, the number of HTTP calls and the volume of intermediate data transferred are significantly reduced.
Key Results
Experimental results using the gMark dataset demonstrate that the proposed SaGe-PTC approach significantly outperforms existing smart client solutions (like SaGe-Multi) and is competitive with, and often superior to, standard SPARQL endpoints (Virtuoso, Jena-Fuseki) in terms of:
- Execution Time: SaGe-PTC generally achieves faster query execution.
- Data Transfer: The PTC approach drastically reduces the amount of data transferred to the client.
- Number of HTTP Calls: The number of HTTP requests made by the client is substantially lower.
The paper also shows that increasing the maxDepth parameter generally improves performance by allowing larger transitive closures to be computed on the server, leading to fewer client-server interactions. Similarly, a larger time quantum for preemption also improves performance.
Limitations and Future Work
- Nested Stars: The current PTC operator is designed for property paths without nested stars (e.g.,
(a b*)*). The authors acknowledge that handling such expressions is a subject for future work. - Join Ordering and Pruning: The paper suggests further optimizations, such as improved join ordering in the presence of path patterns and pruning calls for "reachability"-oriented path patterns.
- Partial Aggregates: Exploring the compatibility of partial transitive closure with partial aggregates, especially when aggregations are computed on the server, is identified as an interesting future direction.
- Query Shapes: Better evaluation of resuming queries based on their shapes is also mentioned as a potential area for improvement.
Summary updated