<!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>Federated SPARQL Query Processing Via CostFed</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Alexander Potocki</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Muhammad Saleem</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tommaso Soru</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Olaf Hartig</string-name>
          <email>olaf.hartig@liu.se</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Martin Voigt</string-name>
          <email>martin.voigtg@ontos.com</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Axel-Cyrille Ngonga Ngomo</string-name>
          <email>axel.ngonga@upb.de</email>
          <email>ngongag@informatik.uni-leipzig.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>AKSW</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>IDA, Linko ̈ping University</institution>
          ,
          <country country="SE">Sweden</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Paderborn</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Efficient source selection and optimized query plan generation belong to the most important optimization steps in federated query processing. This paper presents a demo of CostFed, an index-assisted federation engine for federated SPARQL query processing. CostFed's source selection and query planning is based on the index generated from the SPARQL endpoints. The key innovation behind CostFed is that it considers the skew distribution of the resources to perform efficient source selection and cost-based query planning. Our experiments on the FedBench benchmark that CostFed on average is 3 to 121 times faster than the state of the art.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        Answering complex queries on the Web of data often requires merging partial results
contained across different data sources. The optimization of engines that support this
type of queries, called federated query engines, is thus of central importance for the
efficient and scalable deployment of Semantic Web technologies. Current cost-based
SPARQL endpoint federation approaches [
        <xref ref-type="bibr" rid="ref2 ref4 ref9">2,4,9</xref>
        ] assume that the resources pertaining
to a predicate are uniformly distributed. Hence, they make use of average selectivities
to estimate the cardinality of triple patterns. However, in reality the resources are not
uniformly distributed in RDF datasets [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Our analysis5 of the well-known federation
benchmark named FedBench [
        <xref ref-type="bibr" rid="ref10 ref7">7</xref>
        ] confirms that the FedBench resources are not uniformly
distributed. The downside of using average selectivities for triple patterns cardinality
estimation is that it can lead to poor cardinality estimation when a high-frequency
resource (i.e., a resource that occurs in a large number of triples) is used in that triple
pattern. Consequently, the query planning can be significantly affected as suggested by
our evaluation (see Section 2).
      </p>
      <p>
        CostFed is an index-assisted SPARQL endpoint federation engine. CostFed’s query
planning is based on estimating query costs by using selectivity information stored in an
index. In contrast to the state of the art, CostFed takes the skew in distribution of subjects
and objects across predicates into account. In addition, CostFed extends the join-aware
source selection technique introduced in HiBISCuS [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Our join implementation is
based on both bound [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and symmetric hash joins. A comparison of CostFed with
stateof-the-art federation engines (ANAPSID [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], SemaGrow [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], SPLENDID [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], HiBISCuS
5 FedBench analysis: https://github.com/AKSW/CostFed/tree/master/stats
      </p>
      <p>FedX SPLENDID ANAPSID SemaGrow CostFed
CD1 CD2 CD3 CD4 CD5 CD6 CD7 LS1</p>
      <p>LS2</p>
      <p>LS3</p>
      <p>LS4</p>
      <p>LS5</p>
      <p>LS6</p>
      <p>
        LS7 Avg.
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], and FedX [
        <xref ref-type="bibr" rid="ref11 ref8">8</xref>
        ]) show that we outperform these engines on the overall query runtime
on the majority of the FedBench [
        <xref ref-type="bibr" rid="ref10 ref7">7</xref>
        ] queries.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Evaluation Results</title>
      <p>
        We used FedBench [
        <xref ref-type="bibr" rid="ref10 ref7">7</xref>
        ] for evaluation which comprises 25 queries, 14 of which
(CD1CD7, LS1-LS7) are for SPARQL endpoint federation approaches (the other 11 queries
(LD1-LD11) are for Linked Data federation approaches [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]). As CostFed is a SPARQL
endpoint federation, we used all 14 SPARQL endpoint federation queries in our
evaluation.
      </p>
      <p>The query execution time is often used as key metric to compare federation engines.
Herein, we consider the query execution time to be the time necessary to gather all the
results from the result set iterator of each engine. Figure 1 shows the runtime performance
of the state-of-the-art SPARQL endpoint federation engines. Overall, CostFed clearly
outperforms the other selected systems. On FedBench, CostFed is better than FedX on
11/14 queries and outperforms SPLENDID, ANAPSID and SemwGrow on all 14 queries.
CostFed’s average runtime across all 14 FedBench queries is only 440ms while FedX
needs 7,468ms (i.e., 16 times the runtime of CostFed), SPLENDID’s is 5,3404ms (i.e.,
121 slower than CostFed), ANAPSID’s is 12,467ms (i.e., 28 that of CostFed), and
SemaGrow’s is 1,203ms (i.e., 3 slower than CostFed). Since the execution times for
the FedBench queries are very small, i.e., less than 3 seconds on CostFed, the average
runtime performance for a system is greatly affected if a particular query takes too
long. For example, FedX takes 94,519ms to execute LS6, due to which overall runtime
performance is greatly decreased comparing to CostFed. If we remove the LS6 runtime,
then FedX’s average (across the remaining 13 queries) runtime is 771 ms (2 CostFed’s).
3</p>
    </sec>
    <sec id="sec-3">
      <title>CostFed Online</title>
      <p>The CostFed online demo along with the source code is available from the CostFed
homepage https://github.com/AKSW/costfed.</p>
      <sec id="sec-3-1">
        <title>3.1 Interface</title>
        <p>1. Create CostFed repository: The first step is to create CostFed repository. The user
has to select ‘CostFed’ from the drop down menu. The rest of the process is exactly
the same as creating a new RDF4J repository.
2. Endpoint manager: The second step is to register the set of SPARQL endpoints
over which the given SPARQL query will be executed. Beside registering new
SPARQL endpoints, the manager allows to enable/disable the given endpoint and
generate CostFed index for the given endpoint. Please note that as mentioned before
CostFed is index-assisted approach. Therefore, all indexes should be created first
before running the SPARQL queries. The generated indexes can be downloaded as a
Turtle file.
3. Running queries: The third step is to write SPARQL query and run it over given
set of enabled SPARQL endpoints. Note that CostFed allows running both federated
and non-federated SPARQL queries.
4. Results: The results of the query executed in step (3) will be shown in windows 4.</p>
        <p>Exactly same like RDF4J the results can be downloaded in different formats, e.g.,
CSV, TSV, etc. Also the number of results per page can be set.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2 Implementation</title>
        <p>The CostFed demo comprises two main web applications: 1) the endpoint manager which
manages the SPARQL endpoints and 2) the query executor which enables user to write
6 Online at http://costfed.aksw.org.
and execute SPARQL queries. The front end of the endpoint manager was developed
using the VueJs7 framework while the backend is implemented as a Java servlet. The
application uses a file system as a storage for SPARQL endpoints descriptors, errors, and
indexes. Each descriptor is represented as a standard Java property file. The files contain
all current endpoint parameters, including the state of the summary generation procedure.
The SPARQL query executor application is developed on top of the well-known RDF4J8
Workbench. Basically, it is an extension to the RDF4J workbench where we embedded
CostFed in the form of an RDF4J repository.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>We presented CostFed, a federated engine for SPARQL endpoint federation. CostFed
implements innovative solutions for the selection of sources, the estimation of
cardinalities and the planning of queries. We evaluated our approach against state-of-the-art
federation systems.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgements</title>
      <p>This work was supported by the H2020 project HOBBIT (no. 688227), the BmBF project
DIESEL (no. 01QE1512C), the BMWi project GEISER (no. 01MD16014), and by the
BMWi project SAKE (no. 01MD15006E). Olaf Hartig’s work was funded by the CENIIT
program at Linko¨ping University (project no. 17.05).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>M.</given-names>
            <surname>Acosta</surname>
          </string-name>
          , M.-E. Vidal,
          <string-name>
            <given-names>T.</given-names>
            <surname>Lampo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Castillo</surname>
          </string-name>
          , and
          <string-name>
            <surname>E. Ruckhaus.</surname>
          </string-name>
          <article-title>ANAPSID: an adaptive query processing engine for SPARQL endpoints</article-title>
          .
          <source>In ISWC</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>A.</given-names>
            <surname>Charalambidis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Troumpoukis</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Konstantopoulos</surname>
          </string-name>
          . Semagrow:
          <article-title>Optimizing federated sparql queries</article-title>
          .
          <source>In SEMANTICS</source>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>S.</given-names>
            <surname>Duan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kementsietsidis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Srinivas</surname>
          </string-name>
          , and
          <string-name>
            <given-names>O.</given-names>
            <surname>Udrea</surname>
          </string-name>
          .
          <article-title>Apples and oranges: a comparison of rdf benchmarks and real rdf datasets</article-title>
          .
          <source>In ACM SIGMOD</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>O.</given-names>
            <surname>Go</surname>
          </string-name>
          <article-title>¨rlitz and</article-title>
          <string-name>
            <given-names>S.</given-names>
            <surname>Staab</surname>
          </string-name>
          . Splendid:
          <article-title>Sparql endpoint federation exploiting void descriptions</article-title>
          .
          <source>In COLD at ISWC</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>M.</given-names>
            <surname>Saleem</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Khan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hasnain</surname>
          </string-name>
          ,
          <string-name>
            <surname>I.</surname>
          </string-name>
          <article-title>Ermilov, and</article-title>
          <string-name>
            <given-names>A.-C. N.</given-names>
            <surname>Ngomo</surname>
          </string-name>
          .
          <article-title>A fine-grained evaluation of sparql endpoint federation systems</article-title>
          .
          <source>SWJ</source>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>M.</given-names>
            <surname>Saleem</surname>
          </string-name>
          and A.
          <string-name>
            <surname>-C. Ngonga</surname>
          </string-name>
          <article-title>Ngomo. HiBISCuS: Hypergraph-based source selection for sparql endpoint federation</article-title>
          .
          <source>In ESWC</source>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>M.</given-names>
            <surname>Schmidt</surname>
          </string-name>
          , O. Go¨rlitz, P. Haase,
          <string-name>
            <given-names>G.</given-names>
            <surname>Ladwig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Schwarte</surname>
          </string-name>
          , and
          <string-name>
            <given-names>T.</given-names>
            <surname>Tran</surname>
          </string-name>
          .
          <article-title>Fedbench: a benchmark suite for federated semantic data query processing</article-title>
          .
          <source>In ISWC</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>A.</given-names>
            <surname>Schwarte</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Haase</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Hose</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Schenkel</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Schmidt</surname>
          </string-name>
          . Fedx:
          <article-title>Optimization techniques for federated query processing on linked data</article-title>
          .
          <source>In ISWC</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>X.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Tiropanis</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H. C.</given-names>
            <surname>Davis</surname>
          </string-name>
          . Lhd:
          <article-title>Optimising linked data query processing using parallelisation</article-title>
          .
          <source>In LDOW at WWW</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>7 VueJs: https://vuejs.org/v2/guide/</mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <article-title>8 RDF4J formally known as Sesame: http://RDF4J</article-title>
          .org/
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>