<!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>Lower and Upper Bounds for SPARQL Queries over OWL Ontologies</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Birte Glimm</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yevgeny Kazakov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ilianna Kollia</string-name>
          <email>ilianna2@mail.ntua.gr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giorgos Stamou</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Improving Bounds via Query Extension</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>National Technical University of Athens</institution>
          ,
          <country country="GR">Greece</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Ulm University</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        The recent standardization of the SPARQL 1.1 Entailment Regimes [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], which extend
the SPARQL Query Language [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] with the capability of querying also for implicit
knowledge makes the need for an e cient evaluation of complex queries over OWL
ontologies urgent. We present an approach for optimizing the evaluation of SPARQL
queries over OWL ontologies using SPARQL’s OWL Direct Semantics entailment
regime. Such queries consist of axiom templates, i.e., Description Logic (DL) axioms with
variables in place of concept, role and individual names. Answers to such queries are
mappings of query (concept, role or individual) variables to corresponding (concept,
role or individual) names that instantiate the axiom templates to axioms entailed by the
queried knowledge base (KB).
      </p>
      <p>
        Since computing query answers over an expressive KB is computationally very
costly, approximation techniques have been proposed that use a weakened version of
the KB to compute a lower bound (yields sound but potentially incomplete results) and
a strengthened version to compute an upper bound (yields complete but potentially
unsound results) for the results [
        <xref ref-type="bibr" rid="ref7 ref8 ref9">9, 7, 8</xref>
        ]. Another well-known technique is to compute the
bounds from a complete and clash-free tableau generated by a DL reasoner [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ].
Deterministically derived facts are used as lower bound, while also non-deterministically
derived ones are considered for the upper bound. Answers in the “gap”, i.e., potential
answers in the upper but not the lower bound, usually have to be checked individually
by performing a consistency check with a fully fledged OWL 2 DL reasoner.
      </p>
      <p>
        While we also use bounds, we allow for much more expressive queries than related
approaches. To optimize the evaluation of possible query answers in the gap, we present
a query extension approach that uses the TBox of the queried KB to extend the query
with additional parts. We show that the resulting query is equivalent to the original one
and we use the additional parts that are simple to evaluate for restricting the bounds of
subqueries of the initial query. In an empirical evaluation we show that the proposed
query extension approach can lead to a significant decrease in the query execution time
of up to four orders of magnitude. More details about our method as well as more
evaluation results can be found in the extended version of our paper [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
We will show the intuition of the proposed query extension method through an example.
Let K be a KB, A; B; C be concept names, r a role name, a; b; c; d individual names, x
an individual variable, Y a concept variable and
      </p>
      <p>T = f B v A t C; 9r:B v Cg A = fA(a); B(b); r(a; b); A(d)g</p>
      <p>q = fA(x); 9r:Y(x); Y v Bg
Note that the only answer for q over K is the mapping f j (x) = a; (Y) = Bg.</p>
      <p>First we compute bounds for axiom templates of q over K . Since fA(a); A(d)g K
we have K j= A(a) and K j= A(d). That is, we can find the lower bound L = f j
(x) 2 fa; dgg for the query fA(x)g over K without performing any tests. To find an
upper bound for fA(x)g, we can use a model I of K . It is easy to check that K has a
model I = ( I; I) with I = fd1; d2; d3; d4g, aI = d1, bI = d2, cI = d3, dI = d4,
AI = fd1; d2; d4g, BI = fd2g, CI = fd1g and rI = fhd1; d2ig. Note that I 6j= A(c).
Thus, from this model alone one can conclude that K 6j= A(c) and hence that the set
U = f j (x) 2 fa; b; dgg provides an upper bound for the query fA(x)g over K .
Although the model I can be similarly used for finding an upper bound for complex
templates, such as f9r:Y(x)g, in general it can only be found by iterating over all possible
mappings for x and Y and checking which instances of this template are entailed by the
model. Therefore, in practice, one does not compute the bounds for complex templates.
The bounds for the query fY v Bg can be computed by classifying the KB and retrieving
subsumption relationships for B. Since for classification one usually needs to consider
just the (relatively small) TBox T , the bounds for this query can be computed exactly,
i.e., in our example we have L = U = f j (Y) 2 f?; Bgg.</p>
      <p>Our query extension method uses additionally the notion of a subquery bound,which
provides a range for those answers of a subquery (subset of templates) of q that are
su cient to evaluate q. The intuition of our method is that subquery bounds can be
improved using bounds of other subqueries of this query. Thus, if a query q can be
extended to an equivalent query q [ q0, the number of reasoner calls performed for
evaluating q can be reduced using q0. The proposed algorithm can be summarized as
follows: First, we replace every (concept, role, individual) variable in q with a fresh
distinct (concept, role, individual) name. For our example, consider a mapping such
that (x) = ax, (Y) = AY with ax an individual and AY a concept name. Then we
materialize and classify K plus (q), where (q) denotes the result of replacing each
variable x in q with (x), i.e., we compute all concept assertions A(a), role assertions
r(a; b), and subsumptions A v B with atomic concepts and roles entailed by K [ (q).
Afterwards, we replace names back with their corresponding variables in the extended
KB. In our example T [ (q) = fB v A t C; 9r:B v C; A(ax); 9r:AY (ax); AY v Bg j=
C(ax). Thus, for q0 = fC(x)g, we have K [ (q) j= C(ax) = (q0), and it holds that the
query q has the same answers for K as the extended query q [ q0 = fA(x); 9r:Y(x); Y v
B; C(x)g. In the end, we compute query bounds for the templates in q0 and use them to
improve the subquery bounds for templates in q. Using again the model I for K , since
I j= C(a), but I 6j= C(b), I 6j= C(c) and I 6j= C(d), we can derive the upper bound
U = f j (x) = ag for the query fC(x)g. Using this upper bound, it is now possible to
reduce the upper bound for the subquery fA(x)g of q to U. Since U is a subset of the
lower bound for fA(x)g (computed in the beginning of the section), this subquery can
be evaluated without performing any further entailment tests. The new upper bound U
can also be used to further reduce the upper bound for the subquery f9r:Y(x)g of q to
f j (x) = a; (Y) 2 f?; Bgg. After this reduction, this subquery can be evaluated using
just two entailment tests.</p>
    </sec>
    <sec id="sec-2">
      <title>Evaluation</title>
      <p>
        The proposed method has been implemented and evaluated over a set of well-known
benchmark ontologies and relevant datasets and for several forms of queries. Although
it can be used, in general, for improving the performance of most query answering
systems based on query bounds, here the evaluation is based on the system described in
Kollia et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], which, to the best of our knowledge, is the only system that supports
the evaluation of complex queries over OWL 2 DL ontologies under the OWL Direct
Semantics entailment regime of SPARQL 1.1. In our implemented method (referred
to as evalExt) we improve the subquery bounds computed in evalStatic [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] using the
method described in the previous section. Afterwards, we perform the ordering and
evaluation methods of Kollia et al. using the improved subquery bounds.
      </p>
      <p>
        In Table 1 we show the results of the evaluation on the University Ontology
Benchmark (UOBM) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] using a range of custom queries since the queries provided for
UOBM are only simple conjunctive instance queries. Column 1 shows the query qi
and extension templates qi0 (1 i 6), columns 2 and 3 show the query answering
times and the number of performed entailment checks for evalStatic, respectively, and
columns 4 and 5 show the respective numbers for evalExt. In all queries the time spent
for query extension is negligible compared to the time spent for query evaluation. We
observe that for all queries, additional extension templates were derived, which have
significantly better query bounds than the complex templates of the queries. This
directly translates to a significantly lower number of entailment checks for evalExt and,
hence, a reduction in execution times. The reduction in query answering times is up to
four orders of magnitude.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Glimm</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kazakov</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kollia</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stamou</surname>
          </string-name>
          , G.:
          <article-title>Lower and upper bounds for SPARQL queries over OWL ontologies</article-title>
          .
          <source>In: Proceedings of the 29th Conference on Artificial Intelligence (AAAI'15)</source>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Glimm</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ogbuji</surname>
          </string-name>
          , C. (eds.):
          <article-title>SPARQL 1.1 Entailment Regimes</article-title>
          .
          <source>W3C Recommendation</source>
          (
          <year>2013</year>
          ), available at http://www.w3.org/TR/sparql11-entailment/
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Harris</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Seaborne</surname>
            ,
            <given-names>A</given-names>
          </string-name>
          . (eds.)
          <source>: SPARQL 1</source>
          .1
          <string-name>
            <given-names>Query</given-names>
            <surname>Language. W3C Recommendation</surname>
          </string-name>
          (
          <year>2013</year>
          ), available at http://www.w3.org/TR/sparql11-query/
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Kollia</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Glimm</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Cost based query ordering over OWL ontologies</article-title>
          .
          <source>In: Proceedings of the 11th International Semantic Web Conference (ISWC 2012). Lecture Notes in Computer Science</source>
          , vol.
          <volume>7649</volume>
          , pp.
          <fpage>231</fpage>
          -
          <lpage>246</lpage>
          . Springer (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Kollia</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Glimm</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Optimizing SPARQL Query Answering over OWL Ontologies</article-title>
          .
          <source>Journal of Artificial Intelligence Research</source>
          <volume>48</volume>
          ,
          <fpage>253</fpage>
          -
          <lpage>303</lpage>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Ma</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Qiu</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Xie</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pan</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Towards a complete OWL ontology benchmark</article-title>
          .
          <source>In: The Semantic Web: Research and Applications</source>
          , pp.
          <fpage>125</fpage>
          -
          <lpage>139</lpage>
          . Lecture Notes in Computer Science, Springer (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Pan</surname>
            ,
            <given-names>J.Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Thomas</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhao</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>Completeness guaranteed approximation for OWL-DL query answering</article-title>
          .
          <source>In: Proceedings of the 22nd International Workshop on Description Logics (DL'09)</source>
          .
          <source>CEUR Workshop Proceedings</source>
          , vol.
          <volume>477</volume>
          .
          <string-name>
            <surname>CEUR-WS.org</surname>
          </string-name>
          (
          <year>2009</year>
          ), http://dblp. uni-trier.de/db/conf/dlog/dlog2009.html#PanTZ09
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Ren</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pan</surname>
            ,
            <given-names>J.Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhao</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>Soundness preserving approximation for TBox reasoning</article-title>
          .
          <source>In: Proceedings of the 25th National Conference on Artificial Intelligence (AAAI'10)</source>
          . AAAI Press (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Zhou</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nenov</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grau</surname>
            ,
            <given-names>B.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Pay-as-you-go OWL query answering using a triple store</article-title>
          .
          <source>In: Proceedings of the 28th Conference on Artificial Intelligence (AAAI'14)</source>
          . pp.
          <fpage>1142</fpage>
          -
          <lpage>1148</lpage>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>