<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>SPARQLGX in Action: Efficient Distributed Evaluation of SPARQL with Apache Spark</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Damien Graux</string-name>
          <email>damien.graux@inria.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Louis Jachiet</string-name>
          <email>louis.jachiet@inria.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pierre Genevès</string-name>
          <email>pierre.geneves@cnrs.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Nabil Layaïda</string-name>
          <email>nabil.layaida@inria.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Inria</institution>
          ,
          <addr-line>Cnrs, lig and Univ. Grenoble Alpes</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We demonstrate sparqlgx: our implementation of a distributed sparql evaluator. We show that sparqlgx makes it possible to evaluate sparql queries on billions of triples distributed across multiple nodes, while providing attractive performance figures. We demonstrate the sparqlgx system introduced in [5] which is designed to evaluate sparql queries efficiently in a distributed manner on top of the Apache Spark framework1. sparql [1] is the standard query language for retrieving and manipulating data represented in rdf [7]. The core of the sparql query language is the Basic Graph Pattern fragment (bgp) composed of conjunctions of triple patterns (tps) which express conditions on rdf triples. sparqlgx supports the bgp fragment of sparql extended with union and optional operators at top level and with solution modifiers. sparqlgx implements specific optimizations aimed at optimizing the evaluation of bgps. For example, the following query taken from the WatDiv benchmark [3] (c3) involving one bgp composed of six triple patterns returns all the matching subjects from the dataset.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>SELECT ?v0 WHERE {
?v0 wsdbm:likes ?v1 .
?v0 terms:Location ?v3 .
?v0 wsdbm:gender ?v5 .
?v0 wsdbm:friendOf ?v2 .
?v0 foaf:age ?v4 .
?v0 foaf:givenName ?v6 . }</p>
    </sec>
    <sec id="sec-2">
      <title>SPARQLGX Architecture and Principles</title>
      <p>
        Data Storage Model. In order to process rdf datasets, we adopt the vertical
partitioning approach introduced by Abadi et al. in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] which stores a triple
(s p o) in a file named p whose contents keeps only s and o entries. Converting
rdf data into a vertically partitioned dataset is straightforward while (1) tending
to minimize the memory footprint and the datasets size on disks and (2) reducing
response time when queries have bounded predicates since searches are limited
to the relevant files.
1 http://spark.apache.org/
      </p>
      <p>Compilation of sparql bgps. Conjunctions of triple patterns are translated
in terms of primitives of the Apache Spark framework expressed in Scala code.
Each bgp is first translated in terms of a list of filters, which are then joined
based on common variables.</p>
      <p>Optimized Joins With Statistics. To speed up the evaluation of queries,
particular attention is paid to the ordering of joins in the translation process. We
compute statistics on data (i.e. we count all the distinct subjects, predicates
and objects to obtain a notion of triple pattern selectivity based on occurrence
numbers). Then we rewrite queries in order to minimize the sizes of intermediate
results. Triple patterns are joined in decreasing order of their selectivities (i.e.
triple patterns that return the smallest number of results are joined first).
Direct Evaluation. In certain situations, queried data might be subject to
updates; in others users might only need to evaluate a single query once (for data
cleaning purposes for instance). In such cases, it is interesting to limit as much
as possible both the preprocessing time and the query evaluation time. For this
purpose, sparqlgx provides a specific tool, called sde, capable of directly
evaluating sparql queries without preprocessing.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Demonstration Details</title>
      <p>
        We report on our experimental comparisons of sparqlgx against other open
source hdfs-based distributed rdf systems such as PigSPARQL [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], RYA [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ],
CliqueSquare [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], S2RDF [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and RDFHive [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. We deploy them on the same
10-node cluster having the hdfs installed with default settings which imply
a resiliency to the loss of two nodes. Furthermore, we consider several datasets
(presented in Table 1) coming from two popular bgp benchmarks: LUBM [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and
WatDiv [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. These benchmarks are respectively composed of 14 and 20 sparql
queries.
      </p>
      <p>
        We present in Figure 1 the response times obtained with WatDiv1k. This
illustrates that, for this dataset: (1) SDE always outperforms other tested “direct
evaluators” (e.g. PigSPARQL and RDFHive); (2) sparqlgx is able to answer all
the queries unlike RYA and CliqueSquare; (3) it shares with CliqueSquare the
same order of magnitude for queries L[
        <xref ref-type="bibr" rid="ref1 ref2 ref3 ref4 ref5">1–5</xref>
        ]; (4) it outperforms its competitors
on queries C1, C2 and C3 (shown in the introduction).
      </p>
      <p>To further illustrate the performance of sparqlgx, we provide an interactive
GUI. Attendees can interact directly with our engines (i.e. sparqlgx and sde)</p>
      <sec id="sec-3-1">
        <title>CliqueSquare</title>
      </sec>
      <sec id="sec-3-2">
        <title>PigSPARQL</title>
      </sec>
      <sec id="sec-3-3">
        <title>RDFHive SDE</title>
        <p>104
) 103
(se
m
i
T 102
101</p>
        <p>C1 C2 C3 F1 F2 F3 F4 F5 L1 L2 L3 L4 L5 S1 S2 S3 S4 S5 S6 S7
by evaluating several sparql queries on various rdf datasets: such as those
presented in Table 1 and other smaller ones. Additionnally, we also deploy the
other hdfs-based distributed systems (to have a common basis of comparison);
thereby, participants can compare several systems running exactly on the same
cluster. We demonstrate sparqlgx and sde with various interaction scenarios:
1. Loading datasets: participants can select a dataset among several predefined
ones and a system to run its preprocessing phase. They can experience the
preprocessing time of sparqlgx, RYA, CliqueSquare and S2RDF. Since the
loading and indexing cost can be high, we limit this feature to the smaller
rdf datasets.
2. Query Evaluation (e.g. Figure 2b): attendees can evaluate predefined sparql
queries which are extracted from LUBM and Watdiv. After choosing a
dataset and a query, participants can select the evaluation system among
sparqlgx, sde, RYA, CliqueSquare, S2RDF, RDFHive and PigSPARQL.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>sparqlgx outperforms several related implementations in many cases, while
implementing a simple architecture exclusively built on top of open source and
publicly available technologies. The sparqlgx implementation is available from:</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <source>1. SPARQL 1.1 overview (March</source>
          <year>2013</year>
          ), http://www.w3.org/TR/sparql11-overview/
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Abadi</surname>
          </string-name>
          , Marcus, Madden, Hollenbach:
          <article-title>Scalable semantic web data management using vertical partitioning</article-title>
          .
          <source>VLDB</source>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Aluç</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hartig</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Özsu</surname>
            ,
            <given-names>M.T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Daudjee</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Diversified stress testing of RDF data management systems</article-title>
          .
          <source>In: ISWC</source>
          . pp.
          <fpage>197</fpage>
          -
          <lpage>212</lpage>
          . Springer (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Goasdoué</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaoudi</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Manolescu</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Quiané-Ruiz</surname>
            ,
            <given-names>J.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zampetakis</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          : Cliquesquare:
          <article-title>Flat plans for massively parallel RDF queries</article-title>
          .
          <source>In: ICDE</source>
          . pp.
          <fpage>771</fpage>
          -
          <lpage>782</lpage>
          . IEEE (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Graux</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jachiet</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Genevès</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Layaïda</surname>
          </string-name>
          , N.:
          <article-title>SPARQLGX: A distributed RDF store mapping SPARQL to Spark</article-title>
          .
          <source>ISWC</source>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Guo</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pan</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heflin</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>LUBM: A benchmark for OWL knowledge base systems</article-title>
          .
          <source>Web Semantics</source>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Hayes</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McBride</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>RDF semantics</article-title>
          .
          <source>W3C Rec</source>
          . (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Punnoose</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Crainiceanu</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rapp</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Rya: a scalable RDF triple store for the clouds</article-title>
          .
          <source>In: Workshop on Cloud Intelligence</source>
          . p.
          <fpage>4</fpage>
          .
          <string-name>
            <surname>ACM</surname>
          </string-name>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Schätzle</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Przyjaciel-Zablocki</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lausen</surname>
          </string-name>
          , G.:
          <article-title>PigSPARQL: Mapping SPARQL to pig latin</article-title>
          .
          <source>In: SemWeb Information Management</source>
          . p.
          <fpage>4</fpage>
          .
          <string-name>
            <surname>ACM</surname>
          </string-name>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Schätzle</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Przyjaciel-Zablocki</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Skilevic</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lausen</surname>
          </string-name>
          , G.:
          <article-title>S2RDF: RDF querying with SPARQL on spark</article-title>
          .
          <source>VLDB</source>
          pp.
          <fpage>804</fpage>
          -
          <lpage>815</lpage>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>