<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Query Rewriting under Extensional Constraints in DL-Lite</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>DIAG, Sapienza Università di Roma</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        The DL-Lite family of description logics [
        <xref ref-type="bibr" rid="ref2 ref4">4, 2</xref>
        ] is currently one of the most studied
ontology specification languages. DL-Lite constitutes the basis of the OWL2 QL language
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], which is part of the standard W3C OWL2 ontology specification language. The
distinguishing feature of DL-Lite is to identify ontology languages in which expressive
queries, in particular, unions of conjunctive queries (UCQs), over the ontology can be
efficiently answered. Therefore, query answering is the most studied reasoning task in
DL-Lite (see, e.g., [
        <xref ref-type="bibr" rid="ref11 ref16 ref18 ref5 ref6 ref7 ref8">16, 11, 8, 18, 7, 6, 5</xref>
        ]).
      </p>
      <p>The most common approach to query answering in DL-Lite is through query
rewriting. This approach consists of computing a so-called perfect rewriting of the query with
respect to a TBox: the perfect rewriting of a query q for a TBox T is a query q0 that
can be evaluated on the ABox only and produces the same results as if q were evaluated
on both the TBox and the ABox. This approach is particularly interesting in DL-Lite,
because, for every UCQ q, query q0 can be expressed in first-order logic (i.e., SQL),
therefore query answering can be delegated to a relational DBMS, since it can be
reduced to the evaluation of an SQL query on the database storing the ABox.</p>
      <p>
        The shortcoming of the query rewriting approach is that the size of the rewritten
query may be exponential with respect to the size of the original query. In particular,
this is true when the rewritten query is in disjunctive normal form, i.e., is an UCQ. On
the other hand, [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] shows the existence of polynomial perfect rewritings of the query in
nonrecursive datalog.
      </p>
      <p>However, it turns out that the disjunctive normal form is necessary for practical
applications of the query rewriting technique, since queries of more complex forms,
once translated in SQL, produce queries with nested subexpressions that, in general,
cannot be evaluated efficiently by current DBMSs. So, while in some cases resorting to
more compact and structurally more complex perfect rewritings may be convenient, in
general this strategy does not solve the problem of arriving at an SQL expression that
can be effectively evaluated on the database.</p>
      <p>
        In this scenario, a very interesting way to limit the size of the rewritten UCQ has
been presented in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. This approach proposes the use of the so-called ABox
dependencies to optimize query rewriting in DL-LiteA. ABox dependencies are inclusions
between concepts and roles which are interpreted as integrity constraints over the ABox:
in other words, the ABox is guaranteed to satisfy such constraints. For this reason, in
this paper we also call ABox dependencies extensional constraints. In the presence of
such constraints, the query answering process can be optimized, since this additional
knowledge about the extensions of concepts and roles in the ABox can be exploited for
optimizing query answering. Intuitively, the presence of ABox dependencies acts in a
complementary way with respect to TBox assertions: while the latter complicate query
rewriting, the former simplify it, since they state that some of the TBox assertions are
already satisfied by the ABox.
      </p>
      <p>
        As explained in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], ABox dependencies have a real practical interest, since they
naturally arise in many applications of ontologies, and in particular in ontology-based
data access (OBDA) applications, in which a DL ontology acts as a virtual global
schema for accessing data stored in external sources, and such sources are connected
through declarative mappings to the global ontology. It turns out that, in practical cases,
many ABox dependencies may be (automatically) derived from the mappings between
the ontology and the data sources.
      </p>
      <p>
        In this paper, we present an approach that follows the ideas of [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. More
specifically, we present Prexto, an algorithm for computing a perfect rewriting of a UCQ
in the description logic DL-LiteA. Prexto is based on the query rewriting algorithm
Presto [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]: with respect to the previous technique, Prexto has been designed to fully
exploit the presence of extensional constraints to optimize the size of the rewriting;
moreover, differently from Presto, it also uses concept and role disjointness assertions,
as well as role functionality assertions, to reduce the size of the rewritten query. As
already observed in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], the way extensional constraints interact with reasoning, and
in particular query answering, is not trivial at all: e.g., [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] defines a complex condition
for the deletion of a concept (or role) inclusion from the TBox due to the presence of
extensional constraints. In our approach, we use extensional constraints in a very
different way from [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], which uses such constraints to “deactivate” corresponding TBox
assertions in the TBox: conversely, we are able to define significant query
minimizations even for extensional constraints for which there exists no corresponding TBox
assertions. Based on these ideas, we define the Prexto algorithm: in particular, we
restructure and extend the Presto query rewriting algorithm to fully exploit the presence
of extensional constraints. Finally, we show that the above optimizations allow Prexto
to outperform the existing query rewriting techniques for DL-Lite in practical cases. In
particular, we compare Prexto with Presto and with the optimization presented in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
      </p>
      <p>
        This paper is an extended abstract of [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ].
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>
        We assume the reader is familiar with the basics of DLs as well as with DL-LiteA [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
      <p>Given an ABox A, we denote by IA the DL-LiteA interpretation such that, for
every concept instance assertion C(a), aI 2 CI iff C(a) 2 A, for every role instance
assertion R(a; b), haI ; bI iI 2 RI iff R(a; b) 2 A, and for every attribute instance
assertion U (a; b), haI ; bI iI 2 U I iff U (a; b) 2 A.</p>
      <p>A conjunctive query (CQ) q is an expression of the form q(x) 1; : : : ; n, where
x is a tuple of variables, and every i is an atom whose predicate is a concept name or a
role name or an attribute name, and whose arguments are either variables or constants,
such that every variable occurring in x also occurs in at least one i. The variables
occurring in x are called the distinguished variables of q, while the variables occurring
in some i but not in x are called the existential variables of q. The predicate q is called
the predicate of the query, and the number of elements of x is called the arity of q. A
CQ is a Boolean CQ if it has no distinguished variables.</p>
      <p>A union of conjunctive queries (UCQ) Q is a set of conjunctive queries of the same
arity and having the same query predicate. A UCQ Q is a Boolean UCQ if every CQ
belonging to Q is Boolean.</p>
      <p>Given a CQ q of arity n, we denote by q(c) the Boolean CQ obtained from q by
replacing the distinguished variables in x with the constants in the n-tuple of constants
c. Given a CQ q of arity n, the evaluation of q in I, denoted by eval(q; I), is the set of
n tuples of constants c such that I satisfies the first-order sentence q(c). The evaluation
of a UCQ Q in I, denoted by eval(Q; I), is the set Sq2Q eval(q; I). The set of certain
answers to a UCQ Q over a DL-LiteA ontology hT ; Ai, denoted by cert (Q; hT ; Ai), is
the set of tuples TI2Mod(hT ;Ai) eval(Q; I).</p>
      <p>
        Given a UCQ Q and a TBox T , a UCQ Q0 is a perfect rewriting of Q with respect to
T if, for every ABox A such that hT ; Ai is consistent, cert (Q; hT ; Ai) = eval(Q; IA).
The above notion of perfect rewriting immediately extends to any query language for
which the evaluation eval of queries on a first-order interpretation is defined. We remark
that many algorithms are available to compute perfect rewritings in DL-Lite logics (e.g.,
[
        <xref ref-type="bibr" rid="ref11 ref12 ref16 ref4 ref6 ref7">4, 12, 16, 11, 7, 6</xref>
        ]).
      </p>
      <p>In the following, for ease of exposition, we will not consider attributes in DL-LiteA
ontologies. However, all the algorithms and results that we present in this paper can be
immediately extended to handle attributes (since attributes can essentially be treated in
a way analogous to roles).
3</p>
    </sec>
    <sec id="sec-3">
      <title>Extensional Constraints</title>
      <p>
        We now define the notion of EBox, which constitutes a set of extensional constraints,
i.e., constraints over the ABox. The idea of EBox has been originally introduced in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ],
under the name of ABox dependencies.
      </p>
      <p>The following definitions are valid for every DL, under the assumption that the
assertions are divided into extensional assertions and intensional assertions, and
extensional assertions correspond to atomic instance assertions.</p>
      <p>Given a set of intensional assertions N and an interpretation I, we say that I
satisfies N if I satisfies every assertion in N .</p>
      <p>An extensional constraint box, or simply EBox, is a set of intensional assertions.
Notice that, from the syntactic viewpoint, an EBox is identical to a TBox. Therefore,
entailment of an assertion with respect to an EBox E (denoted by E j= ) is defined
exactly in the same way as in the case of TBoxes.</p>
      <p>Given an ABox A and an EBox E , we say that A is valid for E if IA satisfies E .
Definition 1. (Admissible ABox) Given a TBox T and an EBox E , an ABox A is an
admissible ABox for T and E if A is consistent with T and A is valid for E . We denote
with ADM(T ; E ) the set of ABoxes A that are admissible for T and E .</p>
      <p>
        Informally, an EBox acts as a set of integrity constraints over the ABox. Differently
from other recent approaches that have proposed various forms of integrity constraints
for DL ontologies (e.g., [
        <xref ref-type="bibr" rid="ref17 ref9">9, 17</xref>
        ]), an EBox constrains the ABox while totally discarding
the TBox, since the notion of validity with respect to an EBox only considers the ABox.
      </p>
      <p>We are now ready to define the notion of perfect rewriting in the presence of both a
TBox and an EBox.</p>
      <p>Definition 2. (Perfect rewriting in the presence of an EBox) Given a TBox T , an EBox
E , and a UCQ Q, a FOL query is a perfect rewriting of Q with respect to hT ; E i if,
for every ABox A 2 ADM(T ; E ), hT ; Ai j= Q iff IA j= .</p>
      <p>The above definition establishes a natural notion of perfect rewriting in the presence
of an EBox E . Since E constrains the admissible ABoxes, the more selective is E (for
the same TBox T ), the more restricted the set ADM(T ; E ) is. If for instance, E ; E 0 are
two EBoxes such that E E 0, we immediately get from the above definitions that
ADM(T ; E ) ADM(T ; E 0). Now, let Q be a UCQ, let be a perfect rewriting of Q
with respect to hT ; E i and let 0 be a perfect rewriting of Q with respect to hT ; E 0i:
will have to satisfy the condition hT ; Ai j= Q iff IA j= for more ABoxes A than
query 0. Consequently, will have to be a more complex query than 0. Therefore,
larger EBoxes in principle allow for obtaining simpler perfect rewritings.</p>
      <p>As already explained, the goal of this paper is to use extensional constraints
to optimize query rewriting in DL-LiteA. An intuitive explanation of how
extensional constraints allow for simplifying query rewriting can be given by the
following very simple example. Suppose we are given a TBox fStudent v Persong, an
empty EBox E0, and an EBox E1 = fStudent v Persong. Now, given a query
q(x) Person(x), a perfect rewriting of this query with respect to hT ; E0i is the UCQ
fq(x) Person(x) q(x) Student(x)g, while a perfect rewriting of query q with
respect to hT ; E1i is the query q itself. Namely, under the EBox E1 we can ignore the
TBox concept inclusion Student v Person, since it is already satisfied by the ABox.</p>
      <p>
        However, as already explained in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], we can not always ignore TBox assertions
that also appear in the EBox (and are thus already satisfied by the ABox). For instance,
let q be the query q C(x). If the TBox T contains the assertions 9R v C and
D v 9R and the EBox E contains the assertion 9R v C, we cannot ignore this last
inclusion when computing a perfect rewriting of q (or when answering query q). In fact,
suppose the ABox is fD(a)g: then A 2 ADM(T ; E ) and query q is entailed by hT ; Ai.
But actually q is not entailed by hT 0; Ai where T 0 = T E . From the query rewriting
viewpoint, a perfect rewriting of q with respect to T is the UCQ fq C(x) q
R(x; y) q D(y)g, while a perfect rewriting of q with respect to T 0 is the query q
itself. And of course, the ABox A shows that this last query is not a perfect rewriting of
q with respect to hT ; E i. Therefore, also when computing a perfect rewriting, we cannot
simply ignore the inclusions of the TBox that are already satisfied by the ABox (i.e.,
that belong to the EBox).
      </p>
      <p>The example above shows that we need to understand under which conditions we
are allowed to use extensional constraints to optimize query rewriting.
4</p>
      <p>
        Prexto
In this section we present the algorithm Prexto (Perfect Rewriting under EXTensional
cOnstraints). Prexto makes use of the algorithm Presto, originally defined in [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ],
which computes a nonrecursive datalog program constituting a perfect rewriting of a
      </p>
      <p>
        UCQ Q with respect to a DL-LiteA TBox T . The algorithm Presto is reported in
Figure 1. We refer the reader to [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] for a detailed explanation of the algorithm. For our
purposes, it suffices to remind that the program returned by Presto uses auxiliary
datalog predicates, called ontology-annotated (OA) predicates, to represent every basic
concept and basic role that is involved in the query rewriting. E.g., the basic concept
B is represented by the OA-predicate p1 , while the basic role R is represented by the
      </p>
      <p>B
OA-predicate p2 , where the superscript represents the arity of the predicate (actually,</p>
      <p>
        R
to handle Boolean subqueries, also 0-ary OA-predicates, i.e., predicates with no
arguments, are defined: we refer the reader to [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] for more details).
      </p>
      <p>In the following, we modify the algorithm Presto. In particular, we make the
following changes. First, the final for each cycle of the algorithm (cf. Figure 1) is
not executed: i.e., the rules defining the OA-predicates are not added to the returned
program. Second, the algorithm DeleteRedundantAtoms is modified to take into
account the presence of disjointness assertions and role functionality assertions in
the TBox. More precisely, the following simplification rules are added to algorithm
DeleteRedundantAtoms(Q0; T ) (in which we denote basic concepts by B; C, role
names by R; S, and datalog rules by the symbol r):
1. if p2R(t1; t2) and p2S (t1; t2) occur in r and T j= R v :S, then delete r from Q0;
2. if p1B(t) and p1C (t) occur in r and T j= B v :C, then delete r from Q0;
3. if p2R(t1; t2) and p1C (t1) occur in r and T j= 9R v :C, then delete r from Q0;
4. if p0 and p0 occur in r and T j= 0 v : 0, then delete r from Q0;
5. if p1B(t) and p0 occur in r and T j= B0 v : 0, then delete r from Q0;
6. if p2R(t1; t2) and p0 occur in r and T j= R0 v : 0, then delete r from Q0;</p>
    </sec>
    <sec id="sec-4">
      <title>Algorithm Prexto(Q; T ; E)</title>
      <p>Input: UCQ Q, DL-LiteA TBox T , DL-LiteA EBox E
Output: UCQ Q0
begin</p>
      <p>P = Presto(Q; T );
P 0 = ;;
for each OA-predicate PR2 occurring in P do</p>
      <p>= MinimizeViews(R; E; T );
P 0 = P 0 [ fp2B(x; y) S(x; y) j S is a role name and S 2 g</p>
      <p>[ fp2B(x; y) S(y; x) j S is a role name and S 2 g;
for each OA-predicate PB1 occurring in P do</p>
      <p>= MinimizeViews(B; E; T );
P 0 = P 0 [ fp1B(x) C(x) j C is a concept name and C 2 g</p>
      <p>[ fp1B(x) R(x; y) j 9R 2 g [ fp1B(x) R(y; x) j 9R
for each OA-predicate PN0 occurring in P do</p>
      <p>= MinimizeViews(N 0; E; T );
P 0 = P 0 [ fp0N C(x) j C is a concept name and C0 2 g</p>
      <p>[ fp0N R(x; y) j R is a role name and R0 2 g;
P 00 = P [ P 0;
Q0 = Unfold(P 00);
Q0 = DeleteRedundantAtoms(Q0; E);
return Q0
end
7. if p2R(t1; t2) and p2R(t1; t02) (with t2 6= t02) occur in r and (funct R) 2 T , then, if t2
and t02 are two different constants, then delete r from Q0; otherwise, replace r with
the rule (r), where is the substitution which poses t2 equal to t02.</p>
      <p>Analogous simplification rules (which can be immediately derived) hold when R; S are
inverse roles in cases 1, 3 and 7.</p>
      <p>Example 1. Let us show the effect of the new transformations added to
DeleteRedundantAtoms through two examples. First, suppose T = fB v
:B0; (funct R)g and suppose r is the rule q(x) p1B(y); p2R(x; y); p2R(x; z); p1B0 (z).
First, the above rule 7 of algorithm DeleteRedundantAtoms can be applied, which
transforms r into the rule q(x) p1B(y); p2R(x; y); p1B0 (y). Then, the above rule 2 of
algorithm DeleteRedundantAtoms can be applied, hence this rule is deleted from the
program. Intuitively, this is due to the fact that this rule looks for elements belonging
both to concept B and to concept B0, which is impossible because the disjointness
assertion B v :B0 is entailed by the TBox T . Therefore, it is correct to delete the rule
from the program.</p>
      <p>From now on, when we speak about Presto we refer to the above modified
version of the algorithm, and when we speak about DeleteRedundantAtoms we refer
to the above modified version which takes into account disjointness and functionality
assertions.</p>
      <p>The Prexto algorithm is defined in Figure 2. The algorithm is constituted of the
following four steps:
Algorithm MinimizeViews(B; E; T )
Input: basic concept (or basic role, or 0-ary predicate) B,</p>
      <sec id="sec-4-1">
        <title>DL-LiteA EBox E, DL-LiteA TBox T</title>
        <p>Output: set of basic concepts (or basic roles, or 0-ary predicates) 00
begin
= fB0 j T j= B0 v Bg;
0 = ;;
for each B0 2 do
if there exists B00 2
then 0 = 0 [ fB0g;
00 = 0;
while there exist B; B0 2
do 00 = 00 fB0g;
return 00
end
such that E j= B0 v B00 and E 6j= B00 v B0</p>
        <p>0 such that B 6= B0 and E j= B v B0 and E j= B0 v B</p>
        <p>Notice that the bottleneck of the whole process is the above step 3, since the number
of conjunctive queries generated by the unfolding may be exponential with respect to
the length of the initial query Q (in particular, it may be exponential with respect to the
maximum number of atoms in a conjunctive query of Q). As shown by the following
example, the usage of extensional constraints done at step 2 through the MinimizeViews
algorithm is crucial to handle the combinatorial explosion of the unfolding.
Example 2. Let T be the following DL-LiteA TBox:</p>
      </sec>
      <sec id="sec-4-2">
        <title>Company v 9givesHighSalaryTo</title>
      </sec>
      <sec id="sec-4-3">
        <title>9givesHighSalaryTo v Manager</title>
      </sec>
      <sec id="sec-4-4">
        <title>Manager v Employee</title>
      </sec>
      <sec id="sec-4-5">
        <title>Employee v HasJob</title>
      </sec>
      <sec id="sec-4-6">
        <title>9receivesGrantFrom v StudentWithGrant</title>
      </sec>
      <sec id="sec-4-7">
        <title>StudentWithGrant v FulltimeStudent</title>
      </sec>
      <sec id="sec-4-8">
        <title>FulltimeStudent v Unemployed</title>
      </sec>
      <sec id="sec-4-9">
        <title>FulltimeStudent v Student</title>
        <p>isBestFriendOf v knows
(funct isBestFriendOf)
(funct isBestFriendOf )</p>
      </sec>
      <sec id="sec-4-10">
        <title>HasJob v :Unemployed</title>
        <p>Moreover, let E1; : : : ; E4 be the following concept inclusions:</p>
        <p>E1 = FulltimeStudent v StudentWithGrant
E2 = 9receivesGrantFrom v StudentWithGrant
E3 = HasJob v Employee
E4 = Manager v Employee
and let E1 = fE1g; E2 = fE1; E2g; E3 = fE1; E2; E3g; E4 = fE1; E2; E3; E4g .
Finally, let q0; q1; q2; q3 be the following simple queries:
q0(x)
q1(x)
q2(x)
q3(x)</p>
        <sec id="sec-4-10-1">
          <title>Student(x)</title>
        </sec>
        <sec id="sec-4-10-2">
          <title>Student(x); knows(x; y); HasJob(y)</title>
        </sec>
        <sec id="sec-4-10-3">
          <title>Student(x); knows(x; y); HasJob(y); knows(x; z); Unemployed(z)</title>
        </sec>
        <sec id="sec-4-10-4">
          <title>Student(x); knows(x; y); HasJob(y); knows(x; z); Unemployed(z); knows(x; w); Student(w)</title>
          <p>Let us focus on query q1 and let us consider the empty EBox. In this case, during
the execution of Prexto(q1; T ; ;) the algorithm MinimizeViews simply computes the
subsumed sets of Student, knows, HasJob, which are, respectively:</p>
          <p>MinimizeViews(Student; ;; T ) =</p>
          <p>fStudent; FulltimeStudent; StudentWithGrant; 9receivesGrantFromg
MinimizeViews(knows; ;; T ) = fknows; isBestFriendOf g</p>
          <p>MinimizeViews(HasJob; ;; T ) = fHasJob; Employee; Manager; 9givesHighSalaryTo g
Since two sets are constituted of four predicates and one is constituted of two predicates,
the UCQ returned by the unfolding step in Prexto(q1; T ; E ) contains 32 CQs. This is
also the size of the final UCQ, since in this case no optimizations are computed by the
algorithm DeleteRedundantAtoms, because both the disjointness assertion and the
role functionality assertions of T have no impact on the rewriting of query q1.</p>
          <p>Conversely, let us consider the EBox E4: during the execution of Prexto(q1; T ; E ),
we obtain the following sets from the execution of the algorithm MinimizeViews::
MinimizeViews(Student; E4; T ) = fStudent; StudentWithGrantg
MinimizeViews(knows; E4; T ) = fknows; isBestFriendOf g</p>
          <p>MinimizeViews(HasJob; E4; T ) = fEmployee; 9givesHighSalaryTo g
Thus, the algorithm MinimizeViews returns only two predicates for Student and only
two predicates for HasJob. Therefore, the final unfolded UCQ is constituted of 8 CQs
(since, as above explained, the final call to DeleteRedundantAtoms does not produce
any optimization).</p>
          <p>
            It is possible to prove correctness of Prexto [
            <xref ref-type="bibr" rid="ref15">15</xref>
            ], which in turn implies the following
property, which states that the computational cost of Prexto is no worse than all known
query rewriting techniques for DL-LiteA which compute UCQs.
          </p>
          <p>Theorem 1. Prexto(Q; T ; E ) runs in polynomial time with respect to the size of T [ E ,
and in exponential time with respect to the maximum number of atoms in a conjunctive
query in the UCQ Q.</p>
          <p>algorithm E = ; E = E1 E = E2 E = E3 E = E4
Presto+unfolding 4 4 4 4 4</p>
          <p>TBox-min 4 4 4 4 4
Prexto-noEBox 4 4 4 4 4
Prexto-noDisj 4 3 2 2 2</p>
          <p>Prexto-full 4 3 2 2 2
Presto+unfolding 32 32 32 32 32</p>
          <p>TBox-min 32 32 32 32 32
Prexto-noEBox 32 32 32 32 32
Prexto-noDisj 32 24 16 12 8</p>
          <p>Prexto-full 32 24 16 12 8
Presto+unfolding 256 256 256 256 256</p>
          <p>TBox-min 256 256 256 256 256
Prexto-noEBox 224 224 224 224 224
Prexto-noDisj 256 144 64 48 32</p>
          <p>Prexto-full 224 126 106 42 28
Presto+unfolding 2048 2048 2048 2048 2048</p>
          <p>TBox-min 2048 2048 2048 2048 2048
Prexto-noEBox 1584 1584 1584 1584 1584
Prexto-noDisj 2048 864 256 192 128</p>
          <p>
            Prexto-full 1584 708 188 141 94
We now compare the optimizations introduced by Prexto with some of the current
techniques for query rewriting in DL-Lite. In particular, we consider the simple DL-LiteA
ontology of Example 2 and compare the size of the UCQ rewritings generated by the
original Presto algorithm, the rewriting based on the TBox minimization technique
TBox-min shown in [
            <xref ref-type="bibr" rid="ref13">13</xref>
            ], and the Prexto algorithm. To single out the impact of the
different optimizations introduced by Prexto, we present three different execution
modalities for Prexto: without considering the EBox (we call this modality Prexto-noEBox);
(ii) without considering disjointness axioms and role functionality axioms in the TBox
(we call this modality Prexto-noDisj); (iii) and considering all axioms both in the TBox
and in the EBox (we call this modality Prexto-full). Moreover, we will consider
different EBoxes of increasing size, to better illustrate the impact of the EBox on the size of
the rewriting.
          </p>
          <p>
            The table reported in Figure 4 shows the impact on rewriting queries q0, q1, q2 and
q3 of: (i) the disjointness axiom and the functional role axioms in T ; (ii) the EBoxes
E1; : : : ; E4. In the table, we denote by Presto+unfolding the UCQ obtained by
unfolding the nonrecursive datalog program returned by the Presto algorithm, and denote by
TBox-min the execution of Presto+unfolding which takes as input the TBox
minimized by the technique presented in [
            <xref ref-type="bibr" rid="ref13">13</xref>
            ] using the extensional inclusions in the EBox.
These two rows can be considered as representative of the state of the art in query
rewriting in DL-Lite (with and without extensional constraints): indeed, due to the
simple structure of the TBox and the queries, every existing UCQ query rewriting technique
for plain DL-Lite ontologies (i.e., ontologies without EBoxes) would generate UCQs of
size analogous to Presto+unfolding (of course, we are not considering the approaches
where the ABox is preprocessed, in which of course much more compact query
rewritings can be defined [
            <xref ref-type="bibr" rid="ref13 ref8">8, 13</xref>
            ]). The third column of the table displays the results when the
empty EBox was considered, while the fourth, fifth, sixth, and seventh column
respectively report the results when the EBox E1, E2, E3, E4, was considered. The numbers
in these columns represent the size of the UCQ generated when rewriting the query with
respect to the TBox T and the EBox E : more precisely, this number is the number of
CQs which constitute the generated UCQ. The results obtained in the case of query q1
have been explained in Example 2.
          </p>
          <p>The results of Figure 4 clearly show that even a very small number of EBox
axioms may have a dramatic impact on the size of the rewritten UCQ, and that this is
already the case for relatively short queries (like query q2): this behavior is even more
apparent for longer queries like q3. In particular, notice that, even when only two
extensional inclusions are considered (case E = E2), the minimization of the UCQ is
already very significant. Moreover, for the queries under examination, extensional
inclusions are more effective than disjointness axioms and role functionalily axioms on
the minimization of the rewriting size.</p>
          <p>
            The results also show that the technique presented in [
            <xref ref-type="bibr" rid="ref13">13</xref>
            ] for exploiting extensional
inclusions does not produce any effect in this case. This is due to the fact that the
extensional inclusions considered in our experiment do not produce any minimization
of the TBox according to the condition expressed in [
            <xref ref-type="bibr" rid="ref13">13</xref>
            ]. Conversely, the technique
for exploiting extensional constraints of Prexto is indeed effective. For instance, notice
that this technique is able to use extensional constraints (like E2 and E3) which have
no counterpart in the TBox, in the sense that such concept inclusions are not entailed
by the TBox T .
          </p>
          <p>
            Finally, we remark that the above simple example shows a situation which is
actually not favourable for the algorithm, since there are very few extensional constraints
and short (or even very short) queries: nevertheless, the experimental results show that,
even in this setting, our algorithm is able to produce very significant optimizations.
Indeed, the ideas which led to the Prexto algorithm came out of a large OBDA project
that our research group is currently developing with an Italian Ministry. In this project,
several relevant user queries could not be executed by our ontology reasoner (Quonto
[
            <xref ref-type="bibr" rid="ref3">3</xref>
            ]) due to the very large size of the rewritings produced. For such queries, the
minimization of the rewriting produced by the usage of the Prexto optimizations is even
more dramatic than the examples reported in the paper, because the queries are more
complex (at least ten atoms) and the number of extensional constraints is larger than in
the example.
6
          </p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusions</title>
      <p>In this paper we have presented a query rewriting technique for fully exploiting the
presence of extensional constraints in a DL-LiteA ontology. Our technique clearly proves
that extensional constraints may produce a dramatic improvement of query rewriting,
and consequently of query answering over DL-LiteA ontologies.</p>
      <p>
        We believe that the present approach can be extended in several directions. First, it
would be extremely interesting to generalize the Prexto technique to ontology-based
data access (OBDA), where the ABox is only virtually specified through declarative
mappings over external data sources: as already mentioned in the introduction, in this
scenario extensional constraints would be a very natural notion, since they could be
automatically derived from the mapping specification. Then, it would be very
interesting to extend the usage of extensional constraints beyond DL-LiteA ontologies: in this
respect, a central question is whether existing query rewriting techniques for other
description logics (e.g., [
        <xref ref-type="bibr" rid="ref11 ref14">11, 14</xref>
        ]) can be extended with optimizations analogous to the ones
of Prexto. Finally, we plan to fully implement our algorithm within the Quonto/Mastro
system [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] for DL-LiteA ontology management, and to further compare Prexto with
other query rewriting techniques for DL-Lite (e.g., [
        <xref ref-type="bibr" rid="ref10 ref11 ref5">11, 5, 10</xref>
        ]).
      </p>
      <p>Acknowledgments This research has been partially supported by the ICT Collaborative
Project ACSI (Artifact-Centric Service Interoperation), funded by the EU under FP7
ICT Call 5, 2009.1.2, grant agreement n. FP7-257593.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <article-title>1. OWL 2 web ontology language profiles (</article-title>
          <year>2009</year>
          ), http://www.w3.org/TR/owl-profiles/
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Artale</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kontchakov</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zakharyaschev</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>The DL-Lite family and relations</article-title>
          .
          <source>J. of Artificial Intelligence Research</source>
          <volume>36</volume>
          ,
          <fpage>1</fpage>
          -
          <lpage>69</lpage>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Giacomo</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lembo</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lenzerini</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Poggi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rodriguez-Muro</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosati</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ruzzi</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Savo</surname>
            ,
            <given-names>D.F.</given-names>
          </string-name>
          :
          <article-title>The Mastro system for ontology-based data access</article-title>
          .
          <source>Semantic Web J</source>
          .
          <volume>2</volume>
          (
          <issue>1</issue>
          ),
          <fpage>43</fpage>
          -
          <lpage>53</lpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Giacomo</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lembo</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lenzerini</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosati</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          :
          <article-title>Tractable reasoning and efficient query answering in description logics: The DL-Lite family</article-title>
          .
          <source>J. of Automated Reasoning</source>
          <volume>39</volume>
          (
          <issue>3</issue>
          ),
          <fpage>385</fpage>
          -
          <lpage>429</lpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Chortaras</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Trivela</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stamou</surname>
            ,
            <given-names>G.B.</given-names>
          </string-name>
          :
          <article-title>Optimized query rewriting for OWL 2 QL</article-title>
          . In: CADE. pp.
          <fpage>192</fpage>
          -
          <lpage>206</lpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Gottlob</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schwentick</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Rewriting ontological queries into small nonrecursive datalog programs</article-title>
          .
          <source>In: Proc. of DL</source>
          <year>2011</year>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Kikot</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kontchakov</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zakharyaschev</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>On (in)tractability of OBDA with OWL2QL</article-title>
          .
          <source>In: Proc. of DL</source>
          <year>2011</year>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Kontchakov</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lutz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Toman</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolter</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zakharyaschev</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>The combined approach to query answering in DL-Lite</article-title>
          .
          <source>In: Proc. of KR 2010</source>
          . pp.
          <fpage>247</fpage>
          -
          <lpage>257</lpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Motik</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sattler</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>Bridging the gap between OWL and relational databases</article-title>
          .
          <source>J. of Web Semantics</source>
          <volume>7</volume>
          (
          <issue>2</issue>
          ),
          <fpage>74</fpage>
          -
          <lpage>89</lpage>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Orsi</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pieris</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Optimizing query answering under ontological constraints</article-title>
          .
          <source>PVLDB</source>
          <volume>4</volume>
          (
          <issue>11</issue>
          ),
          <fpage>1004</fpage>
          -
          <lpage>1015</lpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Pérez-Urbina</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Motik</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Tractable query answering and rewriting under description logic constraints</article-title>
          .
          <source>J. of Applied Logic</source>
          <volume>8</volume>
          (
          <issue>2</issue>
          ),
          <fpage>186</fpage>
          -
          <lpage>209</lpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Poggi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lembo</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Giacomo</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lenzerini</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosati</surname>
          </string-name>
          , R.:
          <article-title>Linking data to ontologies</article-title>
          .
          <source>J. on Data Semantics X</source>
          ,
          <fpage>133</fpage>
          -
          <lpage>173</lpage>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Rodriguez-Muro</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          : Dependencies:
          <article-title>Making ontology based data access work in practice</article-title>
          .
          <source>In: Proc. of AMW</source>
          <year>2011</year>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Rosati</surname>
          </string-name>
          , R.:
          <article-title>On conjunctive query answering in E L. In: Proc. of DL 2007</article-title>
          .
          <article-title>CEUR, ceur-ws. org</article-title>
          , vol.
          <volume>250</volume>
          , pp.
          <fpage>451</fpage>
          -
          <lpage>458</lpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Rosati</surname>
          </string-name>
          , R.: Prexto:
          <article-title>Query rewriting under extensional constraints in DL-Lite</article-title>
          .
          <source>In: Proc. of ESWC</source>
          <year>2012</year>
          (
          <year>2012</year>
          ), to appear
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Rosati</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Almatelli</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Improving query answering over DL-Lite ontologies</article-title>
          .
          <source>In: Proc. of KR 2010</source>
          . pp.
          <fpage>290</fpage>
          -
          <lpage>300</lpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Tao</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sirin</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bao</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McGuinness</surname>
            ,
            <given-names>D.L.</given-names>
          </string-name>
          :
          <article-title>Integrity constraints in OWL</article-title>
          .
          <source>In: Proc. of AAAI</source>
          <year>2010</year>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Thomas</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pan</surname>
            ,
            <given-names>J.Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ren</surname>
          </string-name>
          , Y.:
          <article-title>TrOWL: Tractable OWL 2 reasoning infrastructure</article-title>
          .
          <source>In: Proc. of ESWC 2010</source>
          . pp.
          <fpage>431</fpage>
          -
          <lpage>435</lpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>