Skip to main content
QUICK REVIEW

[Paper Review] A Stitch in Time Saves Nine -- SPARQL querying of Property Graphs using Gremlin Traversals

Harsh Thakkar, Dharmen Punjani|arXiv (Cornell University)|Jan 9, 2018
Graph Theory and AlgorithmsComputer Science34 references13 citations
TL;DR

This paper presents Gremlinator, a novel SPARQL-to-Gremlin translator that enables SPARQL queries to be executed over property graph databases using Gremlin traversals. By translating SPARQL basic graph patterns into declarative Gremlin pattern-matching traversals, the approach achieves significant performance improvements—especially for star-shaped and complex queries—demonstrating substantial speedups over native SPARQL engines on RDF stores like Virtuoso and 4Store.

ABSTRACT

Knowledge graphs have become popular over the past years and frequently rely on the Resource Description Framework (RDF) or Property Graphs (PG) as underlying data models. However, the query languages for these two data models -- SPARQL for RDF and Gremlin for property graph traversal -- are lacking interoperability. We present Gremlinator, a novel SPARQL to Gremlin translator. Gremlinator translates SPARQL queries to Gremlin traversals for executing graph pattern matching queries over graph databases. This allows to access and query a wide variety of Graph Data Management Systems (DMS) using the W3C standardized SPARQL query language and avoid the learning curve of a new Graph Query Language. Gremlin is a system-agnostic traversal language covering both OLTP graph database or OLAP graph processors, thus making it a desirable choice for supporting interoperability wrt. querying Graph DMSs. We present a comprehensive empirical evaluation of Gremlinator and demonstrate its validity and applicability by executing SPARQL queries on top of the leading graph stores Neo4J, Sparksee, and Apache TinkerGraph and compare the performance with the RDF stores Virtuoso, 4Store and JenaTDB. Our evaluation demonstrates the substantial performance gain obtained by the Gremlin counterparts of the SPARQL queries, especially for star-shaped and complex queries.

Motivation & Objective

  • To address the lack of interoperability between SPARQL (RDF) and Gremlin (property graph) query languages.
  • To enable SPARQL users to query property graph databases without learning a new language.
  • To improve query performance by leveraging the locality-aware traversal capabilities of property graph databases.
  • To provide a unified query interface across diverse graph data management systems (DMS).
  • To demonstrate the feasibility and performance benefits of translating SPARQL to Gremlin for hybrid graph query execution.

Proposed method

  • Mapping SPARQL basic graph patterns (BGPs) to declarative Gremlin pattern-matching traversals using a step-by-step translation of SPARQL operations to Gremlin traversal steps.
  • Using the Apache TinkerPop framework as a target execution environment to ensure compatibility across multiple property graph databases (e.g., Neo4j, Sparksee, TinkerGraph).
  • Translating each SPARQL query into a corresponding Gremlin traversal that preserves semantic equivalence while optimizing for graph locality.
  • Employing a system-agnostic approach that avoids vendor-specific Gremlin dialects, ensuring portability across OLTP and OLAP graph processors.
  • Designing the translator to support both imperative and declarative traversal styles, focusing on declarative pattern matching for fair performance comparison.
  • Validating the translation via empirical evaluation on the BSBM and Northwind datasets across multiple DMS, including RDF stores (Virtuoso, 4Store, JenaTDB) and property graph stores (Neo4j, Sparksee, TinkerGraph).

Experimental results

Research questions

  • RQ1Can SPARQL queries be effectively translated into Gremlin traversals to enable interoperability between RDF and property graph systems?
  • RQ2Does translating SPARQL to Gremlin result in measurable performance improvements over native SPARQL execution on RDF stores?
  • RQ3How do query performance characteristics differ between SPARQL and Gremlin for star-shaped and complex graph patterns?
  • RQ4Can Gremlinator enable seamless query execution across heterogeneous graph databases without requiring application-level changes?
  • RQ5What is the performance overhead or benefit of using Gremlin traversals over native SPARQL engines for various query types?

Key findings

  • Gremlinator successfully translates SPARQL queries into equivalent Gremlin pattern-matching traversals, enabling interoperability between RDF and property graph systems.
  • For star-shaped and complex queries, Gremlin traversals outperform native SPARQL execution by up to 3.5x on average, with some queries showing over 10x speedups.
  • On the BSBM dataset, Gremlin traversals executed in 11.49–17.01 ms (without indexes) on TinkerGraph, compared to 36.25–52 ms on Virtuoso (with indexes), showing significant performance gains.
  • On the Northwind dataset, Gremlinator achieved execution times as low as 0.39 ms (L2 query on TinkerGraph) versus 113 ms on 4Store, highlighting superior performance for certain patterns.
  • The performance advantage is most pronounced for queries that benefit from graph locality, where Gremlin’s micro-indexing and traversal efficiency outperform SPARQL’s join-based execution.
  • The evaluation confirms that Gremlinator enables efficient, portable, and high-performance SPARQL querying across diverse graph databases, including both OLTP and OLAP systems.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.