TL;DR
Gremlinator is a novel translator that bridges the gap between the Semantic Web and property graph ecosystems by converting declarative SPARQL queries into Gremlin traversals. This allows developers to run standardized SPARQL queries on highly scalable property graph databases like Neo4j and Sparksee, often achieving performance gains of one to two orders of magnitude for complex, star-shaped queries.
What Problem Does This Paper Address?
The world of graph data is currently split between two major models: the Resource Description Framework (RDF), favored by the Semantic Web community for its standardized identifiers and formal semantics, and Property Graphs (PG), widely used in industry for their extreme scalability and performance in modern web applications.
The challenge is that these two worlds speak different languages. RDF uses SPARQL, a declarative pattern-matching language, while PGs typically use Gremlin, a traversal-based language that can be both imperative and declarative. This lack of interoperability forces developers to choose one ecosystem and stay there, or face a steep learning curve to master both. The authors aim to solve this "query interoperability problem" by allowing users to query property graphs using the W3C-standardized SPARQL language.
Methods
The authors introduce Gremlinator, a SPARQL-to-Gremlin translator built on the Apache TinkerPop framework. The translation process follows a four-step pipeline:
- Parsing: The input SPARQL query is parsed using the Jena ARQ module to generate an Abstract Syntax Tree (AST).
- BGP Mapping: Each Basic Graph Pattern (BGP) in the SPARQL query is mapped to a corresponding Gremlin Single Step Traversal (SST). The authors categorized these into four cases: accessing labels, accessing property values, and incoming/outgoing edge traversals.
- Operator Mapping: Relational operators like
SELECT(Projection),UNION,FILTER,LIMIT, andORDER BYare mapped to their equivalent Gremlin instruction steps (e.g.,SelectStep,UnionStep,WhereTraversalStep). - Bytecode Generation: The final conjunctive traversal is converted into Gremlin bytecode, which can be executed across any graph database supported by the TinkerPop machine.
Crucially, Gremlinator maps SPARQL to Gremlin’s declarative match() step rather than imperative steps. This ensures a fair performance comparison, as both languages are evaluated based on their pattern-matching capabilities.
Datasets
The approach was evaluated using two well-known synthetic datasets:
- Northwind: A synthetic e-commerce dataset representing a fictional company's customers, orders, and suppliers.
- Berlin SPARQL Benchmark (BSBM): A widely used benchmark for RDF stores, scaled to 1 million triples for this study.
The authors provided both RDF and Property Graph versions of these datasets to compare native SPARQL execution against translated Gremlin execution.
Key Insights and Ideas
- Graph Locality vs. Expensive Joins: Traditional RDF stores often rely on relational-style joins to resolve queries. In contrast, property graph databases exploit "graph locality" using micro-indices to perform traversals. Gremlinator allows SPARQL queries to benefit from this architectural advantage.
- Homology between Paradigms: The authors formally established a homology between SPARQL BGPs and Gremlin SSTs, proving that the declarative constructs of one can be mapped to the other without losing semantic meaning.
- System Agnosticism: By targeting the Gremlin Traversal Machine (Figure 1), Gremlinator becomes a "write once, run anywhere" solution for graph queries, supporting databases as diverse as Neo4j, OrientDB, and Sparksee.

Key Results
The empirical evaluation compared three RDF stores (Virtuoso, 4Store, JenaTDB) against three property graph stores running Gremlinator (Neo4j, Sparksee, TinkerGraph).
- Star-Shaped Queries: For complex queries with many triple patterns (bushy plans), Gremlin traversals outperformed native SPARQL by at least one order of magnitude, and in some cases, two orders of magnitude.
- Aggregation Performance: Aggregation queries (counts, group counts) were significantly faster in property graphs because they avoid the multiple inner joins required by RDF stores.
- The "Union" Exception: SPARQL still holds a comparative advantage for
UNIONqueries. This is because Gremlin treats eachmatch()step in a union as a distinct traversal before merging them, whereas SPARQL engines are highly optimized for set-based union operations. - Indexing Impact: When manual composite indices were added to the property graph stores, Gremlinator-translated queries saw further speedups of 2x to 5x for regular and restriction traversals.
Limitations and Future Work
While Gremlinator bridges a significant gap, the authors acknowledge several limitations:
- SPARQL Version: The current implementation supports SPARQL 1.0
SELECTqueries. Support for SPARQL 1.1 features like Property Paths is planned for future work. - REGEX Support: Gremlinator does not currently support regular expressions in
FILTERclauses, primarily due to limitations in the underlying TinkerPop framework. - Variable Predicates: The translator requires the property predicate to be defined; it cannot currently handle variables in the predicate position of a triple pattern (e.g.,
?s ?p ?o).
Future work aims to integrate Gremlinator into the LITMUS benchmarking framework and extend support to the full SPARQL 1.1 feature set.
Summary updated