• Aucun résultat trouvé

Two Upper Bounds for Conjunctive Query Answering in SHIQ

N/A
N/A
Protected

Academic year: 2022

Partager "Two Upper Bounds for Conjunctive Query Answering in SHIQ"

Copied!
11
0
0

Texte intégral

(1)

Answering in SHIQ

Carsten Lutz

Institut f¨ur Theoretische Informatik TU Dresden, Germany lutz@tcs.inf.tu-dresden.de

Abstract. We have shown recently that, in extensions of ALC that involve inverse roles, conjunctive query answering is harder than satis- fiability: it is 2-ExpTime-complete in general and NExpTime-hard if queries are connected and contain at least one answer variable [9]. In this paper, we show that, in SHIQ without inverse roles (and with- out transitive roles in the query), conjunctive query answering is only ExpTime-complete and thus not harder than satisfiability. We also show that theNExpTime-lower bound from [9] is tight.

1 Introduction

When description logic (DL) knowledge bases are used in applications with a large amount of instance data, ABox querying is the most important reasoning service. The basic query mechanism for ABoxes isinstance retrieval, i.e., to re- turn all the individuals from an ABox that are known to be instances of a given query concept. Instance retrieval can be viewed as a well-behaved generalization of subsumption and satisfiability, which are the standard reasoning problems on TBoxes. In particular, algorithms for the latter can typically be adapted to instance retrieval in a straightforward way, and the computational complexity coincides in almost all cases (see [13] for an exception). In 1998, Calvanese et al.

introducedconjunctive query answeringas a more powerful query mechanism for DL ABoxes. Since then, conjunctive queries have received considerable interest in the DL community, see for example the papers [1–4, 6, 7, 11]. In a nutshell, con- junctive query answering generalizes instance retrieval by admitting also queries whose relational structure is not tree-shaped. This generalization is both natural and useful because the relational structure of ABoxes is usually not tree-shaped either.

In contrast to the case of instance retrieval, developing algorithms for con- junctive query answering is not merely a matter of extending algorithms for satisfiability, but requires developing new techniques. In particular, all hitherto known algorithms for DLs that includeALC as a fragment run in deterministic double exponential runtime, in contrast to algorithms for deciding subsumption and satisfiability which require only exponential time even for DLs much more expressive thanALC. In the recent paper [9], we have shown that this increase in

(2)

runtime cannot be avoided in extensions ofALC that include inverse roles. More precisely, we have proved the following two results aboutALCI, the extension ofALC with inverse roles:

(1) Conjunctive query answering inALCI is 2-ExpTime-complete.

(2) Rooted conjunctive query answering inALCI is co-NExpTime-hard.

Here, rooted means that conjunctive queries are required to be connected and contain at least one answer variable. The name “rooted” derives from the fact that every match of such a query is rooted in at least one ABox individual.

This paper is intended as a sequel to [9], providing the upper bounds that have been announced in [9] but not proved in detail. We show that

(3) Conjunctive query answering in SHQ, i.e., SHIQwithout inverse roles, is ExpTime-complete.

(4) Rooted conjunctive query answering in SHIQ is in co-NExpTime, thus co-NExpTime-complete.

In particular, (3) shows that inverse roles are indeed the culprit for 2-ExpTime- hardness of conjunctive query answering inALCI andSHIQ. For both (3) and (4), we assume that non-simple roles (a common generalization of transitive roles inSHIQ) are disallowed in the conjunctive query. We have learned that (3) has been proved independently and in parallel in [12] for the description logicALCH.

2 Preliminaries

We assume standard notation for the syntax and semantics ofSHIQknowledge bases [5]. In particular,NC, NR, and NI are countably infinite and disjoint sets ofconcept names,role names, andindividual names. ATBox is a set of concept inclusions C v D, role inclusionsr vs, and transitivity statements Trans(r), and aknowledge base (KB)is a pair (T,A) consisting of a TBoxT and an ABox A. We writeK |=svrif the role inclusionsvris true in all models ofK, and similarly for K |=Trans(r). It is easy to see and well-known that “K |=svr”

and “K |=Trans(r)” are decidable in polytime [5]. As usual, a role is calledsimple if there is no role s such thatK |=svr, and K |=Trans(s). We write Ind(A) to denote the set of all individual names in an ABoxA. Throughout the paper, the numbern inside number restrictions (≥n r C) and (≤n r C) is assumed to be coded in binary.

Let NV be a countably infinite set of variables. An atom is an expression C(v) orr(v, v0), whereCis a SHIQconcept,ris a (possibly inverse) role, and v, v0 ∈NV. Aconjunctive queryqis a finite set of atoms. We useVar(q) to denote the set of variables occurring in the queryq. The setVar(q) is partitioned into answer variables and (existentially)quantified variables. LetAbe an ABox,I a model ofA,qa conjunctive query, andπ:Var(q)→∆Ia total function such that for every answer variable v ∈Var(q), there is an a∈ NI such that π(v) = aI. We write I |=π C(v) if π(v) ∈ CI and I |=π r(v, v0) if (π(v), π(v0)) ∈ rI. If I |=πat for allat∈q, we write I |=π qand callπ amatch forI andq. We say

(3)

that I satisfies q and write I |=q if there is a matchπ forI and q. If I |=q for all models I of a KB K, we write K |= q and say that K entails q. The query entailment problem is, given a knowledge baseK and a queryq, to decide whether K |=q. This is the decision problem corresponding to query answering (which is a search problem), see e.g. [4] for details. Observe that we do not admit the use of individual constants in conjunctive queries. This assumption is only for simplicity, as such constants can easily be simulated by introducing additional concept names [4].

It has been observed many times that, when deciding conjunctive query an- swering in a DL, it suffices to concentrate on certain regular models of the input knowledge baseK. In the following, we describe these models for SHQ. Let J be an interpretation. Aforest base J is an interpretation that interprets transi- tive roles in an arbitrary way (i.e., not necessarily transitively) and satisfies the following conditions:

(i) ∆J is a prefix-closed subset of +;

(ii) if (d, e)∈rJ, thene, d∈ ore=d·cfor somec∈ .

Elements of∆J∩ are therootsofJ. An interpretationIis called theK-closure ofJ ifI is identical toJ except that, for all rolesr, we have

rI =rJ ∪ [

K|=svr∧K|=Trans(s)

(sJ)+.

A modelI of a knowledge baseK= (T,A) is aforest model ofKif (iii) I is theK-closure of a forest base interpretationJ, and

(iv) for every root dofJ, there is an a∈Ind(A) such thataI=d.

Theroots ofI are defined as the roots of J.

Proposition 1. Let K be an SHQ-knowledge base andq a conjunctive query.

If K 6|=q, then there is a forest modelI ofK such that I 6|=q.

3 Query Entailment in SHQ is in ExpTime

We give an algorithm for query entailment in SHQ that runs in ExpTime, and thus establish ExpTime-completeness of this problem. Our algorithm is inspired by the 2ExpTimealgorithm for conjunctive query entailment inSHIQ with non-simple roles allowed in the query, as given in [4]. On the one hand, our algorithm is simpler because we allow only simple roles in the query. On the other hand, we aim at anExpTimeupper bound which poses additional challenges. In this section, it is convenient to assume that conjunctive queries do not contain answer variables. This assumption can be made w.l.o.g. since answer variables can be simulated using quantified variables and an additional concept name.

The general idea of the algorithm is to (Turing-)reduce query entailment in SHQto ABox consistency inSHQ, i.e.,SHQextended with role conjunction:

(4)

given a SHQ-knowledge base K and a query q, we produceSHQ-knowledge basesK1, . . . ,Knsuch thatK 6|=qiff any of theKiis consisent. This is done such thatnis exponential in the size ofK andq, and the size of each knowledge base is polynomial in the size ofKandq. Since knowledge base consistency inSHQ can be decided in ExpTime, we obtain the desiredExpTime upper bound for query entailment inSHQ.

Throughout this section, we will sometimes view a conjunctive query as a directed graph Gq = (Vq, Eq) with Vq =Var(q) and Eq ={(v, v0)|r(v, v0)∈ q for somer∈NR}. We callqtree-shaped ifGq is a tree. Ifqis tree-shaped andv is the root ofGq, we call v the root ofq.

In the following, we introduce three notions that are central to the construc- tion of the knowledge basesK1, . . . ,Kn: fork rewritings, splittings, and spoilers.

We start with fork rewritings, and say that

– q0 isobtained fromqby fork elimination ifq0is obtained fromqby selecting two atomsr(v0, v) ands(v00, v) withv0 6=v00 and identifyingv0 andv00; – q0 is a fork rewriting of q if q0 is obtained from q by repeated (but not

necessarily exhaustive) fork elimination;

– q0 is a maximal fork rewriting of q if q0 is a fork rewriting and no further fork elimination is possible inq0.

The following lemma allows us to speak of the maximal fork rewriting of a conjunctive query. It is proved in the full version of this paper [10].

Lemma 1. Modulo variable renaming, every conjunctive query has a unique maximal fork rewriting.

The purpose of splittings is to describe such a partition without reference to a concrete model I and a concrete match π. Let K be an SHQ-knowledge base. A splitting of q w.r.t. K is a tuple Π = hR, T, S1, . . . , Sn, µ, νi, where R, T, S1, . . . , Sn is a partitioning of Var(q), µ:{1, . . . , n} →R assigns to each set Si a variable µ(i) in R, and ν : R → Ind(A) assigns to each variable in R an individual inA. A splitting has to satisfy the following conditions, whereq|V

denotes the restriction ofq toV ⊆Var(q):

(a) some variablesv are mapped to a rootπ(v) ofI;

(b) other variablesvare mapped to a non-rootπ(v) ofI, and there is a variable v0 such thatvis reachable fromv0in the directed graphGq andv0is mapped to a rootπ(v0) ofI;

(c) yet other variablesv are mapped to non-rootsπ(v) ofI, but do not satisfy Condition (b).

The purpose of splittings is to describe such a partition without reference to a concrete model I and a concrete match π. Let K be an SHQ-knowledge base. A splitting of q w.r.t. K is a tuple Π = hR, T, S1, . . . , Sn, µ, νi, where R, T, S1, . . . , Sn is a partitioning of Var(q), µ:{1, . . . , n} →R assigns to each set Si a variable µ(i) in R, and ν : R → Ind(A) assigns to each variable in R an individual inA. A splitting has to satisfy the following conditions, whereq|V

denotes the restriction ofq toV ⊆Var(q):

(5)

1. the query q|T is a variable-disjoint union of tree-shaped queries;

2. the queries q|Si, 1≤i≤n, are tree-shaped;

3. if r(v, v0) ∈q, then one of the following holds: (i) v, v0 belong to the same setR, T, S1, . . . , Sn or (ii)v∈R,µ(i) =v, andv0 ∈Si is the root ofq|Si; 4. for 1≤i≤n, there is an atomr(µ(i), v0)∈q, withv0 the root ofq|Si. Intuitively, the R component of a splitting corresponds to Case (a) above, the S1, . . . , Sn correspond to Case (b), and T corresponds to Case (c).

Before we introduce spoilers, we establish a central lemma about splittings.

We start with some preliminaries. As already noted, we useSHQto denote the extension of SHQ with a role conjunction operator “∩”. However, we restrict the use of role conjunction to simple roles. Letq be a tree-shaped conjunctive query. We define aSHQ-conceptCq,v for each variablev∈Var(q):

– ifv is a leaf inGq, thenCq,v =

u

C(v)∈qC;

– otherwise,

Cq,v =

u

C(v)∈qCu

u

(v,v0)∈Eq

∃( \

s(v,v0)∈q

s).Cq,v0).

Ifvis the root ofq, we useCqto abbreviateCq,v. The following lemma establishes a connection between forest models and splittings of fork rewritings.

Lemma 2. Let K = (T,A) be a knowledge base, I a forest model of K, and q a conjunctive query. Then I |=q iff there exists a fork rewritingq0 of q and a splittinghR, T, S1, . . . , Sn, µ, νiof q0 w.r.t. K such that

1. for each disconnected componentqbofT, there is ad∈∆I withd∈(Cbq)I; 2. ifC(v)∈q0 with v∈R, thenν(v)I∈CI;

3. ifr(v, v0)∈q0 with v, v0∈R, then(ν(v)I, ν(v0)I)∈rI; 4. for1≤i≤n, we have

ν(µ(i))I ∈¡

∃( \

s(µ(i),v0)∈q0

s).Cq0|Si

¢I

withv0 root ofq0|Si.

Proof.For the “only if” direction, letI |=πq. We construct a fork rewritingq0 of qby exhaustively eliminating all forks r(v0, v), s(v00, v)∈qwith v0 6=v00 and π(v0) =π(v00). Now define a splittingΠ =hR, T, S1, . . . , Sn, µ, νiofq0 w.r.t.K as follows:

– v ∈R iffπ(v) is a root of I; setν(v) to some individual name a∈Ind(A) such thataI =π(v) (such anaexists by Point (iv) of the definition of forest models);

– v ∈ T iff there is no variable v0 such that π(v0) is a root of I and v is reachable fromv0 in the directed graphGq0;

– for each variablevsuch thatπ(v) is a non-root ofI and there is anr(v0, v)∈ q0 with π(v0) a root of I, generate a set Si. The elements of Si are those variables that are reachable in the directed graphGq0 fromv. We setµ(i) :=

v0 (thisv0 is unique by the construction ofq0 fromq).

(6)

It is not hard to see that R, T, S1, . . . , Sn is a partition of Var(q0). Moreover, it can be proved that Conditions 1 to 4 of splittings and Conditions 1 to 4 from Lemma 2 are also satisfied.

Conversely, assume that there is a fork rewriting q0 of q and a splitting hR, T, S1, . . . , Sn, µ, νi of q0 w.r.t. K such that Conditions 1 to 4 are satisfied.

Using Conditions 1-4 of splittings and the definition of the concepts Cqb and Cq0|Si, one can verify thatI |=πqfor someπwithπ(v) =ν(v)I for allv∈R.

❏ Let K = (T,A) be a SHQ-knowledge base, q a conjunctive query, and Π = hR, T, S1, . . . , Sn, µ, νia splitting ofqw.r.t.K such thatq1, . . . , qk are the (tree- shaped) disconnected components ofq|T. ASHQ-knowledge base (T0,A0) is a spoiler forq,K, andΠ if one of the following conditions hold:

1. > v ¬Cqi ∈ T0, for somei with 1≤i≤k;

2. there is an atom C(v)∈qwithv∈R and¬C(ν(v))∈ A0;

3. there is an atom r(v, v0)∈qwithv, v0∈R and¬r(ν(v), ν(v0))∈ A0; 4. ¬D(ν(µ(i)))∈ A0 for someiwith 1≤i≤n, and where

D=∃( \

s(µ(i),v0)∈q

s).Cq|Si withv0 root ofq|Si.

A SHQ-knowledge baseK0 = (T0,A0) is a spoiler forq andK if (i) for every fork rewritingq0 ofq and every splittingΠ of q0 w.r.t.K,K0 is a spoiler forq0, K, andΠ; and (ii)K0 is minimal with Property (i).

Lemma 3. LetK= (T,A)be aSHQ-knowledge base andqa conjunctive query.

ThenK 6|=qiff there is a spoiler(T0,A0)forqandKsuch that(T ∪ T0,A ∪ A0) is consistent.

Proof. (sketch) Assume thatK 6|=qand letI be a model of KwithI 6|=q. By Proposition 1, we may assume that I is a forest model. We can now assemble a spoiler K0 = (T0,A0) for q and K such that (T ∪ T0,A ∪ A0) is consistent by doing the following for every fork rewriting q0 of qand every splittingΠ = hR, T, S1, . . . , Sn, µ, νi of q0 w.r.t. K. By Lemma 2, I 6|= q implies that, for q0 and Π, at least one of Conditions 1 to 4 of Lemma 2 are violated. By the corresponding condition from the definition of a spoiler for q0, K, and Π, this gives us an axiom to add to K0 such that K0 is a spoiler forq0,K, andΠ.

Conversely, assume that there is a spoilerK0 = (T0,A0) for q and K such that (T ∪ T0,A ∪ A0) is consistent, and letIbe a model of (T ∪ T0,A ∪ A0). We can w.l.o.g. assume thatI is a forest model. Since I is a model ofK, it suffices to show thatI 6|=q. Assume to the contrary thatI |=q. By Lemma 2, there is a fork rewritingq0 ofqand a splittingΠ =hR, T, S1, . . . , Sn, µ, νiofq0 w.r.t.K such that Conditions 1 to 4 of Lemma 2 are satisfied. By definition of spoilers and sinceI is a model ofK0, this means that K0 is not a spoiler for q0, K, and Π. This is a contradiction toK0 being a spoiler forqandK. ❏

(7)

Lemma 3 suggests the following algorithm for deciding conjunctive query en- tailment in SHQ: given K = (T,A) and q, enumerate all spoilers (T0,A0) for q and K, return “yes” if for all such spoilers, (T ∪ T0,A ∪ A0) is inconsistent, and “no” otherwise. To prove that this algorithm runs inExpTime, we have to show that there are at most exponentially many spoilers forqandK(which can be computed in exponential time), that each spoiler is of size polynomial in the size ofqandK, and that consistency ofSHQ-knowledge bases can be decided in ExpTime. The latter can be proved by an easy variation of Lemma 6.19 in [14]. It relies on the fact that we restrict the application of role conjunction to simple roles.

Proposition 2. Consistency of SHQ-KBs is ExpTime-complete.

Now for the number and size of spoilers for q and K. We start with a central lemma about fork rewritings. For a conjunctive query q and v ∈ Var(q), let Reachq(v) denote the set of all variables in Var(q) that are reachable from v in the directed graphGq. Define

Trees(q) :={q|Reachq(v)|v∈Var(q) andq|Reachq(v)is tree-shaped}.

Clearly,

(†) forqthe maximal fork rewriting ofq, the cardinality ofTrees(q) is polyno- mial in the size ofq.

Together with the following lemma, this is a crucial observation. Proof details can be found in the full version [10].

Lemma 4. Let q be a conjunctive query, q0 a fork rewriting of q, and Π = hR, T, Sv1, . . . , Svn, µ, νi a splitting of q0 with q10, . . . , q0k the disconnected com- ponents of q0|T. Moreover, let q be the maximal fork rewriting of q. Then q0i∈Trees(q)for1≤i≤k andq0|Si ∈Trees(q)for1≤i≤n.

Together with (†), the next lemma implies that the size of each spoiler is polyno- mial in the size ofKandq. We say that a role conjunctions1∩ · · · ∩sp occursin a conjunctive queryqif there arev, v0 such that{r|r(v, v0)∈q}={s1, . . . , sp}.

The proof of the following lemma is based on the direct correspondence between Points 1-4 of Lemma 5 and q Points 1-4 of the definition of spoilers forqandK.

Lemma 5. Let K = (T,A) be aSHQ-knowledge base,q a conjunctive query, q its maximal fork rewriting, andK0= (T0,A0)a spoiler for qandK. ThenK0 contains only axioms of the following form:

1. > v ¬Cq0 withq0 ∈Trees(q);

2. ¬C(a, b)with a, b∈Ind(A)andC occurring inq;

3. ¬r(a, b) witha, b∈Ind(A) androccurring inq;

4. ¬D(a) with a ∈ Ind(A) and D = ∃(s1∩ · · · ∩sp).Cq0, where s1∩ · · · ∩sp

occurs inq andq0 ∈Trees(q);

It is now easy to establish the intended upper bounds on the number of spoil- ers. The set of all spoilers can be computed by a straightforward enumeration approach.

(8)

Lemma 6. LetK= (T,A)be aSHQ-knowledge base andqa conjunctive query.

Then the number of spoilers for q and K is exponential in the size of q and K and the set of all spoilers can be computed in time exponential in the size of q andK

We have thus established the desired ExpTimeupper bound. A corresponding lower bound is trivial to show by a reduction of concept satisfiability.

Theorem 1. Conjunctive query entailment inSHQis ExpTime-complete.

4 Rooted Query Entailment in SHIQ is in co- NExpTime

We show that rooted query entailment in SHIQis in co-NExpTime. Together with the lower bound in [9], we thus obtain co-NExpTime-completeness.

We start with some preliminaries. Arelaxed forest baseis defined in the same way as a forest base, except that Condition (ii) is relaxed as follows:

(ii)0 if (d, e)∈rJ, thene, d∈ ore=d·cord=e·cfor some c∈ .

Arelaxed forest model is then defined analogously to a forest model, but based on a relaxed forest base instead of a forest base. Thedegree of a relaxed forest baseI is the maximum cardinality of any setN ⊆ such that, for somed∈ , we have{d·c|c∈N} ⊆∆I, and the degree of a relaxed forest model is that of the underlying relaxed forest base. Note that if I is of degree k, it can have at mostk roots. We use |K|to denote the size of the knowledge baseK, i.e., the number of symbols needed to write it. Just as for Proposition 3, the proof of the following result is standard.

Proposition 3. Let K be aSHIQ-knowledge base and q a conjunctive query.

If K 6|=q, then there is a relaxed forest model I of K with degree at most 2|K|

and such that I 6|=q.

The main idea of ourNExpTime-algorithm for query non-entailment inSHIQ is as follows. LetKbe a knowledge base andqa conjunctive query. To show that K 6|= q, by Proposition 3 it suffices to find a forest model I of K with degree at most 2|K| such that I 6|=q. Now, the crucial observation is thatI 6|=q can be checked by looking only at an “initial part” of I. To see this, assume that I |=π q. For d∈∆I, thedepth ||d||ofdin I is the length of the word dminus 1. Since we are interested in rooted query containment andI is a forest model, q has at least one answer variable v and thus π(v) is a root of I. Since q is connected and contains only simple roles,||π(u)||is bounded by the size|q|ofq for everyu∈var(q). It follows that we can check whetherI |=qby looking only at elementsd∈∆I with||d|| ≤ |q|.

Thus, we can decide non-entailment of a queryq by a knowledge baseK by guessing an initial partJ of a forest model ofKsuch thatJ is of degree at most 2|K|and of depth at most|q|, and then verifying that (i)J does not matchqand (ii)J can indeed be extended to a full forest modelI ofK. When guessing the initial partJ, we also have to guess some additional information that is used to

(9)

ensure (ii). To describe this additional information, we introduce the notion of a type.

W.l.o.g., we assume that all concepts in the input knowledge baseK= (T,A) are in NNF, i.e., negation occurs only in front of concept names. For each concept C in NNF, we use ∼C to denote the NNF of ¬C, and clK(C) to denote the smallest set such that

1. C∈clK(C),

2. clK(C) is closed under subconcepts and∼, and

3. if∀r.D∈clK(C),K |=Trans(s), andK |=svr, then ∀s.D∈clK(C);

Let CT =

u

DvE∈T(∼DtE). The closure cl(K) ofK is defined as clK(CT)∪ S

C(a)∈AclK(C).

Definition 1. LetK= (T,A)be a knowledge base in NNF withT ={> vCT}.

A typeforK is a set t⊆cl(K)such that

– A∈t iff¬A /∈t, for all concept namesA∈cl(K);

– CuD∈t impliesC∈t andD∈t, for allCuD∈cl(K);

– CtD∈t impliesC∈t orD∈t, for allCtD∈cl(K);

– ∀r.D∈t,K |=Trans(s), andK |=svr implies∀s.D∈t;

– CT ∈t.

We now formalize the initial part of a forest model guessed by the algorithm, which we call a K, q-witness. In what follows, thedepth of a finite forest baseI is the maximum depth of all elements of ∆I.

Definition 2. LetK= (T,A)be a knowledge base in NNF andq a conjunctive query. AK, q-witnessis a pair(I, σ)withI a finite forest base of degree at most 2|K| and depth at most |q| andσ a mapping that assigns to each d∈∆I a type σ(d)forK such that for alld, e∈∆I,

1. d∈AI iffA∈σ(d), for all concept names A∈cl(K);

2. if∃r.C∈σ(d)and||d||<|q|, then there is ane∈∆I such that (d, e)∈rI andC∈σ(e);

3. if∀r.C ∈σ(d) and(d, e)∈rI, thenC∈σ(d);

4. if∀r.C ∈σ(d),(d, e)∈rI, andK |=Trans(r), then∀r.C∈σ(e);

5. if(>n r C)∈σ(d)and||d||<|q|, then there are at leastndistinct elements e1, . . . , en such that(d, ei)∈rI andC∈σ(ei)for1≤i≤n;

6. if (6n r C)∈ σ(d), then there are at most n distinct elements e1, . . . , en

such that(d, ei)∈rI andC∈σ(ei)for1≤i≤n;

7. ifr(a, b)∈ A, then(aI, bI)∈rI; 8. ifC(a)∈ A, then C∈σ(aI);

9. ifrvs∈ T, thenrI⊆sI; 10. I 6|=q.

Fix a concept name Az and a role name rz not occurring inK. Moreover, let RK be the set of all roles occurring inK. For d∈∆I with d=e·c,c∈ , and

||d||=|q|, define Cd:=

u

C∈σ(d)Cu ∃rz.(

u

C∈σ(e)CuAz)u

u

r∈RK|(d,e)/∈rI∀r.¬Az

(10)

TheK, q-witness(I, σ)isgoodiff for alld=e·c∈∆I as above,Cdis satisfiable w.r.t. the TBoxT ∪ {rzvr|(d, e)∈rI}.

Intuitively, aK, q-witness being “good” means that it can be extended to a full forest model of K. The use of both dande in the definition ofCd is similar to the use of double blocking in tableau algorithms forSHIQ, see e.g. [5].

For proving the following lemma, we need the notion of a tree model. An interpretationJ is calleda tree base if it is a forest base and there is a unique c∈ such that c∈∆J (called theroot ofJ). A model I of a concept C is a tree model ifI is theK-closure of a tree baseJ with rootc andc∈CI. Lemma 7. Let K be a knowledge base in NNF and q a conjunctive query. We haveK 6|=qiff there is a goodK, q-witness (I, q).

Proof. (sketch) For the “only if” direction, assume that K 6|= q. By Proposi- tion 3, there is a forest model I of K of degree at most 2|K| such that I 6|=q.

LetJ be the forest base underlyingI, and letJ0 be the restriction ofJ to the elements of∆J that are of depth at most|q|. Define a mappingσ, which assigns to each d∈∆J0 the set σ(d) :={C∈cl+(K)|d∈CI}. It can be verified that (J0, σ) is a goodK, q-witness.

For the “if” direction, assume that there is a goodK, q-witness (I, σ). Let d1, . . . , dk be the elements in∆I such that||di||=|q|. Moreover, letdi =ei·ci

for 1≤i≤k. Since (I, σ) is good, we know that there are modelsI1, . . . ,Ik for Cd1, . . . , Cdk, respectively. We may w.l.o.g. assume that these models are tree models. For 1≤i≤k, letri be the root ofIi and letwi∈∆Ii be such that

(ri, wi)∈rzIi andwi∈(

u

C∈σ(e)CuAz)Ii.

Suchwiexist by definition ofCdi. ModifyI1, . . . ,Ikinto interpretationsI10, . . . ,Ik0 by dropping from eachIithe rootriand all elements from{wi. Now rename the elements ofI10, . . . ,Ik0 such that, for 1≤i < j ≤k, we have ∆I0i∩∆I =∅ and∆I0i∩∆I0j =∅. Define a new interpretationJ as the disjoint union ofIand I10, . . . ,Ik0. Next, modifyJ into an interpretationJ0 by setting

rJ :=rJ0∪ {(di, d)|(ri, d)∈rIi and 1≤i≤k}

∪ {(d, di)|(d, ri)∈rIi and 1≤i≤k}.

Finally, letI0 be the K-closure of J0. It is possible to show that I0 is a model

ofK andI06|=q. ❏

By Lemma 7, the following algorithm decides non-entailment of a query q by a knowledge baseK: guess a pair (I, σ) with I a forest base of degree at most 2|K|and depth at most|q|andσa mapping that assigns to eachd∈∆I a type σ(d) forK. Then check whether (I, σ) is a goodK, q-witness, return “yes” if it is and “no” otherwise. Since the degree of I is at most 2|K| and the depth at most |q|, the size of (I, σ) is exponential in |K|+|q|. Checking whether (I, σ) is aK, q-witness by verifying Conditions 1-12 from Definition 2 can be done in time exponential in |K|+|q|. Since the concepts Cd are of size polynomial in

(11)

|K|+|q|and satisfiability inSHIQ can be decided inExpTime, we can check in exponential time whether (I, q) is good. We thus obtain the following result.

Theorem 2. Rooted query entailment inSHIQ is co-NExpTime-complete.

References

1. D. Calvanese, G. De Giacomo, and M. Lenzerini. On the decidability of query containment under constraints. InProc. of PODS’98, pages 149–158, 1998.

2. D. Calvanese, G. D. Giacomo, D. Lembo, M. Lenzerini, and R. Rosati. Data complexity of query answering in description logics. In Proc. of KR’06, pages 260–270. AAAI Press, 2006.

3. B. Glimm, I. Horrocks, I., and U. Sattler. Conjunctive query entailment forSHOQ.

InProc. of DL’07, volume 250 of CEUR-WS, 2007.

4. B. Glimm, C. Lutz, I. Horrocks, and U. Sattler. Answering conjunctive queries in theSHIQdescription logic. JAIR, 31:150–197, 2008.

5. I. Horrocks, U. Sattler, and S. Tobies. Practical reasoning for expressive description logics. InProc. of LPAR’99, number 1705 in LNAI, pages 161–180. Springer, 1999.

6. I. Horrocks, U. Sattler, and S. Tobies. Reasoning with individuals for the descrip- tion logic SHIQ. In Proc. of CADE-17, number 1831 in LNCS, pages 482–496.

Springer, 2000.

7. U. Hustadt, B. Motik, and U. Sattler. Data complexity of reasoning in very ex- pressive description logics. InProc. of IJCAI’05, pages 466–471. Professional Book Center, 2005.

8. M. Kr¨otzsch, S. Rudolph, and P. Hitzler. Conjunctive queries for a tractable fragment of OWL 1.1. InProc. of ISWC’07, volume 4825 of LNCS, pages 310-323.

Springer, 2007.

9. C. Lutz. Inverse roles make conjunctive queries hard. InProc. of DL2007, volume 250 ofCEUR-WS, 2007.

10. C. Lutz. Two Upper Bounds for Conjunctive Query Answering in (Fragments of) SHIQ. Available from http://lat.inf.tu-dresden.de/∼clu/papers/

11. M. Ortiz, D. Calvanese, and T. Eiter. Characterizing Data Complexity for Con- junctive Query Answering in Expressive Description Logics. InProc. of AAAI’07.

AAAI Press, 2007.

12. M. Ortiz, M. ˇSimkus, and T. Eiter. Worst-case Optimal Conjunctive Query An- swering for an Expressive Description Logic without Inverses. InProc. of AAAI’08.

AAAI Press, 2008.

13. A. Schaerf. On the complexity of the instance checking problem in concept lan- guages with existential quantification. JIIS, 2:265–278, 1993.

14. S. Tobies. Complexity Results and Practical Algorithms for Logics in Knowledge Representation. PhD thesis, RWTH Aachen, 2001.

Références

Documents relatifs

Conjunctive query answering (CQA) is the task of finding all answers of a CQ, and query entailment is the problem of deciding whether an ontology entails a given Boolean CQ by

The DL-Lite family consists of various DLs that are tailored towards conceptual modeling and allow to realize query answering using classical database techniques.. We only

Here we show that the problem is ExpTime -complete and, in fact, deciding whether two OWL 2 QL knowledge bases (each with its own data) give the same answers to any conjunctive query

Specifically, we show that consistent query answering is always first-order expressible for conjunctive queries with at most one quantified variable; the problem has polynomial

It can answer queries efficiently over Horn- SHIQ ontologies and scales down nicely to DL-Lite, where it is competitive with state of the art query rewriting systems.. – The

It is interesting to note that the techniques from this paper can be used to reprove in a transparent way the ExpTime upper bound for CQ answering over S knowledge bases that

We present a query processing procedure for conjunctive queries in distributed ontology systems where a large ontology is di- vided into ontology fragments that are later

We consider DL-Lite N horn , the most expressive dialect of DL-Lite that does not include role inclusions and for which query answering is in AC 0 for data complexity; for relations