<!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>Optimising Resolution-Based Rewriting Algorithms for DL Ontologies?</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>
      <abstract>
        <p>Resolution-based rewriting algorithms have been widely used for computing disjunctive datalog rewritings for DL TBoxes, and recently, also for computing datalog rewriting for queries over TBoxes expressed in DL-Lite and ELHI. Although such algorithms are general enough to support a wide variety of (even very complex) DLs, this generality comes with performance prices. In the current paper we present a resolution-based (query) rewriting algorithm for ELHI that is based on a hyper-resolution like inference rule and which avoids performing many redundant inferences. We have implemented the algorithm and have conducted an experimental evaluation using large and complex ontologies.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>is then saturated using resolution to derive new (datalog) clauses. On the one
hand, such calculi are worst-case optimal and allow for a large number of existing
optimisations, like ordering restrictions and subsumption deletion. On the other
hand, since there exist many resolution-based decision procedures for expressive
fragments of rst order logic [9, 13] it is (relatively) easier to design a
resolutionbased rewriting algorithm for an expressive DL compared to designing a custom
made one. For example, to the best of our knowledge, none of the tailor made
systems for DL-Lite can currently support more expressive DLs.</p>
      <p>However, the e ciency of resolution-based approaches has also been criticised
[22]. Even with all existing optimisations the saturation can perform many
redundant inferences producing clauses that contain function symbols and which don't
subsequently lead to the generation of function-free (datalog) clauses that are
part of the rewriting. Hence, tailor made approaches have greatly surpassed the
resolution-based ones [22, 14]. To circumvent this issue and provide an e cient
resolution-based query rewriting algorithm for DL-Lite, an optimised
hyperresolution like inference that avoids producing (intermediate) redundant clauses
that contain function symbols has been proposed [7]. The calculus was
implemented in Rapid and as shown also by independent evaluations, Rapid is
currently one of the fastest query rewriting systems [7, 14], however, like most of
them it can only support DL-Lite.</p>
      <p>In the current paper we investigate whether a resolution-based rewriting
algorithm that is based on a similar hyper-resolution step can be de ned for
for E LHI TBoxes. This is a technically very challenging task as the structure
of E LHI axioms implies many complex interactions between the clauses (in
contrast to DL-Lite, E LHI is not FO-rewritable and subsumption checking is in
ExpTime). However, we show that a rewriting can be computed by a calculus
that contains an extension of the hyper-resolution step of DL-Lite plus a new
resolution rule that we expect to be rarely applied in practice. To achieve this
we rst cast the Rapid calculus for DL-Lite to the framework of resolution and
sketch its correctness. Finally, we conducted an experimental evaluation using
large-scale real-world ontologies. Our results show that in many tests
state-ofthe-art systems cannot compute a rewriting within a reasonable amount of time
(more than one hour) compared to the new implementation.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>We use the standard notions of rst-order term, atom, variable, sentence,
constant, function symbols, functional terms, entailment (j=), and the like.
Resolution-Based Calculi We use standard notions from (resolution)
theoremproving like clause, (hyper-)resolvent and most general uni er (mgu). An
inference rule, or simply inference is an n + 1-ary relation usually written as follows:</p>
      <p>C
where C1 is called the main premise, C2; : : : Cn are called the side premises and C
is called the conclusion or resolvent. An inference system I, also called calculus,
C1</p>
      <p>C2 : : : Cn
is a collection of inference rules. Let be a set of clauses, C a clause and I an
inference system. A derivation of C from by I, written `I C (or simply
` C if I is clear from the context), is a sequence of clauses C1; : : : ; Cm such
that Cm = C, each Ci is either a member of or the conclusion of an inference
by I from [ fC1; : : : ; Ci 1g. In that case we say that C is derivable from by
I. We write `i C to denote that the depth of the corresponding derivation tree
[6] constructed for C from is less or equal to i. We also often write ; C ` C0
instead of [ fCg ` C0. An inference system with particular interest to us is
SLD, denoted by ISLD, where all side premises are members of .
Description Logics Let C, R, and I be countable, pairwise disjoint sets of
atomic concepts, atomic roles, and individuals. An E LHI-role is either an atomic
role P or its inverse P . The set of E LHI-concepts is de ned inductively as
follows, where A 2 C, R is an E LHI-role, and C(i) are E LHI-concepts: C := &gt; j
? j A j C1 u C2 j 9R:C An E LHI-TBox T is a nite set of GCIs C1 v C2, with
Ci E LHI-concepts, and RIAs R1 v R2 with Ri E LHI-roles. We assume from
now on that E LHI-TBoxes are normalised, i.e., they contain only GCIs of the
form A1 v A2, A1 uA2 v A, A1 v 9R:A2, or 9R:A2 v A1, where A(i) 2 C[f&gt;g,
and R 2 R. An ABox A is a nite set of assertions A(a) or P (a; b), for A 2 C,
P 2 R, and a; b 2 I. An E LHI-ontology is a set O = T [ A. DL-Lite is obtained
from E LHI by disallowing GCIs of the form 9R:A1 v A2 where A1 6= &gt;.1 We
call such GCIs RA-GCIs while all the rest DL-Lite-GCIs.</p>
      <p>Queries and Query Rewriting A datalog rule r is an expression of the form
H B1 ^ : : : ^ Bn where H, called head, is a (possibly empty) function-free
atom, fB1; : : : ; Bng, called body, is a set of function-free atoms, and each variable
in the head also occurs in the body. A variable that appears twice in the body
and not in the head is called ej-variable; we use ejvar(r) to denote all ej-variables
of r. A datalog program P is a nite set of datalog rules. A union of conjunctive
queries (UCQ) Q is a set of datalog rules such that their head atoms share the
same predicate, called query predicate, which does not appear anywhere in the
body. A conjunctive query (CQ) is a UCQ with exactly one rule. We often abuse
notation and identify a CQ with the only rule it contains instead of a singleton
set. For a query Q with query predicate Q, a tuple of constants ~a is an answer
of Q w.r.t. a TBox T and an ABox A if the arity of ~a agrees with the arity of Q
and T [ A [ Q j= Q(~a). We denote with cert(Q; T [ A) the answers to Q w.r.t.
T [ A. Finally, we recall the notion of (query) rewriting [3, 19, 21].
De nition 1. Let Q be a CQ with query predicate Q and let T be a TBox.
A datalog rewriting (or simply rewriting) R of a CQ Q w.r.t. T is a datalog
program whose rules can be partitioned into two disjoint sets, RD and RQ such
that RD does not mention Q, RQ is a UCQ with query predicate Q, and where
1 In the literature, this DL is called DL-LiteR;u [4], however, for simplicity we call
it DL-Lite. Typically, DL-Lite also allows for axioms of the form A1 v :A2 and
R1 v :R2, however, these do not have any e ects in query answering when T [ A
is consistent (see, e.g., [19]); hence we will discard them here.
for each A consistent w.r.t. T and using only predicates from T we have:
cert(Q; T [ A) = cert(RQ; RD [ A):
The Requiem System Throughout the paper we will use the inference system
implemented by Requiem as a yardstick, to highlight the ine ciencies of typical
resolution-based rewriting algorithms and sketch completeness of the re ned
approach. Like most rewriting systems, the behaviour of Requiem on input Q
and T can be characterised by the application of the following three steps:
1. Clausi cation: the input TBox T is transformed into a set of clauses TC,
using standard techniques like skolemisation (see Example 1).
2. Saturation: TC [Q is saturated by using (binary) resolution with free selection
sat.</p>
      <p>[2] (denoted as IREQ) computing a new set TCsat are returned.
3. Post-processing : all function-free clauses in TC
Next, we brie y illustrate the Requiem calculus through an example.
Example 1. Consider the TBox T consisting of the following GCIs (left side),
together with the respective clauses produced at step 1. (right side):
A v 9R:B</p>
      <p>R v S</p>
      <p>R(x; f (x))
As can be seen, the rst GCI produces two clauses, where f is a skolem function
that is uniquely associated with the speci c occurence of concept 9R:B.</p>
      <p>
        Consider now the query Q1 = Q(x) S(x; y) ^ C(y). When applied to Q1
and T the Requiem algorithm would perform the following inferences:
(2a) and (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) produces S(x; f (x))
      </p>
      <p>
        A(x)
Q1 and (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) produces Q2 = Q(x)
      </p>
      <p>
        A(x) ^ C(f (x))
Finally, the function-free set returned is R = fQ1; (
        <xref ref-type="bibr" rid="ref3">3</xref>
        )g.
      </p>
      <p>Conventions To simplify the presentation, in the following we assume that
TBoxes are given in a clausal form. Clauses that are produced by clausfying
RAGCIs and DL-Lite-GCIs are called RA-clauses and DL-Lite-clauses, respectively.
Finally, clauses with the query predicate in the head are called Q-clauses ; note
that such clauses can contain functional terms in the body (e.g., clause Q2 in
Example 1).
3</p>
    </sec>
    <sec id="sec-3">
      <title>An Optimised Calculus for DL-Lite</title>
      <p>
        In the current section we present a hyper-resolution like rewriting algorithm
for DL-Lite, which characterises the algorithm implemented in Rapid using the
framework of resolution. In addition, we sketch its proof of correctness, which
implies correctness of Rapid; this is also important subsequently for E LHI.
Example 2. Consider the TBox T and query Q1 from Example 1 as well as the
inferences performed by IREQ on T [ Q1. As it can be observed the algorithm
performed two redundant inferences since neither clauses (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) and Q2 nor any
other clause derived from these is a member of the computed rewriting R.
      </p>
      <p>
        These clauses would be of importance only if a clause of the form C(x)
B(x) also existed in T . Then, the latter would resolve with (2b) producing
C(f (x)) A(x) which would subsequently resolve with Q2 to produce Q(x)
A(x), that would be part of R. }
As it has been argued in [22], TBoxes typically contain many clauses of the
form R(x; fi(x)) Ai(x). Together with clause (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) this implies that the
algorithm would produce many clauses of the form S(x; fi(x)) Ai(u) and
Q(x) A(x) ^ C(fi(x)) which can adversely a ect performance.
      </p>
      <p>
        One could try to remedy the above issue by applying the following
approach/re nement on IREQ: rst, saturate the clauses of T obtaining Tsat and
then, resolve Q1 with (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) only if a clause of the form C(f (x)) A(x) also exists
in Tsat. If it does, then Q(x) A(x) can be obtained directly from Q1 as a
hyper-resolvent; if it doesn't, then we can avoid computing Q2. However, to
implement this hyper-resolution step the algorithm needs to perform a quadratic
loop over the set Tsat, which in practice can be very large. As we will show in
the next section this issue is even more acute in more expressive ontologies like
E LHI which allow for RA-clauses (see also discussion in [22]).
      </p>
      <p>
        Our inability to e ciently implement the above re nement is because IREQ
follows a \forward" style approach to apply resolution which generates new
clauses that contain function symbols (e.g., clause (
        <xref ref-type="bibr" rid="ref4">4</xref>
        )). In contrast Rapid is
based on a goal-oriented \backwards" style approach that resembles SLD
derivations. In the previous example, it will rst resolve Q1 with (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) to obtain Q02 =
Q(x) R(x; y) ^ C(y), while then, it will resolve Q02 with clause (2a) only if also
a clause of the form C(f (x)) A(x) exists in T . The crucial di erence is that,
in the latter case, to implement the hyper-resolution step we pick clauses from T
rather than Tsat. In addition to T being much smaller than Tsat, as explained in
Example 1, functional terms are unique per occurence of 9R:B, and this can be
exploited in practice using indexes over the functional terms. The next de nition
characterises the Rapid algorithms using the framework of resolution.
De nition 2. Let Q be a CQ, let C(i) be (not necessarily distinct) DL-Lite
clause(s) with head atom(s) C(i). With Ilite we denote the inference system that
consists of the following inference rules, where Q0 is a function-free
(hyper)resolvent of Q and C(i):
      </p>
      <p>Q
Q</p>
      <p>Q0</p>
      <p>C</p>
      <p>C1 C2
unfolding:</p>
      <p>s.t. if x 7! f (y) 2 ; then x 62 ejvar(Q)
shrinking:</p>
      <p>Q0
Finally, for Q a CQ and T a DL-Lite-TBox let Rapid-Lite(Q; T ) be all
functionfree clauses derivable from Q [ T by Ilite.
Intuitively, unfolding corresponds to all classical binary resolution inferences that
won't introduce function symbols in Q, while shrinking is a hyper-resolution step
which \eliminates" an ej-variable of Q using clauses that mention a functional
term f .</p>
      <p>Example 3. Consider T and Q1 from Example 1 and consider also the TBox
T 0 = fC(x) B(x)g [ T . Applying Ilite to T [ Q1 performs the following
inferences:</p>
      <p>
        unfolding on Q1 and (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) produces Q02 = Q(x)
unfolding on Q02 and C(x)
      </p>
      <p>B(x) produces Q03 = Q(x)
shrinking on Q03; (2a); and (2b) produces Q4 = Q(x)
R(x; y) ^ C(y)
R(x; y) ^ B(y)
A(x)
The set R0 = fQ1; Q02; Q03; Q4g is a rewriting of Q1 w.r.t. T .
}
Correctness of our rewriting algorithm follows by showing how a derivation
constructed by IREQ can be transformed into a derivation by Ilite; hence, saturating
T [ Q by Ilite will create all necessary members of a rewriting. This is done in
two steps. First, we show that each Requiem derivation can be transformed into
an SLD derivation.</p>
      <p>Lemma 1. Let T be a DL-Lite-TBox and let Q be a CQ with query predicate
Q. Every Q-clause Q0 derivable from T [ Q by IREQ is also derivable from T [ Q
by ISLD.</p>
      <p>The Lemma is proven by showing how to \unfold" a Requiem inference Q; C ` Q0
where T `i C into Q; C1 ` Q00; Q00; C2 ` Q0 where T `i 1 C1; T `i 1 C2 and
C1; C2 ` C. By repeated application of this unfolding we will eventually (fully)
unfold any derivation of a Q-clause Q0 into inferences of the form Q; C1 `
Q1; : : : ; Qn 1; Cn ` Q0, where Ci 2 T , i.e., into an SLD derivation of Q0.</p>
      <p>Second, we show that each SLD derivation can be transformed into a
derivation by Ilite. By de nition of Ilite and Example 3 we can see that inferences using
the unfolding rule directly corresponds to one SLD inference, while shrinking
corresponds to many SLD inferences where, the main premise is a function-free CQ,
the side premises contain the same function symbol f , and the conclusion is also
a function-free CQ. Hence, we need to show that each SLD derivation can be
transformed into one that satis es the following property.</p>
      <p>De nition 3. Let Q1; Q2; : : : ; Qn be an SLD derivation of Qn such that Qi; Ci `
Qi+1 for some clause Ci. Assume also that all Q2; : : : ; Qn 1 contain a term that
mentions a function symbol f while Q1 and Qn are function-free. We say that
the derivation is function compact if all side premises Ci with 1 i &lt; n used in
the derivation also mention f .</p>
      <p>The following can be shown for Horn clauses with one existential variable.
Lemma 2. Any SLD derivation can be transformed to a function compact one.</p>
      <p>Using Lemmas 1 and 2 we can show the following.</p>
      <p>Theorem 1. Let a DL-Lite-TBox T and a CQ Q. Every derivation from T [ Q
by Ilite terminates. Moreover, Rapid-Lite(Q; T ) is a rewriting of Q w.r.t. T .</p>
      <p>A Rewriting Algorithm for E LHI
In the current section we extend the inference system Ilite in order to provide a
(query) rewriting algorithm for E LHI ontologies.</p>
      <p>
        E LHI additionally allows for RA-clauses of the form E(x) R(x; y) ^ F (x).
According to the Requiem calculus this clause interacts with clause (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) of
Example 2 producing E(x) A(x) ^ F (f (x)). Again this inference is of interest
only if also a clause of the form F (f (x)) G(x) can be deduced and hence then
produce F (x) A(x) ^ G(x) which is function-free. As argued in [22] ontologies
typically have many clauses of these forms which can lead to a quadratic number
of redundant inferences.
      </p>
      <p>
        A straightforward approach to obtain an e cient calculus for E LHI
ontologies would be to extend De nition 2 to allow for arbitrary E LHI-clauses as side
premises in shrinking and unfolding. Then, Lemmas 1 and 2 apply with few
modi cations and hence this calculus would produce a rewriting.
Example 4. Let T be the E LHI-TBox consisting of the following clauses:
(
        <xref ref-type="bibr" rid="ref6">6</xref>
        ) and (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) produces C(f (x))
(
        <xref ref-type="bibr" rid="ref8">8</xref>
        ) and (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) produces K(x)
(
        <xref ref-type="bibr" rid="ref10">10</xref>
        ) and (
        <xref ref-type="bibr" rid="ref9">9</xref>
        ) produces K(x)
Q1 and (
        <xref ref-type="bibr" rid="ref11">11</xref>
        ) produces Q(x)
      </p>
      <p>B(x) ^ D(x)
B(x) ^ C(f (x))
B(x) ^ D(x)</p>
      <p>B(x) ^ D(x)</p>
      <p>B(x)
C(x)
K(x)</p>
      <p>S(x; y) ^ D(y)</p>
      <p>S(y; x) ^ C(y)
and let also the query Q1 = Q(x) K(x).</p>
      <p>
        By unfolding on Q1 and (
        <xref ref-type="bibr" rid="ref8">8</xref>
        ) we obtain Q2 = Q(x) S(y; x) ^ C(y); then,
by unfolding on Q2 and (
        <xref ref-type="bibr" rid="ref6">6</xref>
        ) we obtain Q3 = Q(x) S(y; x) ^ S(y; z) ^ D(z);
nally, by shrinking on Q3 and (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) we can obtain Q4 = Q(x) B(x) ^ D(x). It
can be veri ed that R = fQ1; Q2; Q3; Q4g is a rewriting of Q w.r.t. T }
However, as the previous example shows, unfolding using RA-clauses produces
clauses that contain more variables than the main premise and hence to variable
proliferation which implies termination problems. There are two solutions to this
issue. We either decide a bound on the number of times that such clauses can be
used as side premises or, like in Ilite, we still only allow DL-Lite-clauses as side
premises. But then, such a calculus would require additional inference rules in
order to be able to derive intermediate clauses that can then be side premises in
inferences. Next, we show how the Requiem calculus would behave when applied
to the input of Example 4 which motivates our E LHI calculus.
      </p>
      <p>
        Example 5. Consider the TBox T and query Q1 from Example 4. When applied
to T and Q1 the Requiem algorithm would perform the following inferences with
the respective conclusions:
(
        <xref ref-type="bibr" rid="ref6">6</xref>
        )
(
        <xref ref-type="bibr" rid="ref7">7</xref>
        )
(
        <xref ref-type="bibr" rid="ref8">8</xref>
        )
(
        <xref ref-type="bibr" rid="ref9">9</xref>
        )
(
        <xref ref-type="bibr" rid="ref10">10</xref>
        )
(
        <xref ref-type="bibr" rid="ref11">11</xref>
        )
(
        <xref ref-type="bibr" rid="ref12">12</xref>
        )
Ci:
n-shrinking:
      </p>
      <p>
        function:
The set R = fQ1; (
        <xref ref-type="bibr" rid="ref6">6</xref>
        ); (
        <xref ref-type="bibr" rid="ref8">8</xref>
        ); (
        <xref ref-type="bibr" rid="ref12">12</xref>
        )g is a (datalog) rewriting of Q1 w.r.t. T .
      </p>
      <p>
        First, we can observe that, if we extend shrinking to accept RA-clauses as
main premises, then the inferences performed to produce clause (
        <xref ref-type="bibr" rid="ref11">11</xref>
        ) from clause
(
        <xref ref-type="bibr" rid="ref8">8</xref>
        ) can be captured by a single shrinking inference over clause (
        <xref ref-type="bibr" rid="ref8">8</xref>
        ) with side
premises (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) and (
        <xref ref-type="bibr" rid="ref9">9</xref>
        ). However, we can observe that clause (
        <xref ref-type="bibr" rid="ref9">9</xref>
        ) is produced by
resolving together an RA-clause with a DL-Lite-clause and this cannot be captured
by any of the inferences of Ilite. }
Motivated by the above example, our caluclus for E LHI-ontologies consists of a
new inference rule which can infer clauses like clause (
        <xref ref-type="bibr" rid="ref9">9</xref>
        ), together with unfolding
and (an extension of) shrinking that permit as a main premise either a CQ or
an RA-clause (i.e., Ilite with main premise clauses that are non DL-Lite).
De nition 4. With IEL we denote the inference system consisting of
unfolding, where the main premise is either a CQ or an RA-clause, together with the
following inference rules, where is either a CQ or an RA-clause, for n 2
each Ci is a DL-Lite-clause, and 0 is a function-free hyper-resolvent of and
C1 : : : Cn
0
      </p>
      <p>
        First, note that we had to extend shrinking to accept possibly more that two side
premises. This is because due to the function rule we can now deduce new clauses
that contain function symbols; hence there can be more than two clauses
containing some function f , unlike the case in DL-Lite. In practice, however, we expect
that n is small since such clauses are only produced by the function rule and
only when there is a complex interaction between a clause containing R(x; f (x))
(R(f (x); x)) and an RA-clause containing the inverse R(y; x) (R(x; y)).
Example 6. Consider Example 5. The inference between clauses (
        <xref ref-type="bibr" rid="ref6">6</xref>
        ) and (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) that
produces clause (
        <xref ref-type="bibr" rid="ref9">9</xref>
        ) corresponds to an inference using the function rule. Then,
clause (
        <xref ref-type="bibr" rid="ref11">11</xref>
        ) can be produced by n-shrinking over (
        <xref ref-type="bibr" rid="ref8">8</xref>
        ) with side premises clauses
(
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) and (
        <xref ref-type="bibr" rid="ref9">9</xref>
        ), while (
        <xref ref-type="bibr" rid="ref12">12</xref>
        ) is produced by unfolding on Q and (
        <xref ref-type="bibr" rid="ref8">8</xref>
        ), hence computing
the required rewriting.
}
As mentioned in the previous section correctness of Rapid-Lite is heavily based
on showing that Requiem derivations can be unfolded into SLD derivations.
Consider now E LHI and an inference of the form ; C ` 0, where T `IREQ C.
If the derivation of C does not involve an RA-clause, then again we can fully
unfold into an SLD derivation, like in DL-Lite. If it does, then this inference can
be unfolded into ; C1 ` 2; : : : ; n 1; Cn ` 0 up to a certain level; i.e., for some
Ci we might have Ci 62 T with Ci derivable by some RA-clause. By inspecting
the types of inferences performed by IREQ using RA-clauses (cf. [18, Table 4])
we can see that we can unfold up to the point where Ci has one of the following
forms, where the notation [C(x)] means that C(x) can be omitted:
      </p>
      <p>
        A(x)
Again by inspection of IREQ we can see that clauses of form (
        <xref ref-type="bibr" rid="ref14">14</xref>
        ) can be
produced from RA-clauses by an inference which is exactly the one captured by
the function rule. The derivation of clauses of form (
        <xref ref-type="bibr" rid="ref13">13</xref>
        ) is more involved and is
characterised next.
      </p>
      <p>Lemma 3. Let P be a set of DL-Lite-clauses and let 1 be an RA-clause.
Consider also a derivation 1; : : : ; n by IREQ, such that i; Ci ` i+1 and Ci is
derivable from P by IREQ. Assume also that n is of the form A(x) B(x) ^ [C(x)]
while no i with i &lt; n is of the same form as n. Then, n can be derived from
P [ 1 by unfolding and n-shrinking.</p>
      <p>
        Using Lemma 3 and our observation regarding clauses of form (
        <xref ref-type="bibr" rid="ref14">14</xref>
        ) we can show
the following.
      </p>
      <p>Lemma 4. Let T be an ELHI-TBox and let Q be a CQ with query predicate
Q. Let also Plt be all DL-Lite-clauses derivable from T by IEL. Then, every
Q-clause Q0 derivable from T [ Q by IREQ is also derivable from Plt [ Q by ISLD.</p>
      <p>Finally, we can show the following.</p>
      <p>Theorem 2. Let an ELHI-TBox T and a CQ Q. Every derivation from T [ Q
by IEL terminates. Moreover, Rapid-EL(Q; T ) is a datalog rewriting of Q; T .
5</p>
    </sec>
    <sec id="sec-4">
      <title>Evaluation</title>
      <p>We have extended the Rapid2 query rewriting system [7] to support ELHI
ontologies. Rapid attempts to compactly represent many unfolding inferences as
datalog rules in an e ort to compute small (datalog) rewritings.</p>
      <p>We conducted an experimental evaluation comparing against Requiem [19],
Presto [21], and Clipper [8], using real-world large scale DL-Lite and ELHI
ontologies. Regarding DL-Lite, we used DL-Lite versions of the OpenGALEN2
(http://www.opengalen.org/), OBO protein (http://www.obofoundry.org/),
and NCI 3.12e (http://evs.nci.nih.gov/ftp1/NCI_Thesaurus) ontologies,
which we denote by Gd, Pd, and N, respectively. This part extends the
evaluation in [7] for large scale ontologies, and uses datalog rewritings instead of UCQs.
2 http://www.image.ece.ntua.gr/~achort/rapid.zip
Regarding E LHI, we used E LHI versions of the NASA SWEET 2.3 (http:
//sweet.jpl.nasa.gov/ontology/), periodic table (http://www.cs.man.ac.
uk/~stevensr/ontology/), OpenGALEN2, and OBO protein ontologies, which
we denote by S, C, Ge, and Pe, respectively. The DL-Lite and E LHI versions
of the ontologies where obtained by normalizing the ontologies and keeping the
appropriate subset of axioms. Table 1 provides statistics for the ontologies. For
each of them we manually constructed 5 test queries. All tests were performed
on a dual core 1.8GHz Intel Celeron processor laptop running Windows 8 and
JVM 1.7 with 3.6GB maximum heap size. The timeout limit was set to 2 hours.</p>
      <p>The results for DL-Lite are shown in the upper part of Table 2, which includes
the computation time and the size of the computed rewriting; \t=o" denotes
timeout. First, we observe that neither Presto nor Clipper managed to compute
a rewriting for Gd, Requiem required 9{18 minutes, while Rapid required only
milliseconds. Similar observations can be made for the rest of the DL-Lite
ontologies. Notable cases are queries 1{5 over N for Clipper, where it required about
13 minutes for each of them, query 5 over Pd and query 3 over N for Requiem,
for which it did not manage to compute a rewriting, and all queries over Pd and
N for Presto for which it required 1 to 2 hours, being in general much slower also
from Requiem and Clipper. Rapid was slower only for query 5 over Pd, where
it required 7:15 minutes. The analysis showed that 7:00 out of the 7:15 minutes
are spent in backwards subsumption checking (which guarantees a compact
result with no equivalent or subsumed queries), while the actual rewriting time is
only 15 seconds. Note that no other system performs backwards subsumption.
In fact, in this case e.g. Clipper returns several rewritings that are equivalent up
to variable renaming, which justi es also the di erence in the rewriting sizes.</p>
      <p>The results for E LHI are shown in the lower part of Table 2; we did not run
Presto since it does not support E LHI. Our conclusions are similar to those of
DL-Lite|that is, in the large scale ontologies Rapid greatly outperforms all other
systems while in query 5 of the E LHI version of the OBO protein ontology (Pe)
it performed worse than Clipper since it spent 13:27 out of the 13:52 minutes in
backwards subsumption. Note also that for Ge, Rapid was the only system that
managed to compute a rewriting within `reasonable' time (8{11 minutes).</p>
      <p>In summary, we can see that computing even some rewriting over large scale
and complex ontologies is still an unresolved issue as in many cases many
stateof-the-art systems did not manage to terminate, required several minutes, or
even hours. This could be acceptable if a rewriting is computed once for a xed
ontology, however, practice has shown that ontologies are very often dynamic [5,
11, 10]. Moreover, in design time, ontology engineers tend to run reasoners often
.08
.16
S .02
.05
.04
.06
.05
C .09
.08
.15
11:01.71
8:45.87
Ge 10:18.01
9:26.00
7:47.52
4.80
29.73
Pe 2.59</p>
      <p>15.71
13:51.97
requiring more than a couple of minutes might not be acceptable.
6</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusions</title>
      <p>We have presented an e cient resolution-based rewriting algorithm for E LHI .
Despite the complex interactions in E LHI we show that a calculus using
extensions of the unfolding and shrinking rules of Rapid for DL-Lite, plus a new rule
can be de ned. Our experimental evaluation shows that there are large scale
ontologies which existing systems cannot handle, while the new algorithm only
requires milliseconds. This is to a large extent due to the hyper-resolution
inference performed by shrinking, which avoids well-known ine ciencies of
resolutionbased rewriting algorithms [22].</p>
      <p>Concerning future work, we plan to investigate whether a similar
hyperresolution step can be used to optimise resolution-based rewriting algorithms
for non-Horn DLs like ALC, like those implemented in the KAON2 system [15].</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Andrea</given-names>
            <surname>Acciarri</surname>
          </string-name>
          , Diego Calvanese, Giuseppe De Giacomo, Domenico Lembo, Maurizio Lenzerini, Mattia Palmieri, and
          <string-name>
            <given-names>Riccardo</given-names>
            <surname>Rosati</surname>
          </string-name>
          . Quonto:
          <article-title>Querying ontologies</article-title>
          .
          <source>In AAAI</source>
          , pages
          <volume>1670</volume>
          {
          <fpage>1671</fpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Leo</given-names>
            <surname>Bachmair</surname>
          </string-name>
          and
          <string-name>
            <given-names>Harald</given-names>
            <surname>Ganzinger</surname>
          </string-name>
          .
          <article-title>Resolution theorem proving</article-title>
          .
          <source>In Handbook of Automated Reasoning</source>
          , pages
          <volume>19</volume>
          {
          <fpage>99</fpage>
          . Elsevier and MIT Press,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. Diego Calvanese, Giuseppe De Giacomo, Domenico Lembo, Maurizio Lenzerini, and
          <string-name>
            <given-names>Riccardo</given-names>
            <surname>Rosati</surname>
          </string-name>
          .
          <article-title>Tractable reasoning and e cient query answering in description logics: The DL-Lite family</article-title>
          .
          <source>J. of Automated Reasoning</source>
          ,
          <volume>39</volume>
          (
          <issue>3</issue>
          ):
          <volume>385</volume>
          {
          <fpage>429</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. Diego Calvanese, Giuseppe De Giacomo, Domenico Lembo, Maurizio Lenzerini, and
          <string-name>
            <given-names>Riccardo</given-names>
            <surname>Rosati</surname>
          </string-name>
          .
          <article-title>Data complexity of query answering in description logics</article-title>
          .
          <source>Arti cial Intelligence</source>
          ,
          <volume>195</volume>
          :
          <fpage>335</fpage>
          {
          <fpage>360</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. Diego Calvanese, Evgeny Kharlamov, Werner Nutt, and
          <string-name>
            <given-names>Dmitriy</given-names>
            <surname>Zheleznyakov</surname>
          </string-name>
          .
          <article-title>Evolution of dl-lite knowledge bases</article-title>
          .
          <source>In International Semantic Web Conference (1)</source>
          , pages
          <fpage>112</fpage>
          {
          <fpage>128</fpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Chin-Liang Chang</surname>
            and
            <given-names>Richard C. T.</given-names>
          </string-name>
          <string-name>
            <surname>Lee</surname>
          </string-name>
          .
          <article-title>Symbolic logic and mechanical theorem proving</article-title>
          . Computer science classics. Academic Press,
          <year>1973</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>A.</given-names>
            <surname>Chortaras</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Trivela</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G.</given-names>
            <surname>Stamou</surname>
          </string-name>
          .
          <article-title>Optimized query rewriting in OWL 2 QL</article-title>
          .
          <source>In Proc. of CADE 23</source>
          , pages
          <fpage>192</fpage>
          {
          <fpage>206</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <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 AAAI</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9. Christian G Fermuller, Alexander Leitsch, Ullrich Hustadt, and
          <string-name>
            <given-names>Tanel</given-names>
            <surname>Tammet</surname>
          </string-name>
          .
          <article-title>Resolution decision procedures</article-title>
          .
          <source>In Handbook of Automated Reasoning</source>
          , pages
          <fpage>1791</fpage>
          {
          <year>1849</year>
          . Elsevier Science Publishers BV,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Giorgos</surname>
            <given-names>Flouris</given-names>
          </string-name>
          , Dimitris Manakanatas, Haridimos Kondylakis, Dimitris Plexousakis, and
          <string-name>
            <given-names>Grigoris</given-names>
            <surname>Antoniou</surname>
          </string-name>
          .
          <article-title>Ontology change: classi cation and survey</article-title>
          .
          <source>Knowledge Eng. Review</source>
          ,
          <volume>23</volume>
          (
          <issue>2</issue>
          ):
          <volume>117</volume>
          {
          <fpage>152</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Rafael</surname>
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Goncalves</surname>
            , Bijan Parsia, and
            <given-names>Ulrike</given-names>
          </string-name>
          <string-name>
            <surname>Sattler</surname>
          </string-name>
          .
          <article-title>Analysing the evolution of the nci thesaurus</article-title>
          .
          <source>In CBMS, pages 1{6</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Ullrich</surname>
            <given-names>Hustadt</given-names>
          </string-name>
          , Boris Motik, and
          <string-name>
            <given-names>Ulrike</given-names>
            <surname>Sattler</surname>
          </string-name>
          .
          <source>Deciding Expressive Description Logics in the Framework of Resolution. Information &amp; Computation</source>
          ,
          <volume>206</volume>
          (
          <issue>5</issue>
          ):
          <volume>579</volume>
          {
          <fpage>601</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <article-title>Ullrich Hustadt and Renate A Schmidt. Issues of decidability for description logics in the framework of resolution</article-title>
          .
          <source>In Automated Deduction in Classical and NonClassical Logics</source>
          , pages
          <volume>191</volume>
          {
          <fpage>205</fpage>
          . Springer,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Martha</surname>
            <given-names>Imprialou</given-names>
          </string-name>
          , Giorgos Stoilos, and Bernardo Cuenca Grau.
          <article-title>Benchmarking ontology-based query rewriting systems</article-title>
          .
          <source>In Proceedings of the Twenty-Sixth AAAI Conference on Arti cial Intelligence (AAAI</source>
          <year>2012</year>
          ). AAAI Press,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <given-names>Boris</given-names>
            <surname>Motik</surname>
          </string-name>
          .
          <article-title>Description Logics and Disjunctive Datalog|More Than just a Fleeting Resemblance?</article-title>
          <source>In Proc. of the 4th Workshop on Methods for Modalities (M4M4)</source>
          , volume
          <volume>194</volume>
          , pages
          <fpage>246</fpage>
          {
          <fpage>265</fpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Boris</surname>
            <given-names>Motik</given-names>
          </string-name>
          , Ulrike Sattler, and
          <string-name>
            <given-names>Rudi</given-names>
            <surname>Studer</surname>
          </string-name>
          .
          <article-title>Query answering for OWL-DL with rules</article-title>
          .
          <source>J. Web Sem</source>
          .,
          <volume>3</volume>
          (
          <issue>1</issue>
          ):
          <volume>41</volume>
          {
          <fpage>60</fpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <given-names>Giorgio</given-names>
            <surname>Orsi</surname>
          </string-name>
          and
          <string-name>
            <given-names>Andreas</given-names>
            <surname>Pieris</surname>
          </string-name>
          .
          <article-title>Optimizing query answering under ontological constraints</article-title>
          .
          <source>VLDB Endowment</source>
          ,
          <volume>4</volume>
          (
          <issue>11</issue>
          ):
          <volume>1004</volume>
          {
          <fpage>1015</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Hector</surname>
            Perez-Urbina,
            <given-names>Boris</given-names>
          </string-name>
          <string-name>
            <surname>Motik</surname>
            , and
            <given-names>Ian</given-names>
          </string-name>
          <string-name>
            <surname>Horrocks</surname>
          </string-name>
          .
          <article-title>Rewriting Conjunctive Queries under Description Logic Constraints</article-title>
          . In Andrea Cal`i, Georg Gottlob,
          <string-name>
            <surname>Laks</surname>
            <given-names>V.S.</given-names>
          </string-name>
          <string-name>
            <surname>Lakshmanan</surname>
          </string-name>
          , and Davide Martinenghi, editors,
          <source>Proc. of the Int. Workshop on Logic in Databases (LID</source>
          <year>2008</year>
          ), Rome, Italy, May
          <volume>19</volume>
          {
          <fpage>20</fpage>
          2008.
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Hector</surname>
            Perez-Urbina,
            <given-names>Boris</given-names>
          </string-name>
          <string-name>
            <surname>Motik</surname>
            , and
            <given-names>Ian</given-names>
          </string-name>
          <string-name>
            <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="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Mariano</surname>
          </string-name>
          Rodriguez-Muro and
          <article-title>Diego Calvanese. High performance query answering over DL-Lite ontologies</article-title>
          .
          <source>In KR</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <given-names>Riccardo</given-names>
            <surname>Rosati</surname>
          </string-name>
          and
          <string-name>
            <given-names>Alessandro</given-names>
            <surname>Almatelli</surname>
          </string-name>
          .
          <article-title>Improving query answering over DLLite ontologies</article-title>
          .
          <source>In Proc. of KR-10</source>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <surname>Frantisek</surname>
            <given-names>Simancik</given-names>
          </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 IJCAI</source>
          , pages
          <volume>1093</volume>
          {
          <fpage>1098</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Giorgos</surname>
            <given-names>Stoilos</given-names>
          </string-name>
          , Bernardo Cuenca Grau, Boris Motik, and
          <string-name>
            <given-names>Ian</given-names>
            <surname>Horrocks</surname>
          </string-name>
          .
          <article-title>Repairing ontologies for incomplete reasoners</article-title>
          .
          <source>In Proceedings of the 10th International Semantic Web Conference (ISWC-11)</source>
          , Bonn, Germany, pages
          <volume>681</volume>
          {
          <fpage>696</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Tassos</surname>
            <given-names>Venetis</given-names>
          </string-name>
          , Giorgos Stoilos, and
          <string-name>
            <given-names>Giorgos</given-names>
            <surname>Stamou</surname>
          </string-name>
          .
          <article-title>Query extensions and incremental query rewriting for OWL 2 QL ontologies</article-title>
          .
          <source>Journal on Data Semantics, Accepted</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>