Towards a Scalable Semantic-Based Distributed Approach for SPARQL Query Evaluation

Gezim Sejdiu, Damien Graux, Imran Khan, Ioanna Lytra, Hajira Jabeen, Jens LehmannSEMANTiCS 2019

Introduction

As the Semantic Web continues to expand, the volume of data formatted as Resource Description Framework (RDF) triples—Subject-Predicate-Object—has grown exponentially. Querying these massive datasets using SPARQL is computationally intensive. Traditional distributed systems, such as SHARD (built on Hadoop MapReduce), often struggle with scalability because they treat every triple as an independent unit. This approach necessitates frequent data "shuffling" across networks to resolve even simple queries, creating significant performance bottlenecks.

To address these challenges, researchers have developed a new distributed approach within the SANSA (Semantic Analytics Stack) framework that leverages semantic-based partitioning and Apache Spark’s in-memory processing to achieve linear scalability and superior performance.

Methodology: The SANSA Engine

The proposed system, SANSA.Semantic, introduces a query engine designed to minimize network overhead and maximize data locality. The architecture follows a multi-layered approach to process RDF data efficiently.

The SANSA Engine architecture, illustrating the flow from RDF data ingestion and partitioning to the semantic query layer and final results.

Core Innovations

  • Semantic-Based Partitioning: Instead of storing triples in a flat table, the system partitions data by Subject. All predicates and objects associated with a specific entity are grouped into a single record: (Subject, [(Predicate1, Object1), (Predicate2, Object2), ...]). This allows many query patterns to be satisfied locally on a single node.
  • SPARQL-to-Scala Translation: Utilizing the Jena ARQ library, the engine parses SPARQL queries and translates them into Spark RDD (Resilient Distributed Dataset) operations. This mapping allows SPARQL clauses to execute directly as Spark functions like map, filter, and join.
  • In-Memory Execution: By moving away from disk-heavy MapReduce to Apache Spark, the system maintains intermediate results in RAM, avoiding the I/O bottlenecks that hindered previous generations of RDF stores.

Experimental Setup

The approach was evaluated using two industry-standard benchmarks to test various query shapes (star, linear, snowflake, and complex):

  1. WatDiv (Waterloo SPARQL Diversity Test Suite): Tested at scales of 10M and 100M triples.
  2. LUBM (Lehigh University Benchmark): A synthetic dataset representing university organizations, scaled from 1,000 to 3,000 universities, encompassing 138M to 414M triples (up to 70GB).

Key Results and Performance Analysis

Experimental results demonstrate that SANSA.Semantic provides a robust and scalable solution for large-scale RDF querying.

Comparative runtime performance (in seconds) of SHARD, SPARQLGX-SDE, SANSA.Sparklify, and SANSA.Semantic across WatDiv and LUBM benchmarks.

Performance Insights

  • Horizontal Scalability: The system showed near-linear scalability. Increasing the cluster size from 1 to 5 worker nodes resulted in a 1.7x reduction in execution time for LUBM queries.
  • Outperforming Hadoop: SANSA.Semantic significantly outperformed SHARD, the original Hadoop-based implementation of this partitioning strategy. This confirms that the primary bottleneck in older systems was the MapReduce framework itself rather than the partitioning logic.
  • Robustness in Complex Queries: While specialized engines like SPARQLGX-SDE performed well on simpler queries, SANSA.Semantic proved more resilient for complex joins. Notably, in the LUBM $Q2$ query—where other state-of-the-art engines failed—SANSA.Semantic succeeded by leveraging Spark’s lazy evaluation to optimize join execution plans.

Limitations and Future Work

While promising, the current implementation of SANSA.Semantic is a preliminary step with several areas for improvement:

  • Query Coverage: The current parser supports common fragments like UNION, LIMIT, and FILTER, but does not yet cover the full SPARQL specification.
  • Optimization: The engine lacks cost-based optimization. Future iterations aim to integrate data statistics to enable "Basic Graph Pattern (BGP) re-ordering," allowing the engine to automatically select the most efficient execution path.
  • Data Loading: The initial de-duplication process during data ingestion involves significant shuffling, which the authors plan to optimize in future versions.

Summary updated

BibTeX
@inproceedings{sejdiu2019towards,
  author = {Gezim Sejdiu and Damien Graux and Imran Khan and Ioanna Lytra and Hajira Jabeen and Jens Lehmann},
  title = {{Towards a Scalable Semantic-Based Distributed Approach for SPARQL Query Evaluation}},
  booktitle = {SEMANTiCS},
  year = {2019},
  doi = {10.1007/978-3-030-33220-4\_22},
}
Figure