<!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>Querying expressive DL Ontologies under the ICAR semantics</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="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vasilis Vassalos</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>: Athens University of Economics and Business</institution>
          ,
          <addr-line>Athens</addr-line>
          ,
          <country country="GR">Greece</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>: Babylon Health London</institution>
          ,
          <addr-line>SW3 3DD</addr-line>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Inconsistency-tolerant semantics, like the ICAR semantics, have been proposed to perform query answering over inconsistent DL knowledge bases. In the current paper we propose a general framework for ICAR-answering over arbitary Horn-DLs that is based on rewriting. We describe conditions for termination of our rewriting algorithm and show that existing techniques and results on UCQ-rewritability can be used to check if they are satis ed for a given input ontology and query.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Query answering over ontologies expressed in Description Logics (DL) has
recieved signi cant attention from both a practical and a theoretical perspective. In
the vast majority of works, the problem has been studied over datasets that are
consistent w.r.t. the ontology [
        <xref ref-type="bibr" rid="ref12 ref17 ref20 ref9">9, 17, 12, 20</xref>
        ]. However, in real-world applications
this is not always the case, e.g. in data integration applications the data deriving
from disparse sources may contradict the ontological axioms. A straightforward
approach to perform consistent query answering would be to rst remove the
con icting elements from the datasets. However, this is not always possible as
the data may be reside in distributed or access restricted data sources, or be
subject to frequent and diverse modi cations.
      </p>
      <p>
        To address this issue, inconsistency-tolerant semantics have been proposed
that describe which answers are meaningful to be returned in the presence of
inconsistent data. Examples of such semantics are the IAR, ICAR, AR
semantics [
        <xref ref-type="bibr" rid="ref14 ref15">15, 14</xref>
        ] that are based on the notion of the repair, that is a maximal (w.r.t.
inclusion) consistent subset of the original dataset. The IAR and ICAR semantics
have shown to have better computational properties since the query evaluation
problem over DL-Lite ontologies is in AC0 w.r.t. data complexity [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ], while it is
in coNP for the AR semantics. However, computing answers using
inconsistencytolerant semantics has been proved quite di cult for DLs more expressive than
DL-Lite. More precisely, Rosati [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] showed that the problem of IAR and
ICARanswering is at least coNP-hard w.r.t. data complexity for almost all well-known
DLs from E L? to SHIQ. Moreover, in the E L?nr fragment of E L? where query
answering is tractable for the IAR semantics, the problem remains in coNP
for the ICAR semantics. Consequently, important research results on consistent
query answering [
        <xref ref-type="bibr" rid="ref16 ref18 ref22 ref3 ref7">18, 7, 16, 3, 22</xref>
        ] focus on fragments of DL-Lite. However, in [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ]
a practical system was proposed for the ICAR and IAR semantics that
computes upper approximations for DLs more expressive than DL-Lite. Moreover,
an algorithm for IAR-answering was proposed in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] that can handle arbitary
DLs but need not terminate. Despite the work presented in [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ] the problem of
designing practical ICAR-answering algorithms for expressive DLs is open.
      </p>
      <p>
        In the current paper we extend our previous work of [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] and study
ICARanswering over expressive DL ontologies. More precisely, we present a general
framework for ICAR-answering that is based on query rewriting. Our rewriting
algorithm has as a starting point the one presented in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. Given an input query
and ontology expressed in a Horn-DL if our algorithm terminates, it computes
a datalog program, extended with negation, that can be evaluated over the
initial dataset to compute the ICAR-answers. Based on our analysis and previous
results [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] we describe the conditions that ensure termination of our algorithm.
The termination conditions are related to the notion of UCQ-rewritability that
has been studied quite extensively in DLs [
        <xref ref-type="bibr" rid="ref1 ref11 ref4">1, 4, 11</xref>
        ]. Consequently, we are able
to provide positive results for instance queries and ontologies expressed in
semiacyclic-E L? [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], as well as UCQ-rewritable queries over ontologies expressed
in E L?nr. For DLs and queries for which the termination conditions are not
generally satis ed, we exploit previous works [
        <xref ref-type="bibr" rid="ref11 ref6 ref8">6, 8, 11</xref>
        ] and provide an approach
to check termination over a xed input ontology and query. This allows us to
design a framework for ICAR-answering over expressive Horn-DLs. Finally, we
have conducted a preliminary evaluation of our approach. We obtained positive
results showing that it is possible to perform ICAR-answering even in the case
of DLs for which the problem is in general intractable.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>
        Description Logics A DL knowledge base (KB) K consists of a TBox T ,
and an ABox A, K = T [ A. T and A are constructed from the countable
and pairwise disjoint sets C, R, and I of atomic concepts (unary predicates),
atomic roles (binary predicates), and individuals (constants). An ABox A is a
nite set of assertions of the form A(a) or R(a; b) where a; b 2 I. A TBox T
is a set of DL axioms. An E L? concept is inductively de ned by the syntax:
C := &gt; j ? j A j C1 u C2 j 9R:C, where A 2 C and R 2 R and C(i) are E L?
concepts. An E L? TBox T is a nite set of inclusions of the form C1 v C2
with C1; C2 E L? concepts. Inclusions of the form C1 u C2 v ? (also written
as C1 v :C2) are called negative and the rest positive. DL-LiteR (or simply
DL-Lite) restricts E L? by allowing concepts of the form A, and 9R:&gt;; R in
DLLite can also be the inverse of a role of the form S and we can also have role
inclusions of the form S v R or S v :R for S; R roles. An ABox A is consistent
w.r.t. some TBox T if there exists a model for the KB K = T [ A; otherwise it
is inconsistent. The semantics of DLs can be given by a well-known translation
to First-Order Logic (FOL) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Table 1 presents the translation of E L? and
DL-Lite axioms to rst order clauses (inverse roles have been omitted). In the
following we assume that the TBox axioms are translated into FOL.
Datalog and Conjunctive Queries A disjunctive datalog clause r (also called
rule) is a function-free clause of the form 8~x; ~y( (~x) (~x; ~y)) where (~x; ~y) is a
conjunction of positive or negative atoms called the body of the clause and (~x) is
a disjunction of positive atoms called its head. For simplicity we will omit variable
quanti ers and write (~x) (~x; ~y). A datalog clause is a disjunctive datalog
clause where the head contains a single atom. A Horn-clause is a datalog clause
where the body contains only positive atoms. A (disjunctive) datalog program
P is a nite set of (disjunctive) datalog clauses. We consider Herbrand models
over all constants from P. We say that a model M of P is minimal if there is
no model M0 of P such that M0 is a subset of M. A positive ground atom D(~a)
is entailed by P i all minimal models of P contain D(~a); a negative ground
atom :D(~a) is entailed by P i D(~a) is not icluded in the minimal models of P.
The evaluation of P over an ABox A is the set of ground atoms entailed by the
program P [ A.
      </p>
      <p>A conjunctive query (CQ) Q is a datalog clause with head predicate Q. The
variables occuring in Q are called answer variables. A boolean query Q is a CQ
with no answer variables. An instance query is a CQ of the form Q(x) A(x)
(we often simply write A(x)). A UCQ is a nite set of CQs. A tuple of constants
~a is a certain answer of Q over a KB K = T [ A if the arity of ~a agrees with the
arity of Q and T [ A j= Q(~a), where Q(~a) denotes the boolean query obtained
by replacing the answer variables with ~a. We use cert(Q; T [ A) to denote all
certain answers of Q w.r.t. K = T [ A.</p>
      <p>De nition 1. Let T be a TBox and Q a CQ. A datalog-rewriting (or simply
rewriting) of Q w.r.t. T is a datalog program R such that for any ABox A
consistent w.r.t. T we have T [ A j= Q(~a) i R [ A j= Q(~a), or in case Q is
boolean T [ A j= Q i R [ A j= Q. We say that a query Q is datalog-rewritable
w.r.t. T if there exists a datalog-rewriting R of Q w.r.t. T ; if R is a UCQ, then
Q is called UCQ-rewritable w.r.t. T .</p>
      <p>
        Note that we will refer to a clause of the form H(~s) Vi i ^ Vj :Bj , where
i are positive atoms and Bj are conjunctions of positive atoms, as a datalog
clause. Indeed such a clause is equisatis able to a datalog program that inlcudes
H(~s) Vi i ^ Vj : j and j Bj , for all j, where j are positive atoms.
Inconsistency-tolerant Semantics De nitions 2 and 3 recapitulate some of
the notions used in the IAR and ICAR semantics [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. De ntion 4 formalises the
notion of the rewriting under the IAR and ICAR semantics.
      </p>
      <p>De nition 2. Consider a TBox T and ABox A we de ne the consistent logical
consequences of T ; A as the set clc(T ; A) = fa j some S A exists s.t. T [S j=
a and S is consistent w.r.t. T g, where we use a to denote an assertion.
De nition 3. A repair of a set of assertions S w.r.t. a TBox T is any maximal
(w.r.t. set inclusion) subset of S that is consistent w.r.t. T .</p>
      <p>{ We use Air to denote the intersection of all repairs of A w.r.t. T . Let Q be
a CQ and let K = T [ A be a KB. A tuple of constants ~a is called an
IARanswer of Q over K if ~a 2 cert(Q; T [ Air). We use certir(Q; T [ A) to denote
the set of all IAR-answers of Q over K and we also write T [ A j=ir Q(~a).
{ We use Aicar to denote the intersection of all repairs of clc(T ; A). Let Q be
a CQ and let K = T [ A be a KB. A tuple of constants ~a is called a
ICARanswer of Q over K if ~a 2 cert(Q; T [ Aicar). We use certicar(Q; T [ A) to
denote the set of all ICAR-answers of Q over K and we also write T [A j=icar
Q(~a).</p>
      <p>De nition 4. Given a TBox and a CQ Q, an IAR-rewriting Rir of Q w.r.t. T
is a datalog program such that for every ABox A we have T [ A j=ir Q(~a) i
Rir [ A j= Q(~a). Similarly, for an ICAR-rewriting Ricr we have T [ A j=icr Q(~a)
i Ricr [ A j= Q(~a).
3</p>
    </sec>
    <sec id="sec-3">
      <title>Towards an ICAR-answering algorithm</title>
      <p>
        The problem of answering queries under the ICAR semantics was rst
investigated in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] where a rewriting approach was presented for DL-Lite. Given an
input TBox and query, the proposed algorithm computes a rewriting of the query
that can be evaluated over any ABox to obtain the ICAR-answers. Example 1
illustrates the approach of [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ].
      </p>
      <p>Example 1. Let T be the DL-Lite TBox T = fC(x) A(x); ? A(x) ^ B(x)g,
Q the query Q = Q(x) C(x) and A the ABox A = fA(a); B(a)g. A has
two repairs, that is fA(a)g and fB(a)g, and hence Air = ;. It is not hard to
verify that clc(T ; A) = fC(a); A(a); B(a)g. Moreover, clc(T ; A) has two repairs,
that is fA(a); C(a)g and fB(a); C(a)g and hence Aicar = fC(a)g. Therefore,
cert(Q; T [ Aicar) = fag and by de nition of the ICAR-answers it holds that
certicar(Q; T [ A) = f g</p>
      <p>a .</p>
      <p>
        In the rst step, the algorithm in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] computes the rewriting R of Q; T
under the standard semantics, R = fQ(x) C(x); Q(x) A(x)g. Then, it
extends the queries in R with the appropriate negative atoms, R0 = fQ(x)
C(x); Q(x) A(x) ^ :B(x)g. The negative atoms in R0 guarantee that the
evaluation of R0 over A will only return answers from Air. Indeed, atom :B(x)
prevents Q(x) A(x) ^ :B(x) from binding with A(a) which is not included
in Air. At next step, the algorithm applies the rewriting procedure (under the
standard semantics) once more on the elements of R0 (only on the positive atoms)
to obtain R00 = R0 [ fQ(x) A(x)g that captures the assertions in clc(T ; A).
When Q(x) A(x) of R00 is evaluated over A we obtain the ICAR-answer fag,
cert(R00; A) = certicar(Q; T [ A). }
      </p>
      <p>
        A hybrid approach for ICAR-answering was presented in [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ] that employs
a rewriting, as well as an ABox saturation procedure. More precisely, given
an input query Q, a TBox T , and an ABox A, the algorithm in [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ] exploits
existing approaches [
        <xref ref-type="bibr" rid="ref13 ref19">13, 19</xref>
        ] to compute the saturated ABox, that is the set of
the assertions entailed from A and the axioms of T that can be translated into
datalog. Then, it evaluates the IAR-rewriting of Q; T over the saturated A. The
algorithm supports DL-Lite and it can be used to compute upper approximations
of the ICAR-answers for more expressive DLs.
      </p>
      <p>Example 2. Consider the following EL? TBox T , the query Q = Q(x)
and the ABox A = fA(a); B(a)g.</p>
      <p>C(x)
T = f C(x)</p>
      <p>K(x)</p>
      <p>A(x) ^ K(x)</p>
      <p>B(x)
?</p>
      <p>A(x) ^ B(x)g
It is not hard to verify that clc(T ; A) = fA(a); B(a); K(a)g and that Aicar =
fK(a)g. Hence, certicar(Q; T [ A) = ;.</p>
      <p>
        By applying the technique of [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ] we rst compute the saturation of A,
As = fC(a); A(a); B(a); K(a)g and the IAR-rewriting, Rir = fQ(x) C(x);
Q(x) A(x) ^ K(x) ^ :B(x); Q(x) A(x) ^ B(x) ^ :B(x)g. When we evaluate
Q(x) C(x) of Rir over As we yield fag which is not an ICAR-answer. Notice
that the saturated ABox As is an upper approximation of clc(T ; A). }
      </p>
      <p>
        ICAR-answering over DL-Lite is FO-rewritable, and therefore in AC0 in data
complexity. However, it was shown that for more expressive DLs, consistent
query answering under the ICAR is no longer tractable; actually, it is already
coNP-hard in data complexity in EL?nr [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ]. Identifying DLs for which
ICARanswering is tractable is quite challenging. It was shown by Rosati [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] that
tractability of IAR-answering does not imply tractability of ICAR-answering
and the reason is the need to compute clc. Despite the theoretical studies over
the ICAR semantics [
        <xref ref-type="bibr" rid="ref15 ref18">15, 18</xref>
        ], there are no algorithms for ICAR-answering over
expressive DLs. In the following example we attempt to employ the rewriting
approach presented in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] for an input TBox expressed in EL?.
Example 3. Consider the TBox T and query Q of Example 2. In the rst step,
we compute the IAR-rewriting of Q; T . For this purpose, we apply the
IARrewriting algorithm presented in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] that takes as input an arbitary DL TBox.
      </p>
      <p>Rir = f Q(x)</p>
      <p>C(x)
Q(x)
Q(x)</p>
      <p>A(x) ^ K(x) ^ :(A(x) ^ B(x))
A(x) ^ B(x) ^ :(A(x) ^ B(x))g
(1)
(2)
Finally, we construct the set R0 = Rir [ f(4); (5)g.</p>
      <p>Notice that when Q(x) A(x) ^ B(x) of R0 is evaluated over A we obtain
Q(a), but fag is not in certicar(Q; T ; A); hence R0 is not an ICAR-rewriting.</p>
      <p>In order to x this issue, one could check if the clause ? A(x) ^ B(x)
is entailed from T to decide whether Q(x) A(x) ^ B(x) is included in the
ICAR-rewriting. In particular, since T j= ? A(x) ^ B(x), any set of the form
fA(a); B(a)g is inconsistent w.r.t. T , and hence it cannot be used to infer an
assertion included in clc(T ; A). Consequently, the clause Q(x) A(x) ^ B(x)
that bounds to assertions of the form fA(a); B(a)g cannot be used to yield
an ICAR-answer. In the same spirit, the clause Q(x) A(x) ^ K(x) should be
included in the output ICAR-rewriting since it holds that T 6j= ? A(x)^K(x).
By eliminating (5) from R0 we obtain the ICAR-rewriting Ricr = Rir [ f(4)g. }
Example 4. Consider the following TBox T , query Q(x)
A = fR(a; b); K(b); R(b; a)g.</p>
      <p>
        A(x) and ABox
Next, by following the same approach as in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], we apply a rewriting procedure
on the elements of Rir ingoring their negative part (we omit clause (3)):
(4)
(5)
(6)
(7)
(8)
(9)
(10)
T = f A(x)
      </p>
      <p>A(x)</p>
      <p>R(x; y) ^ K(y)</p>
      <p>R(x; y) ^ A(y)
?</p>
      <p>
        K(x) ^ R(x; y)g
We rst compute the IAR-rewriting of Q w.r.t. T by applying the calculus of
[
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]:
      </p>
      <p>Rir = f Q(x)</p>
      <p>A(x)
A(x)
A(x)</p>
      <p>R(x; y) ^ A(y) ^ :(R(x; y) ^ K(x))g
R(x; y) ^ K(y) ^ :(R(x; y) ^ K(x)) ^ :(R(y; z) ^ K(y))(11)
(12)
Next, we apply a rewriting procedure on the elements of Rir:
In line with the Example 4 notice that for the clauses (7),(8) in R0 it holds
that T 6j= ? R(x; y) ^ K(y), T 6j= ? R(x; y) ^ A(y). However, R0 =
Rir [ f(7); (8)g is not an ICAR-rewriting. Indeed, when we evaluate (7) over A
we obtain A(a) and because of (8) we derive A(b). However, b is not an
ICARanswer since A(b) 2= clc(T ; A). This is because to derive A(b) we have used
fR(a; b); K(b); R(b; a)g which is inconsistent w.r.t. T . }</p>
      <p>
        As illustrated in Example 4 in order to introduce a recursive clause of the
form A(x) R(x; y) ^ A(y) in the ICAR-rewriting it is not su cient to examine
if T 6j= ? R(x; y) ^ A(y); since the concept A participates in a recursion, there
is an in nite number of negative clauses for which we should examine if they are
entailed from T . Intuitively, this is the reason for the co-NP data complexity [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ]
of the ICAR-answering problem: if the input query contains concepts involved
in some recursion (such as concept A in our example), then the number of ABox
assertions that can be used to infer an assertion in clc(T ; A) is unbounded.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>ICAR-rewriting over expressive DLs</title>
      <p>
        Based on the ideas presented in Section 3 we propose an algorithm for
ICARrewriting over a TBox expressed in an arbitary DL. De nition 5 describes the
notion of the negative closure that was used in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] to obtain the IAR-rewriting.
Intuitively, the negative closure Tcn of a TBox T is a nite set of negative clauses
that can capture the negative clauses entailed from T . We use Tcn to examine
if the condition described in Example 3 holds.
      </p>
      <p>De nition 5. A negative closure of a TBox T , denoted by Tcn, is a nite set
of negative clauses such that T j= ? V i i some ? V i in Tcn exists
with ? V i j= ? V i.</p>
      <p>Algorithm 1 ICAR-Rewriting</p>
      <p>Input: a CQ Q and a L-TBox T
1: Compute a negative closure Tcn of T
2: Compute the IAR-rewriting Rir of Q w.r.t. T .
3: Ricr := Rir
4: for H(~s) Vi i ^ Vj : j 2 Rir do
5: Compute a UCQ-rewriting R of Q(~s)
6: for each Q(~s) Vi i0 2 R do
7: if for every clause C 2 Tcn it holds C 6j= ?
8: Ricr = Ricr [ fH(~s) Vi 0i ^ Vj : jg
9: end if
10: end for
11: end for
12: return Ricr
Vi i w.r.t. T</p>
      <p>Vi 0i then</p>
      <p>
        Algorithm 1 computes the IAR-rewriting Rir (line (2)) by applying the
procedure presented in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]. Then, in order to build the set Ricr, it applies a rewriting
procedure on the elements of Rir by neglecting their negative part. More
precisely, for the positive body atoms i of every element in Rir, it constructs the
UCQ-rewriting of the query Q(~s) Vi i (lines (4)-(5)). Condition in line (7) is
necessary, as explained in Section 3, in order to only retrieve facts from clc(T ; A)
when evaluating Ricr over A.
      </p>
      <p>Example 5. Consider the following EL? TBox T and query Q(x)
In the rst step, Algorithm 1 computes the IAR-rewriting of Q:
Next, by considering the clauses (16), (17), (18) in Rir it computes the
UCQrewriting of Q(x) A(x), Q(x) R(x; y) ^ B(y), Q(x) R(x; y) ^ C(y):
(16)
(17)</p>
      <p>Q(x)
Q(x)
A(x)</p>
      <p>R(x; y) ^ B(y)
R(x; y) ^ C(y)</p>
      <p>
        R(x; y) ^ C(y) ^ :(B(y) ^ K(y))
The negative closure of T is Tcn = f? B(x) ^ K(x); ? C(x) ^ K(x)g.
Therefore, the clauses ? R(x; y) ^ B(y), and ? R(x; y) ^ C(y) are not
entailed by Tcn and condition in line (7) is satis ed. Finally, Algorithm 1 outputs
Ricr = Rir [ f(19); (20); (21)g that is an ICAR-rewriting of Q w.r.t. T . }
Theorem 1. Let T be a L TBox where L is a Horn-DL, and let Q be a CQ. If
Q is UCQ-rewritable w.r.t. T and there exists a negative closure Tcn of T , then
Algorithm 1 terminates and computes the ICAR-rewriting of Q w.r.t. T .
Proof. (sketch) In [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] it was shown that if there exists a negative closure of T ,
and Q is datalog rewritable, then there always exists an IAR-rewriting Rir of
Q w.r.t. T (Theorem 6). Therefore, if there exists a negative closure of T and
a UCQ-rewriting R of Q w.r.t. T , then there also exists an IAR-rewriting of Q
w.r.t. T , and Algorithm 1 terminates. To prove correctness of Algorithm 1 we
rst show that Ricr [ A j= Q(~a) i Rir [ clc(A) j= Q(~a). By de nition of Rir it
holds that Rir [ clc(A) j= Q(~a) i R [ clc(A) j=ir Q(~a). Finally, by de nition of
Aicar we conclude that Ricr [ A j= Q(~a) i R [ A j=icr Q(~a).
(13)
(14)
(15)
(16)
(17)
(18)
(19)
(20)
(21)
tu
5
      </p>
    </sec>
    <sec id="sec-5">
      <title>Positive Results for ICAR-answering</title>
      <p>In this section we exploit results on UCQ-rewritability of queries over a range
of DLs and the ICAR-rewriting approach presented in Section 4, to provide
positive results for ICAR-answering over Horn-DLs that do not fall into the
DL-Lite fragment.</p>
      <p>
        The authors in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] showed that instance queries over semi-acyclic-EL? TBoxes
are always UCQ-rewritable. Moreover, in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] it was shown that there always
exists a negative closure for a semi-acyclic-EL? TBox. Theorem 2 follows.
Theorem 2. Let T be a semi-acyclic-E L? TBox and let Q be an instance query.
Then, on input T and Q, Algorithm 1 terminates and computes an
ICARrewriting of Q w.r.t. T .
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] the E L?nr fragment of E L? was studied and in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] it was shown that
there always exists a negative closure of an E L?nr TBox. Therefore, although the
problem of ICAR-answering of CQs over E L?nr TBoxes is in general intractable,
for a given UCQ-rewritable CQ we obtain the following result.
      </p>
      <p>Theorem 3. Let T be a E L?nr TBox and let Q be a CQ that is UCQ-rewritable.
Then, on input T and Q Algorithm 1 terminates and computes an
ICARrewriting of Q w.r.t. T .</p>
      <p>
        To check if a given query is UCQ-rewritable we can exploit results in
UCQrewritability of queries over DLs that are not always UCQ-rewritable [
        <xref ref-type="bibr" rid="ref11 ref4 ref6">6, 4, 11</xref>
        ].
The authors in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] study UCQ-rewritability of a given instance query over
HornDLs, like E L?, E LI? and Horn-SHIF . These results were used to design a
practical algorithm for checking UCQ-rewritability of instance queries [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
Subsequently, the system of [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] was extended to support rooted CQs [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>
        Moreover, one can also check if a negative closure Tcn exists for a given
TBox, T , by using the condition presented in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]. This condition is described
in Lemma 1. Intuitively, the non-existence of Tcn is related to concepts in the
negative clauses of T that participate in some recursion.
      </p>
      <p>Lemma 1. Let T be a L TBox where L is a Horn-DL. Let the set of concepts
S = fAi(x) j ? A1(x) ^ : : : ^ Am(x) 2 T g. If every instance query Q(x)
Ai(x) in S is UCQ-rewritable w.r.t. T and consistent ABoxes, then there exists
a negative closure Tcn of T .</p>
      <p>
        Therefore, given an TBox T expressed in a Horn-DL one can decide on
the existence of a negative closure by using the system of [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] to check
UCQrewritability of all relevant instance queries described in Lemma 1. Moreover,
the system of [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] can be used to check UCQ-rewritability of the input query Q.
If the conditions of Theorem 1 are satis ed, Algorithm 1 can be used to obtain
an ICAR-rewriting of Q; T .
6
      </p>
    </sec>
    <sec id="sec-6">
      <title>Evaluation</title>
      <p>
        We have created a prototype system to perform a preliminary experimental
evaluation of the proposed framework. Our system is based on the implementation
of Algorithm 1. At rst step, the UCQ-rewritability of the input query Q is
examined by using the system Grind [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Next, our system uses the IAR-rewriting
framework implemented in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] to decide if there exists a negative closure of the
input TBox T and if so, to compute an IAR-rewriting of Q and T . If Q is not
UCQ-rewritable, or if a negative closure cannot be computed for T , then the
system reports that it cannot output an ICAR-rewriting. Otherwise, it proceeds
in computing the ICAR-rewriting Ricr as described in lines 3-10. The whole
system currently supports ontologies expressed in EL? which is the DL supported
by the current implementation of Grind.
      </p>
      <p>
        To generate our experimental setting we examined the ontologies ENVO,
FBbi, MOHSE, NBO, Not-Galen that were used in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] to evaluate Grind. We
did not consider SO as it was reported in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] that a negative closure cannot be
constructed for this ontology. The ontologies ENVO and FBbi include negative
axioms. For the rest ontologies, that is MOHSE and Not-Galen, we manually
added negative axioms. For this purpose we tried to use concepts that appear
in di erent levels in the concepts hierarchy, so that these a ect large or small
parts of the ontology. Each ontology used in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] came with 10 handcrafted
queries. Among them we used only those queries that include concepts involved
in some negative axiom and for which the Grind system reported they are
UCQrewritable. We have also manually constructed test queries that each one of
them contains at least one body atom that uses a concept or role involved in
a negative axiom. More precisely, for an axiom of the form B v :C we have
constructed queries Q(x) A(x) and Q(x) D(x) such that T j= A v B and
T j= B v D. Overall, for each ontology we used 10 test queries that satisfy the
UCQ-rewritability condition.
      </p>
      <p>Our results are depicted in Table 2. Columns tR, jRirj and q: present the
time to obtain the ICAR-rewriting in ms, the number of clauses in the output
rewriting, and the percentage of the clauses in the output that contain a negative
part. Finally columns max and avg present the maximum and average number
of negative atoms in the elements of the rewriting. In most cases the
ICARrewriting was obtained within a few seconds. In contrast, in the case of
NotGalen the time to compute the rewriting was up to 3 minutes. This is because,
the rewriting procedure (described in line 5, Algorithm 1) was applied on every
element of the IAR-rewriting which was quite large for almost all test queries.
One could avoid the several calls of the rewriting procedure and exploit the
rewritings that have already been constructed during the IAR-rewriting process.
For example, for an input TBox T = fA(x) A1(x); ? A(x) ^ B(x)g
and query Q = Q(x) A(x) ^ C(x) the IAR-rewriting is of the form Rir =
fQ(x) A(x) ^ C(x) ^ :(A(x) ^ B(x)) ^ :(A1(x) ^ B(x)); Q(x) A1(x) ^
C(x) ^ :(A1(x) ^ B(x))g and to obtain Rir the standard rewriting R = fQ(x)
A(x) ^ C(x); Q(x) A1(x) ^ C(x)g must be computed. Therefore, to construct
the ICAR-rewriting one could make use of R instead of applying anew rewriting
procedure on every element of Rir. Our implementation does not involve such
optimisations however we feel that they could reduce the rewriting times.</p>
      <p>Regarding the size of the output rewriting, one could design optimisations to
eliminate the redudant elements from the output, Ricr. For example, the clause
Q(x) A1(x) ^ C(x) ^ :(A(x) ^ B(x)) ^ :(A1(x) ^ B(x)) is subsumed by
Q(x) A1(x) ^ C(x) ^ :(A1(x) ^ B(x)) and hence the former can be discarded
from Ricr. Further work is required in that respect to reduce the size of Ricr.</p>
      <p>
        Finally, the number of negative conjuncts in the elements of the rewriting
was quite small (up to 50). Note that the evaluation in [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ] showed that
triplestore systems can handle a large number of negative atoms (even more than
one hundred). In conclusion, in most cases we have been able to obtain within
reasonable time an ICAR-rewriting for our test ontologies and queries.
      </p>
      <p>Summarizing, our evaluation results show that we were able, in most cases,
to compute an ICAR-rewriting for the given TBoxes for which the problem is
in general intractable. Moreover, computing the ICAR-rewriting can be done
relatively e ciently and the number of negative atoms added in the clauses was
usually quite small.
7</p>
    </sec>
    <sec id="sec-7">
      <title>Conclusions</title>
      <p>In this work we have provided a general framework for ICAR-answering for
arbitary Horn-DLs. We have presented an algorithm that takes as an input a
TBox and a query; if it terminates, it outputs a datalog program, that can be
used to compute the ICAR-answers. We described the termination condition
of our algorithm and showed that the tractability results hold for the
semiacyclic-EL?. Furthermore, in cases of inputs that do not satisfy the termination
condition in general, we can exploit recent results to check termination. Our
experiments provided encouraging results as in almost all cases we were able to
compute an ICAR-rewriting in reasonable time. Further experimental evaluation
to examine whether the conditions apply in practice is left for future work.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Alessandro</given-names>
            <surname>Artale</surname>
          </string-name>
          , Diego Calvanese, Roman Kontchakov, and
          <string-name>
            <given-names>Michael</given-names>
            <surname>Zakharyaschev</surname>
          </string-name>
          .
          <article-title>The DL-Lite Family and Relations</article-title>
          .
          <source>Journal of Arti cial Intelligence Research</source>
          ,
          <volume>36</volume>
          :1{
          <fpage>69</fpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Franz</given-names>
            <surname>Baader</surname>
          </string-name>
          , Deborah L.
          <string-name>
            <surname>McGuinness</surname>
          </string-name>
          ,
          <string-name>
            <surname>Daniele Nardi</surname>
          </string-name>
          , and
          <string-name>
            <surname>Peter F. PatelSchneider. The Description Logic</surname>
          </string-name>
          <article-title>Handbook: Theory, implementation and applications</article-title>
          . Cambridge University Press,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Meghyn</given-names>
            <surname>Bienvenu</surname>
          </string-name>
          , Camille Bourgaux, and
          <string-name>
            <given-names>Francois</given-names>
            <surname>Goasdoue</surname>
          </string-name>
          .
          <article-title>Querying Inconsistent Description Logic Knowledge Bases under Preferred Repair Semantics</article-title>
          .
          <source>In AAAI</source>
          , pages
          <volume>996</volume>
          {
          <fpage>1002</fpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Meghyn</given-names>
            <surname>Bienvenu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Peter</given-names>
            <surname>Hansen</surname>
          </string-name>
          , Carsten Lutz, and
          <string-name>
            <given-names>Frank</given-names>
            <surname>Wolter</surname>
          </string-name>
          .
          <article-title>First OrderRewritability and Containment of Conjunctive Queries in Horn Description Logics</article-title>
          .
          <source>In IJCAI: International Joint Conference on Arti cial Intelligence</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Meghyn</given-names>
            <surname>Bienvenu</surname>
          </string-name>
          , Carsten Lutz, and
          <string-name>
            <given-names>Frank</given-names>
            <surname>Wolter</surname>
          </string-name>
          .
          <article-title>Deciding FO-Rewritability in EL</article-title>
          .
          <source>In Proceedings of the Twenty-Fifth International Workshop on Description Logics</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Meghyn</given-names>
            <surname>Bienvenu</surname>
          </string-name>
          , Carsten Lutz, and
          <string-name>
            <given-names>Frank</given-names>
            <surname>Wolter</surname>
          </string-name>
          .
          <article-title>First-Order Rewritability of Atomic Queries in Horn Description Logics</article-title>
          .
          <source>In Proceeding of the Twenty-Third International Joint Conference on Arti cial Intelligence</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Meghyn</given-names>
            <surname>Bienvenu</surname>
          </string-name>
          and
          <string-name>
            <given-names>Riccardo</given-names>
            <surname>Rosati</surname>
          </string-name>
          .
          <article-title>New Inconsistency-Tolerant Semantics for Robust Ontology-Based Data Access</article-title>
          .
          <source>In Proceedings of the Twenty-Sixth International Workshop on Description Logics</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Meghyn</given-names>
            <surname>Bienvenu</surname>
          </string-name>
          , Balder ten Cate, Carsten Lutz, and Frank Wolter.
          <article-title>OntologyBased Data Access: A Study through Disjunctive Datalog, CSP, and MMSNP</article-title>
          .
          <source>ACM Transactions on Database Systems</source>
          ,
          <volume>39</volume>
          (
          <issue>4</issue>
          ):
          <volume>33</volume>
          :1{
          <fpage>33</fpage>
          :
          <fpage>44</fpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9. 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>Journal of Automated Reasoning</source>
          ,
          <volume>39</volume>
          (
          <issue>3</issue>
          ):
          <volume>385</volume>
          {
          <fpage>429</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>Peter</given-names>
            <surname>Hansen</surname>
          </string-name>
          and
          <string-name>
            <given-names>Carsten</given-names>
            <surname>Lutz</surname>
          </string-name>
          .
          <article-title>Computing FO-Rewritings in EL in Practice: From Atomic to Conjunctive Queries</article-title>
          .
          <source>In The Semantic Web - ISWC 2017 - 16th International Semantic Web Conference</source>
          , Vienna, Austria,
          <source>October 21-25</source>
          ,
          <year>2017</year>
          , Proceedings,
          <string-name>
            <surname>Part</surname>
            <given-names>I</given-names>
          </string-name>
          , pages
          <volume>347</volume>
          {
          <fpage>363</fpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Peter</surname>
            <given-names>Hansen</given-names>
          </string-name>
          , Carsten Lutz, Inanc Seylan, and
          <string-name>
            <given-names>Frank</given-names>
            <surname>Wolter</surname>
          </string-name>
          .
          <article-title>E cient Query Rewriting in the Description Logic EL and Beyond</article-title>
          .
          <source>In Proceedings of the TwentyFourth International Joint Conference on Arti cial Intelligence</source>
          , pages
          <fpage>3034</fpage>
          {
          <fpage>3040</fpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Stanislav</surname>
            <given-names>Kikot</given-names>
          </string-name>
          , Roman Kontchakov, and
          <string-name>
            <given-names>Michael</given-names>
            <surname>Zakharyaschev</surname>
          </string-name>
          .
          <article-title>Conjunctive Query Answering with OWL 2 QL</article-title>
          .
          <source>In Proceedings of the Thirteenth International Conference on Principles of Knowledge Representation and Reasoning</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Atanas</surname>
            <given-names>Kiryakov</given-names>
          </string-name>
          , Barry Bishoa, Damyan Ognyano , Ivan Peikov, Zdravko Tashev, and
          <string-name>
            <given-names>Ruslan</given-names>
            <surname>Velkov</surname>
          </string-name>
          .
          <article-title>The features of bigowlim that enabled the bbcs world cup website</article-title>
          .
          <source>In Workshop on Semantic Data Management (SemData)</source>
          , pages
          <fpage>13</fpage>
          {
          <fpage>17</fpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Domenico</surname>
            <given-names>Lembo</given-names>
          </string-name>
          , Maurizio Lenzerini, Riccardo Rosati, Marco Ruzzi, and Domenico Fabio Savo.
          <article-title>Inconsistency-tolerant Semantics for Description Logics</article-title>
          .
          <source>In Proceedings of Fourth International Conference on Web Reasoning and Rule Systems</source>
          , pages
          <fpage>103</fpage>
          {
          <fpage>117</fpage>
          . Springer,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Domenico</surname>
            <given-names>Lembo</given-names>
          </string-name>
          , Maurizio Lenzerini, Riccardo Rosati, Marco Ruzzi, and Domenico Fabio Savo.
          <article-title>Query rewriting for inconsistent DL-Lite ontologies</article-title>
          .
          <source>In Proceedings of the Fifth International Conference on Web Reasoning and Rule Systems</source>
          , pages
          <fpage>155</fpage>
          {
          <fpage>169</fpage>
          . Springer,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Domenico</surname>
            <given-names>Lembo</given-names>
          </string-name>
          , Maurizio Lenzerini, Riccardo Rosati, Marco Ruzzi, and Domenico Fabio Savo.
          <article-title>Inconsistency-tolerant Query Answering in Ontology-Based Data Access</article-title>
          .
          <source>Journal of Web Semantics</source>
          ,
          <volume>33</volume>
          :3{
          <fpage>29</fpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <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="ref18">
        <mixed-citation>
          18.
          <string-name>
            <given-names>Riccardo</given-names>
            <surname>Rosati</surname>
          </string-name>
          .
          <article-title>On the Complexity of Dealing with Inconsistency in Description Logic Ontologies</article-title>
          .
          <source>In Proceedings of the Twenty-Second International Joint Conference on Arti cial Intelligence</source>
          , pages
          <fpage>1057</fpage>
          {
          <fpage>1062</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <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</source>
          , Bonn, Germany, pages
          <volume>681</volume>
          {
          <fpage>696</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Despoina</surname>
            <given-names>Trivela</given-names>
          </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>
          ,
          <volume>33</volume>
          :
          <fpage>30</fpage>
          {
          <fpage>49</fpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <surname>Despoina</surname>
            <given-names>Trivela</given-names>
          </string-name>
          , Giorgos Stoilos, and
          <string-name>
            <given-names>Vasilis</given-names>
            <surname>Vassalos</surname>
          </string-name>
          .
          <article-title>A Framework and Positive Results for IAR-answering</article-title>
          .
          <source>In Proceedings of the Thirty-Second AAAI Conference on Arti cial Intelligence</source>
          , New Orleans, Louisiana, USA, February 2-
          <issue>7</issue>
          ,
          <year>2018</year>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <surname>Eleni</surname>
            <given-names>Tsalapati</given-names>
          </string-name>
          , Giorgos Stoilos, Giorgos B.
          <string-name>
            <surname>Stamou</surname>
            , and
            <given-names>George</given-names>
          </string-name>
          <string-name>
            <surname>Koletsos</surname>
          </string-name>
          .
          <article-title>E cient Query Answering over Expressive Inconsistent Description Logics</article-title>
          .
          <source>In Proceedings of the Twenty-Fifth International Joint Conference on Arti cial Intelligence</source>
          , pages
          <fpage>1279</fpage>
          {
          <fpage>1285</fpage>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>