<!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>Query Rewriting in Horn-S HI Q (Extended Abstract)</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Despoina Trivela</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giorgos Stoilos</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alexandros Chortaras</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giorgos Stamou</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>School of Electrical and Computer Engineering, National Technical University of Athens</institution>
          ,
          <country country="GR">Greece</country>
        </aff>
      </contrib-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Resolution is an important and attractive tool for rewriting a Description Logic
ontology into (disjunctive) datalog for the purposes of query answering [
        <xref ref-type="bibr" rid="ref3 ref5 ref6">3, 5,
6</xref>
        ]. This is because there are already many general purpose resolution calculi
that can support deduction in much more expressive logics and which have
well-de ned powerful redundancy elimination criteria like clause subsumption.
However, the generality of these procedures implies that the characteristics and
structure of DL axioms are not fully exploited during saturation and as a
consequence the designed rewriting algorithms often su er from performance
issues [
        <xref ref-type="bibr" rid="ref4 ref7">7, 4</xref>
        ]. More precisely, resolution algorithms like those designed in [
        <xref ref-type="bibr" rid="ref3 ref5 ref6">3, 5,
6</xref>
        ] usually produce far too many clauses that contain function terms, many
of which are never used to derive other function-free clauses that are
members of the ontology rewriting. For example, a typical algorithm will always
resolve clauses A(x) R(x; y) ^ B(y) and R(x; f (x)) C(x) to produce
A(x) C(x) ^ B(f (x)) even if the function term f (x) cannot be subsequently
eliminated.
      </p>
      <p>
        In our previous work we have de ned a novel resolution-based rewriting
algorithm for DL-Lite and E LHI that largely avoids the generation of such
redundant clauses [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. The algorithm uses a macro-inference rule, called n-shrinking,
which searches for sets of clauses such that when these are used as side-premises
in consecutive resolutions, intermediate clauses with function terms can be
produced but the nal resolvent must be function-free. For example, in the
previous scenario, the algorithm will consider resolving the two clauses to produce
A(x) C(x) ^ B(f (x)) only if a clause of the form B(f (x)) C(x) also exists
in the working set of clauses and hence the function-free clause A(x) C(x)
can nally be obtained. In order to reduce the size of the set where such pairs
of side premises are looked up, in contrast to previous approaches, the
algorithm does not \propagate" function symbols. For example, all algorithms in [
        <xref ref-type="bibr" rid="ref3 ref5 ref6">3,
5, 6</xref>
        ] will resolve clauses S(x; f (x)) C(x) and R(x; y) S(x; y) to produce
R(x; f (x)) C(x). In contrast, the algorithm in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] will rst try to unfold the
clause R(x; y) S(x; y) on some clause of the form A(x) S(x; y) ^ B(y) to
produce A(x) R(x; y) ^ B(y) and then consider n-shrinking on that clause.
      </p>
      <p>We have considerably extended our previous work and designed a datalog
rewriting algorithm for Horn-SHIQ ontologies that follows the same principles.
Our rst extension is to modify the unfolding and n-shrinking rules to be
applicable on clauses with equality that are a distinctive feature of Horn-SHIQ.
Example 1. Consider an ontology consisting of the following axioms given also
in clausal form:</p>
      <p>A v</p>
      <p>1R:B
D v 9R:&gt;
C v 9S:B</p>
      <p>S v R
y</p>
      <p>z
R(x; g(x))
S(x; f (x))
R(x; y)</p>
      <p>D(x)</p>
      <p>C(x);</p>
      <p>S(x; y)
A(x) ^ R(x; y) ^ R(x; z) ^ B(y) ^ B(z)</p>
      <p>B(f (x))</p>
      <p>
        C(x)
Unfolding between (1) and (4) produces y z A(x) ^ S(x; y) ^ R(x; z) ^
B(y) ^ B(z) on which shrinking with premises clauses (3)(a) and (3)(b) produces
f (x) z A(x)^C(x)^R(x; z)^B(z). Notice how shrinking prevents resolving
clause (1) with clause (2) which would construct a redundant resolvent.
The biggest challenge in the new algorithm is to deal with equality
reasoning. Like in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] we employ superposition, however, following the ideas set in
[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] we try to restrict its application in such a way that unnecessary
intermediate clauses are constructed only when necessary. First, due to n-shrinking,
only equality clauses with function-free bodies can appear in the working set
(see also previous example). Hence, superposition inferences can be restricted to
have only such clauses as side premises which signi cantly reduces the search
space. However, superposition inferences can introduce new function terms in
the body of a clause. Consider for example clauses f (g(x0)) x0 B(x0) and
R(x; f (x)) A(x). The rst clause can be superposed into the second with
uni er x 7! g(x0) to obtain the resolvent R(g(x0); x0) A(g(x0)) ^ B(x0). Now,
rst, note that by the basic strategy of superposition [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] (superposition remains
complete if it is only applied into function terms not introduced by previous
unication steps) no subsequent superpositions need to be applied on the body of
clause R(g(x0); x0) A(g(x0)) ^ B(x0). Second, according to the ideas in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] and
our previous discussion this intermediate clause is of importance only if g(x0)
can be eliminated from the body. These two observations combined imply that
we can devise the following macro-superposition inferences:
      </p>
      <p>R(x; f (x))</p>
      <p>B(f (x))</p>
      <p>A(x) f (g(x))</p>
      <p>R(g(x); x)
A(x) f (g(x))</p>
      <p>B(x)</p>
      <p>x B(x); A(g(x))
C(x) ^ B(x)</p>
      <p>x B(x); A(g(x))
C(x) ^ B(x)</p>
      <p>C(x)
C(x)
where f (x) has not been introduced by a previous uni cation.</p>
      <p>A detailed description and de nition of the algorithm can be found at http:
//www.image.ece.ntua.gr/~despoina/document.pdf.
(1)
(2)
(3)
(4)
}</p>
    </sec>
    <sec id="sec-2">
      <title>Evaluation</title>
      <p>
        We have implemented our rewriting algorithm into our prototype system Rapid.1
We conducted an experimental evaluation and compared it against Clipper [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ],
to the best of our knowledge, the only available conjunctive query rewriting
system for Horn-SHIQ ontologies. Our test suite included Horn-SHIQ fragments
of the ontologies NASA SWEET 2.3, Periodic, and DOLCE2.1Lite-Plus. We
also used the UOBM ontology that is provided in Clipper's test suite. For the
UOBM ontology we used the 10 queries that come together with Clipper, while
for the rest we manually constructed 5 test queries. All tests were performed on
a 2,26GHz Intel Core 2 Duo laptop running OS X 10.9.5 and JVM 1.7. We set
a timeout to 2 hours. Table 1 indicates the results. As can be seen regarding
UOBM (left sub-table) Rapid is consistently faster than Clipper. The sizes of
the computed rewritings are roughly the same and di erences are attributed to
the di erent structures of the computed datalog rewritings. Regarding the much
larger and relatively real-world ontologies (right sub-table) Clipper failed to
terminate within the set time limit whereas Rapid requires at most a few
seconds.
Acknowledgements Giorgos Stoilos was funded by a Marie Curie Career
Reintegration Grant within EU's FP7 under grant agreement 303914.
1 http://www.image.ece.ntua.gr/~achort/rapid/
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Leo</given-names>
            <surname>Bachmair</surname>
          </string-name>
          , Harald Ganzinger, Christopher Lynch, and
          <string-name>
            <given-names>Wayne</given-names>
            <surname>Snyder</surname>
          </string-name>
          .
          <source>Basic paramodulation. Information and computation</source>
          ,
          <volume>121</volume>
          (
          <issue>2</issue>
          ):
          <volume>172</volume>
          {
          <fpage>192</fpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Thomas</given-names>
            <surname>Eiter</surname>
          </string-name>
          , Magdalena Ortiz, Mantas Simkus,
          <string-name>
            <surname>Trung-Kien Tran</surname>
            , and
            <given-names>Guohui</given-names>
          </string-name>
          <string-name>
            <surname>Xiao</surname>
          </string-name>
          .
          <article-title>Query rewriting for Horn-SHIQ plus rules</article-title>
          .
          <source>In Proc. of AAAI</source>
          <year>2012</year>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Ullrich</given-names>
            <surname>Hustadt</surname>
          </string-name>
          , Boris Motik, and
          <string-name>
            <given-names>Ulrike</given-names>
            <surname>Sattler</surname>
          </string-name>
          .
          <article-title>Reasoning in description logics by a reduction to disjunctive datalog</article-title>
          .
          <source>J. of Autom</source>
          . Reas.,
          <volume>39</volume>
          (
          <issue>3</issue>
          ):
          <volume>351</volume>
          {
          <fpage>384</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Martha</given-names>
            <surname>Imprialou</surname>
          </string-name>
          , Giorgos Stoilos, and Bernardo Cuenca Grau.
          <article-title>Benchmarking ontology-based query rewriting systems</article-title>
          .
          <source>In Proceedings of the 26th AAAI Conference on Arti cial Intelligence (AAAI</source>
          <year>2012</year>
          ),
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Hector</given-names>
            <surname>Perez-Urbina</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Boris</given-names>
            <surname>Motik</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Ian</given-names>
            <surname>Horrocks</surname>
          </string-name>
          .
          <article-title>A Comparison of Query Rewriting Techniques for DL-lite</article-title>
          .
          <source>In Bernardo Cuenca Grau</source>
          , Ian Horrocks, Boris Motik, and Ulrike Sattler, editors,
          <source>Proc. of the 22nd Int. Workshop on Description Logics (DL</source>
          <year>2009</year>
          ),
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Hector</given-names>
            <surname>Perez-Urbina</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Boris</given-names>
            <surname>Motik</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Ian</given-names>
            <surname>Horrocks</surname>
          </string-name>
          .
          <article-title>Tractable query answering and rewriting under description logic constraints</article-title>
          .
          <source>Journal of Applied Logic</source>
          ,
          <volume>8</volume>
          (
          <issue>2</issue>
          ):
          <volume>186</volume>
          {
          <fpage>209</fpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Frantisek</given-names>
            <surname>Simancik</surname>
          </string-name>
          , Yevgeny Kazakov, and
          <string-name>
            <given-names>Ian</given-names>
            <surname>Horrocks</surname>
          </string-name>
          .
          <article-title>Consequence-based reasoning beyond horn ontologies</article-title>
          .
          <source>In Proc. of IJCAI</source>
          <year>2011</year>
          , pages
          <fpage>1093</fpage>
          {
          <fpage>1098</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Despoina</given-names>
            <surname>Trivela</surname>
          </string-name>
          , Giorgos Stoilos, Alexandros Chortaras, and
          <string-name>
            <given-names>Giorgos</given-names>
            <surname>Stamou</surname>
          </string-name>
          .
          <article-title>Optimising resolution-based rewriting algorithms for owl ontologies</article-title>
          .
          <source>Journal of Web Semantics</source>
          , Accepted, In press,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>