<!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>Optimizing FOL reducible query answering: understanding performance challenges</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Damian Bursztyn</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Francois Goasdoue</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ioana Manolescu</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>INRIA &amp; LIX</institution>
          ,
          <addr-line>Ecole Polytechnique</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Semantic Web data management raises the challenge of answering queries under constraints (i.e., in the presence of implicit data). To bridge the gap between this extended setting and that of query evaluation provided by database engines, a reasoning step (w.r.t. the constraints) is necessary before query evaluation. A large and useful set of ontology languages enjoys FOL reducibility of query answering : queries can be answered by evaluating a SQLized rst-order logic (FOL) formula (obtained from the query and the ontology) directly against the explicitly stored data (i.e., without considering the ontological constraints). Our demonstration showcases to the attendees, and analyzes, the performance of several reformulation-based query answering techniques, including one we recently described in [5], applied to the lightweight description logic DL-LiteR underpinning the W3C's OWL2 QL pro le.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Ontology-based data access (OBDA, in short) [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] aims at enabling query
answering over a database, i.e., facts, subject to ontological (deductive) constraints
modeling the considered application domain. An ontology, for instance, may
specify that any professor is a human, has a name, and must teach some class.
Constraints greatly increase the usefulness of a database: for instance, a query
asking for all the humans must return all the professors, as they are known to be
human, even though they are not explicitly stored as humans in the database.
      </p>
      <p>
        Research on OBDA query answering has bloomed recently through the
proposal of many languages for expressing ontological constraints, e.g., Datalog [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ],
Description Logics [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], Existential Rules [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], or RDF Schema for RDF graphs1. In
particular, techniques based on rst-order logic (FOL) reducibility
(a.k.a. rewritability) of query answering, e.g., [
        <xref ref-type="bibr" rid="ref13 ref14 ref15 ref16 ref7 ref8">7,8,13,14,15,16</xref>
        ] reduce the task
of computing the answer to the given query against a knowledge base (KB) to
FOL query evaluation against the KB's facts alone (a.k.a. ABox), by compiling
the KB's domain knowledge (a.k.a. TBox) into a so-called reformulated query.
This technique is known as reformulation-based query answering , which we
denote Ref in short. Evaluating a reformulated query (translated into SQL) in
a highly optimized Relational Database Management System (RDBMS)
storing the KB's facts su ces to compute the complete query answer. However,
1 http://www.w3.org/2001/sw/Specs.html
reformulated queries still raise signi cant performance challenges to RDBMSs
(speci cally, to query optimizers), due to their complex structure [
        <xref ref-type="bibr" rid="ref4 ref5">4,5</xref>
        ].
      </p>
      <p>
        Our demonstration compares and analyzes the performance of
state-of-theart alternative Ref techniques for the lightweight DL-LiteR description logic [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ],
which underpins the W3C's OWL2 QL standard for Semantic Web applications.
They mainly di er w.r.t. the FOL languages in which query reformulations are
produced. In particular, our recent Ref technique described in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] departs from
the literature by considering expressive enough FOL reformulation languages to
admit several query reformulation alternatives, from which one with best
estimated evaluation cost is picked and sent to an RDBMS. This way we avoid
the reformulation performance pitfalls of the previous Ref techniques from the
literature: each of them is capable of exploring a unique query reformulation,
which may be turn out too complex to evaluate e ciently by an RDBMS.
      </p>
      <p>
        We prepared a set of scenarios (data, constraints, and queries) allowing the
audience to experiment with a variety of Ref techniques, and to evaluate them
through well established RDBMSs: DB2 (with or without the DB2 e cient RDF
store [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]) and Postgres. In particular, we show that (i) Ref techniques yielding
a unique query reformulation may lead to poor performance or simply fail - on
moderate-sized databases and simple constraints - on all the systems, because
reformulated queries may be syntactically huge and (ii) a cost-based query
reformulation approach allows avoiding such performance issues and makes Ref
feasible - and e cient - in the same setting(s).
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Cover-based query answering optimization</title>
      <p>
        RDBMS query optimizers enable e cient evaluation by exploring a set of logical
and physical plans, and chosing the one minimizing a cost estimation function.
Since the number of possible plans is very high [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], modern optimizers rely on
heuristics to explore only a few alternatives; this works (very) well for
small-tomoderate size conjunctive queries (CQs in short). However, FOL reformulations
go beyond CQs in general, and may be extremely large, leading the RDBMS to
perform poorly (an example appears at http://bit.ly/1TqeVMA).
      </p>
      <p>
        To address this, we introduce the cover-based query answering technique [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
to de ne a space of equivalent FOL reformulations of a CQ. A cover de nes how
the query is split into subqueries, that may overlap, called fragment queries, such
that substituting each subquery with its FOL reformulation (obtained from any
state-of-the-art technique) and joining the corresponding (reformulated)
subqueries, may yield a FOL reformulation of the given query; this can be a Join of
Unions of CQ (JUCQ) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], or a slightly more complex form (two layers of
joinsof-unions), denoted JUSCQ [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. Not every cover of a query leads to a FOL
reformulation; but every cover which does, yields an alternative cover-based FOL
reformulation of the original query. Crucially for our problem, a smart cover
choice may lead to a cover-based reformulation whose evaluation is more e
cient. Thus, the cover-based technique amounts to circumventing the di culty
of modern RDBMSs to e ciently evaluate FOL reformulations in general.
      </p>
      <p>We address the performance challenges raised by the evaluation of
state-ofthe-art FOL reformulations through RDBMSs for DL-LiteR in two steps.</p>
      <p>First, we have identi ed a space of alternative equivalent FOL queries for a
given input query, belonging to richer languages than those considered so far in
the literature. Allowing several FOL queries (a.k.a. FOL reformulations) is crucial
for e ciency, as such equivalent alternatives may have very di erent evaluation
performance when evaluated through an RDBMS. Therefore, instead of having
a single ( xed) FOL reformulation that may be ine cient, we select the one with
lowest estimated evaluation cost among possible (equivalent) alternatives.</p>
      <p>
        Second, we devised a cover search algorithm, namely GDL (Greedy Covers
for DL) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], that relies on a cost estimation function which returns the cost
of evaluating a given query q through an RDBMS storing the facts, to select the
cover with the best (estimated) cost. The algorithm starts with the root cover
(the cover with maximal number of fragments among all the covers for q and
T that lead to FOL reformulations), Croot, and explores the search space adding
one atom to a fragment (leading to a new cover) when the cost model suggests
the resultant cover may lead to a more e cient query answering strategy. The
exploration stops when no possible moves improve the cost of the currently
selected best cover.
      </p>
      <p>
        We demonstrate experimentally the e ectiveness and the e ciency of our
query answering technique for DL-LiteR, by deploying our query answering
technique on top of Postgres and DB2, using several alternative data layouts [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Demonstration outline</title>
      <p>
        Our demo analyzes OBDA
with a particular focus
on performance and
completeness. We demonstrate
di erent query
reformulation techniques, which
for a given CQ produce
respectively: UCQ [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], USCQ
[
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], and JUCQs or JUSCQs
[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] (the latter include
UCQ, USCQ and Croot
reformulations). The GUI
allows the attendee to
compare and understand
the performance of
evaluFig. 1: Understanding cover-based Query Answering. ating each of them.
      </p>
      <p>
        (i) We use well-established RDBMSs, namely PostgreSQL 9.3.2 and
DB2 Express-C 10.5, on top of which queries can be answered using any cover:
a xed one (i.e., a UCQ, USCQ or Croot), a user-chosen one (a JUCQ or JUSCQ), or the
best one w.r.t. cost (selected by GDL). (ii) We showcase the same alternatives
on top of the DB2 e cient RDF store [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>
        We rely on real and synthetic RDF data sets, such as the Norwegian
Petroleum Directorate (NPD) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] and DL-LiteR version of LUBM, LUBM9 [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
The demo attendee experience is as follows. 1. Select an RDF graph (data
and constraints). 2. Pick a query and answer it using di erent systems and
techniques, comparing their performance. 3. Inspect the chosen FOL query as well
as its SQL translation to understand the performance challenges its (evaluation)
raises to the RDBMSs. 4. Observe the query answering runtime and examine:
the chosen query plan; cardinalities and costs of (sub)queries; and (if the cover
was selected by GDL) the space of explored alternatives, and their estimated
costs (Figure 1).
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Baader</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McGuinness</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nardi</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patel-Schneider</surname>
            ,
            <given-names>P.F</given-names>
          </string-name>
          . (eds.):
          <article-title>The Description Logic Handbook: Theory, Implementation, and Applications</article-title>
          . Cambridge University Press (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Baget</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leclere</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mugnier</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Salvat</surname>
          </string-name>
          , E.:
          <article-title>On rules with existential variables: Walking the decidability line</article-title>
          .
          <source>Arti cial Intelligence</source>
          <volume>175</volume>
          (
          <fpage>9</fpage>
          -
          <lpage>10</lpage>
          ) (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Bornea</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dolby</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kementsietsidis</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Srinivas</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dantressangle</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Udrea</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bhattacharjee</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Building an e cient RDF store over a relational database</article-title>
          .
          <source>In: SIGMOD</source>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Bursztyn</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Goasdoue</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Manolescu</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Optimizing reformulation-based query answering in RDF</article-title>
          . In: EDBT (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Bursztyn</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Goasdoue</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Manolescu</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Teaching an RDBMS about ontological constraints</article-title>
          .
          <source>In: PVLDB</source>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Cal</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gottlob</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lukasiewicz</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>A general datalog-based framework for tractable query answering over ontologies</article-title>
          .
          <source>In: PODS</source>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Giacomo</surname>
            ,
            <given-names>G.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lembo</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lenzerini</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosati</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          :
          <article-title>Tractable reasoning and e cient query answering in description logics: The DL-Lite family</article-title>
          .
          <source>JAR</source>
          <volume>39</volume>
          (
          <issue>3</issue>
          ),
          <volume>385</volume>
          {
          <fpage>429</fpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Chortaras</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Trivela</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stamou</surname>
            ,
            <given-names>G.B.</given-names>
          </string-name>
          :
          <article-title>Optimized query rewriting for OWL 2 QL</article-title>
          . In: CADE (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Lanti</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rezk</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Xiao</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>The NPD benchmark: Reality check for OBDA systems</article-title>
          . In: EDBT. pp.
          <volume>617</volume>
          {
          <issue>628</issue>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Lenzerini</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Ontology-based data management</article-title>
          .
          <source>In: CIKM</source>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Lutz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Seylan</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Toman</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolter</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>The combined approach to OBDA: taming role hierarchies using lters</article-title>
          .
          <source>In: ISWC</source>
          . pp.
          <volume>314</volume>
          {
          <issue>330</issue>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Ono</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lohman</surname>
            ,
            <given-names>G.M.</given-names>
          </string-name>
          :
          <article-title>Measuring the complexity of join enumeration in query optimization</article-title>
          .
          <source>In: VLDB</source>
          (
          <year>1990</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Perez-Urbina</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Motik</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>E cient query answering for OWL 2</article-title>
          . In: ISWC (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Rosati</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Almatelli</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Improving query answering over DL-Lite ontologies</article-title>
          .
          <source>In: KR</source>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Thomazo</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Compact rewriting for existential rules</article-title>
          .
          <source>In: IJCAI</source>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Venetis</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stoilos</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stamou</surname>
            ,
            <given-names>G.B.</given-names>
          </string-name>
          :
          <article-title>Incremental query rewriting for OWL 2 QL</article-title>
          . In: Description Logics (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>