• Aucun résultat trouvé

On Queries with Inequalities in DL-LiteR≠

N/A
N/A
Protected

Academic year: 2022

Partager "On Queries with Inequalities in DL-LiteR≠"

Copied!
12
0
0

Texte intégral

(1)

On queries with inequalities in DL-Lite

6=R

Gianluca Cima1, Federico Croce1, Maurizio Lenzerini1, Antonella Poggi2,1, Elian Toccacieli1

1Dipartimento di Ingegneria Informatica, Automatica e Gestionale “Antonio Ruberti”

2Dipartimento di Lettere e Culture Moderne Sapienza Universit`a di Roma

lastname@diag.uniroma1.it

Abstract. It is well-known that answering conjunctive queries with inequalities (CQ6=s) overDL-LiteRontologies is in general undecidable. In this paper we consider the subclass of CQ6=s, called CQ6=,bs, where inequalities involve only distinguished variables or individuals. In particular, we tackle the problem of an- swering CQ6=,bs and unions thereof (UCQ6=,bs) overDL-Lite6=Rontologies, where DL-Lite6=Rcorresponds toDL-LiteRwithout the Unique Name Assumption, and with the possibility of asserting inequalities between individuals, as inOWL 2 QL. As a first contribution, we show that answering CQ6=,bs overDL-Lite6=Rontologies has the same computational complexity as the UCQ case overDL-LiteR, i.e., it is in AC0in data complexity, in PTIMEin TBox complexity, and NP-complete in combined complexity. We then deal with the UCQ6=,bcase, and prove that an- swering UCQ6=,bs overDL-Lite6=Rontologies is still in AC0 in data complexity and in PTIMEin TBox complexity, but isΠ2p-hard in combined complexity.

1 Introduction

DL-LiteR is the Description Logic (DL) of the DL-Lite family [6] which underpins theOWL 2profileOWL 2 QL[16]. It is arguably one of the most important formalisms of choice for representing ontologies in Ontology-based Data Access (OBDA) [18, 22]

scenarios, where the aim is to access a typically huge amount of data residing in external data sources. In particular, DL-LiteR has been designed so that answering unions of conjunctive queries (UCQs) can be reduced to evaluating first-order logic queries over the database storing the ABox assertions, and therefore is in AC0 with respect to the size of the ABox, i.e., in the so-calleddata complexity[21].

While answering UCQs overDL-LiteRontologies has been extensively studied in recent years (e.g., by establishing bound on the size of rewritings [10], developing opti- misation algorithms [19], and implementing systems for real-world applications [4, 5]), we argue that not much is known about the problem of answering conjunctive queries with inequalities (CQ6=s) and unions thereof (UCQ6=s). To the best of our knowledge, the basic facts that are known about these latter cases can be summarised as follows:

– In stark contrast to the UCQ case, answering CQ6=s overDL-LiteRontologies is in general undecidable [12].

(2)

– For subclasses of CQ6=s and UCQ6=s, namedlocalCQ6=s andlocalUCQ6=s, re- spectively, query answering overDL-LiteRontologies is decidable, but with a high

CONEXPTIME upper bound in data complexity. Furthermore, it is provably in- tractable (in general coNP-hard in data complexity) already forlocalCQ6=s [12].

– For the subclass of CQ6=with bounded inequalities (called CQ6=,b), where inequali- ties involve only individuals or distinguished variables, query answering overDL-LiteR

ontologies is in PTIMEin data complexity and in EXPTIMEin combined complex- ity [17].

Observe that all the above results hold regardless of whether theUnique Name As- sumption(UNA) is enforced or not. Also, it is immediate to see that, for DL-LiteR, they do not provide the answer to the question whether answering CQ6=,bs and unions thereof (UCQ6=,bs) has the same complexity as the UCQ case.

As a first consideration on these classes of queries, we observe that, differently from the UCQ case [3], query answering overDL-LiteR ontologies is sensitive to the adoption of the UNA, even for CQ6=,bs, as shown in following example.

Example 1. Consider theDL-LiteR ontology O = hT,Ai, whereT = ∅andA = {P(a, b)}. For the CQ6=,bq={(x, y)|P(x, y)∧x6=y}, it is easy to see that the tuple ha, biis in the certain answers ofqoverOunder the UNA, while it is not if the UNA is not enforced. Indeed, for the modelMofOwithaM=bM=eandPM={(e, e)}, that does not respect the UNA, we have thatqM=∅. ut Notice, however, that answering UCQ6=,bs overDL-LiteRontologies under the UNA is a straightforward generalisation of the UCQ case.

Proposition 1. Answering UCQ6=,bs over DL-LiteR ontologies under the UNA is in AC0in data complexity, inPTIMEin TBox complexity, and NP-complete in combined complexity.

Therefore, in what follows, we implicitly assume that the UNA is not enforced. In particular, in this paper we consider the DLDL-Lite6=R, which extendsDL-LiteRwith the possibility of asserting inequalities between individuals, as in OWL 2 QL, and we present the following results:

– Answering CQ6=,bs overDL-Lite6=R ontologies has the same computational com- plexity of the UCQ case, i.e., it is in AC0in data complexity, in PTIME in TBox complexity, and NP-complete in combined complexity (cf. Theorem 2).

– Answering UCQ6=,bs overDL-Lite6=Rontologies isΠ2p-hard in combined complex- ity (cf. Theorem 3).

– Answering UCQ6=,bs overDL-Lite6=R ontologies is in AC0 in data complexity, in PTIMEin TBox complexity, and in EXPTIMEin combined complexity (cf. Theo- rem 4).

Several recent works investigate the problem of answering UCQs overDL-LiteR

ontologies [3, 6, 13], and answeringSPARQLqueries overOWL 2 QLontologies [2, 11, 14, 15]. However, none of them deal with queries containing inequalities. Conversely, inequality is considered in [7,8,12,17]. As we said before, a crucial result in [12] shows

(3)

that answering queries with inequalities overDL-LiteR ontologies is in general unde- cidable. In [7, 8] the authors prove that answering UCQ6=s overOWL 2 QLontologies under theDirect Semantics Entailment Regime[9] (i.e., the regime usually adopted for SPARQLqueries) can be polynomially reduced to the evaluation of a Datalog program, and therefore is in PTIMEin data complexity, and in EXPTIMEin combined complex- ity. As already mentioned, in [17] the author shows that the same results hold also for CQ6=,bs under the standard semantics.

The paper is organized as follows. In Section 2 we provide some preliminaries on the languages considered in the paper. In Section 3 we illustrate the notion of chase that we use for DL-Lite6=R, and some related technical results. In Section 4 and Section 5 we present our results on CQ6=,bs and UCQ6=,bs, respectively. Finally, in Section 6 we conclude the paper with a discussion on future work.

2 Preliminaries

In this section, we first formally define the syntax and the semantics ofDL-Lite6=R, and then we present the query languages considered in this paper.

Ontology language. Essentially, DL-Lite6=R extends DL-LiteR with the possibility of asserting inequalities between individuals. Formally, starting with an alphabet ofindi- viduals,atomic concepts, andatomic roles, that includes the binary relation symbol6=, aDL-Lite6=Rontology, or simply an ontology, is a pairO=hT,Ai, such thatT, called TBox, andA, calledABox, are sets of axioms, that have, respectively, the following forms:

T :B1vB2 R1vR2 (concept/role inclusion) B1v ¬B2 R1v ¬R2 (concept/role disjointness) A:A(a) P(a, b) (concept/role membership)

a6=b (inequality)

wherea, bdenoteindividuals,AandP denote an atomic concept and an atomic role, respectively,B1, B2arebasic concepts, i.e., expressions of the formA,∃P, or∃P, andR1andR2arebasic roles, i.e., expressions of the formP, orP.

The semantics of aDL-Lite6=R ontologyOis specified through the notion of inter- pretation. An interpretation for O is a pair I = h∆IIi, where theinterpretation domain∆Iis a non-empty, possibly infinite set of objects, and theinterpretation func- tion·Iassigns to each individualaa domain objectaI ∈∆I, to each atomic concept Aa set of domain objectsAI ⊆∆I, to each atomic role a set of pairs of domain ob- jectsPI ⊆∆I×∆I, and to the special predicate “6=” the set of all pairs of distinct domain objects, i.e.,6=I= {(o1, o2) | o1, o2 ∈ ∆I ∧o1 6= o2}. The interpretation function extends to the other basic concepts and the other other basic roles as follows:

(i)(∃P)I ={o| ∃o0.(o, o0)∈ PI}, (ii)(∃P)I ={o | ∃o0.(o0, o)∈ PI}, and (iii) (P)I={(o, o0)|(o0, o)∈PI}.

An interpretationI satisfies a concept inclusionB1 v B2 (respectively, role in- clusionR1 v R2) ifBI1 ⊆ B2I (respectively, RI1 ⊆ RI2), and it satisfies a concept disjointnessB1 v ¬B2(respectively, role disjointness R1 v ¬R2) ifB1I∩B2I =∅ (respectively,RI1∩RI2 =∅). An interpretationIsatisfies aDL-LiteRTBoxT if it satis- fies every axiom inT. An interpretationIsatisfies aDL-Lite6=RABoxAif (i)aI∈AI

(4)

for everyA(a)∈ A, (ii)(aI, bI)∈PIfor everyP(a, b)∈ A, and (iii)aI 6=I bIfor everya 6= b ∈ A. Finally, aDL-Lite6=R ontologyO =hT,Aiissatisfiableif it has a model, where amodelis an interpretationI forOthat satisfies both the TBoxT and the ABoxA.

Query language.Aconjunctive query with inequalities (CQ6=)over aDL-Lite6=Rontol- ogyOis an expression of the formq = {x| φ(x,y)}, wherexandyare tuples of variables, calleddistinguishedandexistentialvariables ofq, respectively, andφ(x,y), called the bodyof q, is a finite conjunction ofDL-Lite6=R ABox assertions with vari- ables that can appear in predicate arguments, i.e., atoms of the formA(t1),P(t1, t2), or t16=t2, where eachtjis either an individual ofO, or a variable inxory. We impose that every variable inxoryappears in some atom ofφ(x,y). Ifxis empty, then the query is calledboolean. A CQ6= qwithout atoms of the formx1 6= x2 in its body is called a conjunctive query (CQ). An intermediate class of queries that lies between CQs and CQ6=s is the class ofconjunctive queries with bound inequalities (CQ6=,b). Specifi- cally, a CQ6=,bq={x|φ(x,y)}is a CQ6=whose inequalities involve only individuals or distinguished variables, i.e., for every atomz1 6=z2appearing inφ(x,y), bothz1 andz2are not iny. An UCQ (resp., UCQ6=,b, UCQ6=) is a union of a finite set of CQs (resp., CQ6=,b, CQ6=) with same arity.

The set ofcertain answersof an UCQ6=qover aDL-Lite6=RontologyO, denoted by cert(q,O), is the set ofn-tuplestof individuals such thattI ∈qI for every modelI ofO, wheretI =htI1, . . . , tInifort=ht1, . . . , tni, andqIdenotes the evaluation ofq overIseen as a relational database [1]. Whenqis a boolean query, we writeO |=qif qI ={hi}(i.e.,qistrueinI, also denoted byI |=q) for every modelIofO. Observe that, ifOis unsatisfiable, thencert(q,O)is trivially the set of all possiblen-tuples of individuals, wherenis the arity ofq(ex falso quodlibet).

When we talk about the problem of answering a class of queriesQover a class of DL ontologiesL, in fact we implicitly refer to the followingdecision problem (also known as therecognition problem): Given a queryqin the classQ, anL-ontologyO, and ann-tuple oftof individuals ofO, check whethert∈cert(q,O).

DL-LiteR.It is well-known (see e.g., [6]) that aDL-LiteRontologyOis satisfiable if and only if cert(VO,Op) = ∅, whereOp is obtained fromO by removing the dis- jointness axioms, andVO is theO-violation query, i.e., the boolean UCQ obtained by including a CQ of the form {() | A1(x)∧A2(x)} (resp., {() | A1(x)∧R(x, y)}, {()|R1(x, y)∧R2(x, z)}, and{()|R1(x, y)∧R2(x, y)}) for each disjointness axiom A1 v ¬A2(resp.,A1 v ¬∃Ror∃R v ¬A1,∃R1 v ¬∃R2, andR1v ¬R2), where an atom of the formR(x, y)stands for eitherP(x, y)ifRdenotes an atomic roleP, or P(y, x)ifRdenotes the inverse of an atomic role, i.e.,R=P.

It is also well-known that ifq is an UCQ over a satisfiable DL-LiteR ontology O=hT,Ai, thenPerfectRef(q,T)(wherePerfectRefis the algorithm described in [6]) computes an UCQ whose evaluation overdb(A)(i.e., the ABoxAseen as a relational database) returns exactly cert(q,O), that is, (PerfectRef(q,T))db(A) = cert(q,O).

Note that the algorithmPerfectRefignores the disjointness axioms inO.

(5)

3 The chase for DL-Lite

6=R

The conceptual tool that we use for addressing the problem of answering UCQ6=,bs over DL-Lite6=Rontologies is a modification of the chase used forDL-LiteR[6]. Specifically, given aDL-Lite6=RontologyO=hT,Ai, we build a (possibly infinite) structure, starting fromChase0(O) =A, and repeatedly computingChasej+1(O)fromChasej(O)by applying suitable rules, where each rule can be applied only if certain conditions hold.

In doing so, we make use of a new infinite alphabetV of variables for introducing fresh unknown individuals, and we follow a deterministic strategy that is fair, i.e., it is such that if at some point a rule is applicable then it will be eventually applied. Finally, we setChase(O) =S

i∈NChasei(O). Observe that we make use of the additional binary predicate symbolineq, which is used to record all inequalities logically implied byO.

The rules we use include all the ones illustrated in [6]. For example, if A1 v

∃P ∈ T,A1(a)is in Chasej(O), and there does not exist any b such that P(a, b) is inChasej(O), then we setChasej+1(O) =Chasej(O)∪ {P(a, s)}, wheres∈V does not appear inChasej(O). There are, however, crucial additions related to theineq predicate. In what follows, when we say thatB(a)is inChasej(O), whereBis a basic concept, we meanA(a) ∈Chasej(O)ifB =A,P(a, b) ∈ Chasej(O)for someb, ifB = ∃P, orP(b, a) ∈ Chasej(O)for someb, ifB = ∃P. Also, when we say R(a, b)is inChasej(O), whereRis a basic role, we meanP(a, b) ∈Chasej(O), if R=P, orP(b, a)∈Chasej(O), ifR=P. The additional rules are as follows:

– Ifa6=bis inChasej(O), andineq(a, b)is not inChasej(O), then Chasej+1(O) =Chasej(O)∪ {ineq(a, b)};

– Ifineq(a, b)is inChasej(O), andineq(b, a)is not inChasej(O), then Chasej+1(O) =Chasej(O)∪ {ineq(b, a)};

– if B1 v ¬B2 ∈ T, B1(a), B2(b) are in Chasej(O), and ineq(a, b) is not in Chasej(O), thenChasej+1(O) =Chasej(O)∪ {ineq(a, b)};

– ifR1 v ¬R2 ∈ T,R1(c, a), R2(c, b)are inChasej(O), andineq(a, b)is not in Chasej(O)thenChasej+1(O) =Chasej(O)∪ {ineq(a, b)}.

FromChase(O)it is immediate to define an interpretationIO forO, extended in order to deal with predicateineq, as follows:

– ∆IO =VO∪V, whereVOis the set of individuals occurring inO;

– eIO =efor every individualo∈∆IO;

– AIO ={e|A(e)occurs inChase(O)}for every atomic conceptA;

– PIO ={(e1, e2)|P(e1, e2)occurs inChase(O)}for every atomic roleP;

– ineqIO ={(e1, e2)|ineq(e1, e2)occurs inChase(O)}.

Note that, by definition,6=IOis the set of all pairs of distinct individuals in(VO∪V), i.e.6=IO={(e1, e2)|e1, e2∈(VO∪V)∧e16=e2}.

The next proposition shows that the interpretationIOplays a crucial role inDL-Lite6=R. Proposition 2. IfM = h∆MMiis a model of a DL-Lite6=R ontologyO, then there exists a functionΨfrom∆IO =VO∪V to∆Msuch that:

1. for everye∈∆IO, ife∈AIO, thenΨ(e)∈AM;

(6)

2. for every paire1, e2∈∆IO, if(e1, e2)∈PIO, then(Ψ(e1), Ψ(e2))∈PM; 3. for every paire1, e2∈∆IO, if(e1, e2)∈ineqIO, thenΨ(e1)6=Ψ(e2).

Proof (Sketch). The proofs of 1. and 2. are similar to that of Lemma 28 of [6]. The proof of 3. is based on showing that the interpretationIO enjoys the following crucial property: for every pair of individualsa, b∈VO,(a, b)∈ineqIOif and only if forevery

modelMofO,aM6=bM. ut

The above proposition shows the role of predicateineq, and the importance of distin- guishing between6=andineq. Indeed, since inIOtwo different elementse1, e2satisfy e16=e2, condition 3 in Proposition 2 does not hold with6=in place ofineq.

Note that ifIO satisfies all the axioms ofO, then it is a model ofO, and therefore Ois satisfiable. Otherwise, it can be seen thatIO violates at least one disjointness or one inequality axiom ofO. Note in particular thatIO violates a disjointness axiom if and only if (VO)IO 6= ∅, whereVO is theO-violation query (cf. Section 2). On the other hand, by construction,IO violates an inequality axiom if and only if there exists ein(VO∪V)such thate6=eoccurs inO. In both cases, by Proposition 2, there exists no interpretation that can be a model forO, and henceOis unsatisfiable. Intuitively, this shows that similarly to the “canonical interpretation” of aDL-LiteRontology,IO is instrumental for checking the satisfiability of aDL-Lite6=RontologyO. Also, checking the satisfiability of aDL-Lite6=RontologyO=hT,Aican be done in AC0in the size of Aand in PTIMEin the size ofT, exactly lime inDL-LiteR.

In what follows we implicitly assume to deal only with satisfiableDL-Lite6=R on- tologies. Also, we denote byδ(q)the query obtained by replacing each inequality atom t16=t2inqwith the atomineq(t1, t2). The next theorem states thatIOis instrumental also for answeringCQ6=,bs overDL-Lite6=Rontologies.

Theorem 1. IfOis a DL-Lite6=Rontology, andqis a CQ6=,boverO, thencert(q,O) = δ(q)IO.

Proof (Sketch).Ift∈δ(q)IO, then, based on Proposition 2, we can show thatt∈qM, for every modelMofO.

Ift 6∈ δ(q)IO, andtdoes not satisfy inIO all atoms ofδ(q)different fromineq atoms, thenIOis itself a model ofOshowing thatt6∈cert(q,O). On the other hand, iftsatisfies inIO all atoms ofδ(q)different fromineqatoms, then there is at least one atom of the form ineq(a, b)inδ(q)that is false inIO. What we do in this case is to compute an interpretationJ fromIO, whereaJ andbJ coincide, and then we show thatJ is a modelMofOsuch thatt6∈qM, thus showing thatt6∈cert(q,O). ut

4 Answering CQ

6=,b

s over DL-Lite

6=R

ontologies

In this section, we study the problem of answering CQ6=,bs overDL-Lite6=Rontologies.

To this aim, we start by introducing some preliminary notation.

Given an inequality atomx1 6= x2 and a disjointness axiom γ,ρ(x1 6= x2, γ), denotes the formula defined as follows:

(7)

– ρ(x16=x2, A1v ¬A2) =A1(x1)∧A2(x2),

– ρ(x16=x2, Av ¬∃R) =ρ(x16=x2,∃Rv ¬A) =A(x1)∧R(x2, z), wherezis a fresh variable,

– ρ(x1 6= x2,∃R1 v ¬∃R2) = R1(x1, z)∧R2(x2, w), wherez andware fresh variables, and

– ρ(x16=x2, R1v ¬R2) =R1(x1, z)∧R2(x2, z)∨R1(z, x1)∧R2(z, x2).

where an atom of the formR(x, y)stands for eitherP(x, y)ifRdenotes an atomic role P, orP(y, x)ifRdenotes the inverse of an atomic role, i.e.,R=P.

Given an inequality atomx16=x2and a TBoxT with disjointness axiomsγ1, . . . , γm, we denote byσ(x16=x2,T)the disjunction

ineq(x1, x2)∨ineq(x2, x1)∨ _

γi∈T

(ρ(x16=x2, γi)∨ρ(x26=x1, γi))

Finally, we denote byτ(q,T)the query obtained fromqby substituting every in- equality x1 6= x2 by σ(x1 6= x2,T), and then turning the resulting query into an equivalent union of CQs.

In Fig. 1, we present the algorithmAnsCQ6=,b(q,O)for computing the certain an- swers to a CQ6=,bqover aDL-Lite6=RontologyO=hT,Ai.

Informally, the algorithm rewritesq into the UCQτ(q,T), applies the algorithm PerfectRefdescribed in [6] toτ(q,T), and then evaluates the resulting UCQ over the databasedbineq(A). Such database stores the objectc(resp. the tuplec1, c2) in the table A(resp.R), for each assertionA(c)(resp.R(c1, c2)) inA, and stores the pair(c1, c2) in the tableineqfor each assertionc16=c2inA.

AlgorithmAnsCQ6=,b(q,O)

Input:n-ary CQ6=,bq,DL-Lite6=RontologyO=hT,Ai Output:a set ofn-tuples of individuals ofO

begin

P R:=τ(q,T)

P R:=PerfectRef(P R,T) returnP Rdbineq(A) end

Fig. 1: The algorithmAnsCQ6=,b(q,O)

Example 2. Consider theDL-Lite6=RontologyO=hT,AiwithT ={P1 vP2, A1v

¬A2}, and the CQ6=,b

q={(x1, x2)|P2(x1, x2)∧x16=c}

overO. It is easy to see thatσ(x1 6=c,T)is the formulaineq(x1, c)∨ineq(c, x1)∨ A1(x1)∧A2(c)∨A2(x1)∧A1(c)andτ(q,T) ={(x1, x2)|P2(x1, x2)∧ineq(x, c)∨

(8)

P2(x1, x2)∧ineq(c, x1)∨P2(x1, x2)∧A1(x1)∧A2(c)∨P2(x1, x2)∧A1(c)∧A2(x)}.

Finally,PerfectRef(τ(q,T),T)is{(x1, x2) | P2(x1, x2)∧ineq(x, c)∨P2(x1, x2)∧ ineq(c, x1)∨P2(x1, x2)∧A1(x1)∧A2(c)∨P2(x1, x2)∧A1(c)∧A2(x)∨P1(x1, x2)∧

ineq(x, c)∨P1(x1, x2)∧ineq(c, x1)∨P1(x1, x2)∧A1(x1)∧A2(c)∨P1(x1, x2)∧

A1(c)∧A2(x). ut

Proposition 3. IfO=hT,Aiis a DL-Lite6=Rontology, andqis a CQ6=,boverO, then AnsCQ6=,b(q,O)terminates and computes exactlycert(q,O).

Taking into account the computational complexity of algorithmAnsCQ6=,b, the above proposition implies that answering CQ6=,bs overDL-Lite6=Rontologies has the same data and combined complexity as answering UCQs overDL-LiteRontologies.

Theorem 2. Answering CQ6=s over DL-Lite6=Ris in AC0in data complexity, inPTIME

in TBox complexity, and NP-complete in combined complexity.

5 Answering UCQ

6=,b

s over DL-Lite

6=R

ontologies

In this section, we study the problem of answering UCQ6=,bs overDL-Lite6=Rontologies.

Observe that, differently from the UCQ case where for any UCQQ=q1∪ . . . ∪qn

and anyDL-LiteRontologyOwe have thatcert(Q,O) =cert(q1,O)∪. . .∪cert(qn,O) [6], the next example shows that this is not the case if we consider UCQ6=,bs.

Example 3. Consider theDL-LiteR ontology O = hT,Ai, whereT = ∅andA = {P(a, b)}. For the boolean UCQ6=,b Q = q1∪q2, where q1 = {() |P(a, a)} and q2 ={()|a 6= b}, it is easy to see thatO |= Q. Indeed, for any modelMofO, if aM = bM, thenM |= q1, otherwiseaM 6= bM, thenM |= q2. Notice, however, that bothO 6|=q1andO 6|=q2hold. For the former, it is sufficient to simply consider a modelM1 ofOin whichaM1 6= bM1. For the latter, it is sufficient to consider a modelM2ofOin whichaM2 =bM2 =eandPM2={(e, e)}. ut The next theorem implies that, unless the polynomial hierarchy collapses to the first level, answering UCQ6=,bs overDL-LiteRontologies does not have the same combined complexity of the UCQ and CQ6=,bcases.

Theorem 3. Answering UCQ6=,bs over DL-LiteR ontologies isΠ2p-hard in combined complexity.

Proof (Sketch).The proof ofΠ2p-hardness is by a LOGSPACE reduction from the∀∃-

CNF problem, which isΠ2p-complete [20]. ut

In order to present our positive results for the UCQ6=,bcase, next we introduce the notion ofe-satisfiability for an equivalence relatione. An equivalence relationeon a set of individualsC is a binary relation overCthat is reflexive, symmetric, and transitive.

In what follows, we writec1e c2to denote(c1, c2) ∈e. Moreover, we denote by Oe=hT,AeitheDL-Lite6=Rontology obtained fromOby addingeto the signature of Oas a new atomic role, and withAebeing the ABox obtained fromAby adding the extension of the relatione, i.e.,Ae=A ∪e.

(9)

Definition 1. LetO=hT,Aibe a DL-Lite6=Rontology,ebe an equivalence relation on a setCof individuals ofO, andIbe a model ofO. Then, we say thatIis ane-model of Oif, for any pair of constantsc1, c2∈ C, we have thatcI1 =cI2 if and only ifc1ec2. Also, we say thatOise-satisfiable if it has ane-model.

The next proposition states that checking for thee-satisfiability has the same com- putational complexity of checking the satisfiability.

Proposition 4. LetO=hT,Aibe a DL-Lite6=Rontology, and letebe an equivalence relation on a set of constantsCofO. Checking whetherOise-satisfiable can be done in AC0in the size ofAand inPTIMEin the size ofT.

Proof (Sketch).LetVO6=,ebe theOe-violation query obtained by extending the boolean UCQVOwith the following CQs over the signature ofOe:

– {()|A1(x1)∧A2(x2)∧e(x1, x2)}for each axiom of the formA1v ¬A2, – {()| A(x1)∧R(x2, y)∧e(x1, x2)}for each axiom of the formAv ¬∃Ror of

the form∃Rv ¬A,

– {()|R1(x1, y)∧R2(x2, z)∧e(x1, x2)}for each axiom of the form∃R1v ¬∃R2, – {()|R1(x1, y1)∧R2(x2, y2)∧e(x1, x2)∧e(y1, y2)}for each axiom of the form

R1v ¬R2,

where an atom of the formR(x, y)stands for eitherP(x, y)ifRdenotes an atomic role P, orP(y, x)ifRdenotes the inverse of an atomic role, i.e.,R=P.

It can be readily seen that a DL-Lite6=R ontology O is e-satisfiable if and only if cert(VO6=,e,Ope) =∅and there exists noa6=boccurring inAsuch thata∼eb.

Intuitively, for checkinge-satisfiability we check whether the equivalence relatione contradicts a disjointness, or an inequality axiom. This also directly implies that check- ing whetherOise-satisfiable can be done by evaluating a suitable query overdbineq(A), and therefore the problem is in AC0in the size of the ABoxAand in PTIMEin the size

of the TBoxT, as required. ut

Based on the above result, in Fig. 2 we provide the algorithmAnsUCQ6=,b(Q,O)for the problem of answering UCQ6=,bs overDL-LiteRontologies. Observe that it is enough to consider only boolean UCQ6=,bs. Indeed, given a UCQ6=,bQ, aDL-Lite6=R ontology O = hT,Ai, and ann-tupletof individuals ofO of the same arity ofQ, checking whethert∈cert(Q,O)is equivalent to checking whetherO |=Q(t), whereQ(t)de- notes the boolean UCQ6=,bobtained by replacing appropriately the distinguished vari- ables of each CQqinQwith the individuals oft.

Moreover, note that every boolean UCQ6=,bQis such that every inequality appear- ing in its body is of the forma6= b, where bothaandbare individuals ofO. In the algorithm, we denote byej(q)the function that, given a CQq, returns the set of existen- tial variables that appears more than two times in the body ofq, i.e., the set of existential variables that are in join.

Intuitively, to say thatO 6|= Q, the algorithm seeks for a relationψ between the individuals appearing inQfor which (i) the ontologyOise-satisfiable, whereeis the equivalence relation induced byψ, and (ii) the reformulated UCQQis not entailed by Oe. In particular,Qis first reformulated by evaluating every inequality based on the

(10)

AlgorithmAnsUCQ6=,b(Q,O)

Input:a boolean UCQ6=,bQ, and aDL-Lite6=RontologyO=hT,Ai Output: trueorfalse

begin

letCQbe the set of all individuals appearing inQ for eachψ⊆(CQ× CQ):

letebe the reflexive, symmetric, and transitive closure ofψ ifOise-satisfiablethen

for eachq∈Qand inequality atomc16=c2∈q:

ifc1ec2then q=q\ {c1 6=c2} else

Q=Q\ {q}

Q0=Q

for eachqinQ0,Y ⊆ej(q), andy∈ Y:

lety1, . . . , ymy denote the different occurrences ofyinq

replace each occurrenceyjof the variableywith a fresh existential variablezj for eachpair of newly introduced variableszk, zlwithk6=l:

q=q∪ {e(zik, zil)}

Q=Q∪q

for eachqinQand individualcinq:

replace all the occurrences ofcwith a fresh existential variableyc

q=q∪ {e(yc, c)}

ifOe6|=Qthen return false return true

end

Fig. 2: The algorithmAnsUCQ6=,b(Q,O)

equivalence relatione. Then, Qis further reformulated by allowing that in each CQ q ofQ, and for some of the existential variablesy1, . . . , yn appearing inq, different occurrences of eachyi may be mapped to distinct individuals of the setCQ, provided that these distinct individuals are in the same equivalence class of e. An analogous consideration is for the individuals appearing in the query, where the last step of the reformulation ofQallows that an existential variableyc may match an individualc0 that is not necessarily the individualc, but it is such thatc0e c, i.e., it is in the same equivalence class ofc.

Proposition 5. IfO = hT,Aiis a DL-Lite6=R ontology, and Qis a boolean UCQ6=,b overO, thenAnsUCQ6=,b(q,O)terminates and returnstrueif and only ifO |=Q.

With regard to the cost of the algorithmAnsUCQ6=,b(Q,O), observe that all the for-loops of the algorithm depend only onQ, and can be done in EXPTIMEin its size.

As for thee-satisfiability check, from Proposition 4, it can be done in AC0in the size of A, and in PTIME in the size ofT. Also, since Q0e is an UCQ, checking whether Oe 6|=Q0ecan be obviously done in AC0in the size ofA, in PTIMEin the size ofT,

(11)

and in EXPTIMEin the size ofQ. From Proposition 5 and the above considerations, we easily get the following result.

Theorem 4. Answering UCQ6=,bs over DL-Lite6=Rontologies is in AC0in data complex- ity, inPTIMEin TBox complexity, and inEXPTIMEin combined complexity.

6 Conclusion

In this paper we have singled out a specific class of queries, namely UCQ6=,bs, for which query answering overDL-Lite6=Rontologies is still in AC0in data complexity and in PTIME in TBox complexity. The algorithm is EXPTIME in combined complexity, and we have shown that the problem isΠ2p-hard.

There are several problems to consider for continuing the work presented here, the most obvious being trying to derive a matchingΠ2pupper bound in combined complex- ity of the above problem. Another interesting topic is to look for more subclasses of queries, or even more ontology languages for which answering queries with inequali- ties is decidable/tractable.

Acknowlegments

Work supported by MIUR under the SIR project “MODEUS” – grant n. RBSI14TQHQ, and by Sapienza under the research project “PRE-O-PRE”.

References

1. S. Abiteboul, R. Hull, and V. Vianu.Foundations of Databases. Addison Wesley Publ. Co., 1995.

2. M. Arenas, G. Gottlob, and A. Pieris. Expressive languages for querying the semantic web.

ACM Trans. on Database Systems, 43(3):13:1–13:45, 2018.

3. A. Artale, D. Calvanese, R. Kontchakov, and M. Zakharyaschev. TheDL-Litefamily and relations.J. of Artificial Intelligence Research, 36:1–69, 2009.

4. D. Calvanese, B. Cogrel, S. Komla-Ebri, R. Kontchakov, D. Lanti, M. Rezk, M. Rodriguez- Muro, and G. Xiao. Ontop: Answering SPARQL queries over relational databases.Semantic Web J., 8(3):471–487, 2017.

5. D. Calvanese, G. De Giacomo, D. Lembo, M. Lenzerini, A. Poggi, M. Rodriguez-Muro, R. Rosati, M. Ruzzi, and D. F. Savo. The Mastro system for ontology-based data access.

Semantic Web J., 2(1):43–53, 2011.

6. D. Calvanese, G. De Giacomo, D. Lembo, M. Lenzerini, and R. Rosati. Tractable reasoning and efficient query answering in description logics: TheDL-Litefamily. J. of Automated Reasoning, 39(3):385–429, 2007.

7. G. Cima, G. De Giacomo, M. Lenzerini, and A. Poggi. On the SPARQL metamodeling semantics entailment regime for OWL 2 QL ontologies. InProc. of the 7th Int. Conf. on Web Intelligence, Mining and Semantics (WIMS), pages 10:1–10:6, 2017.

8. G. Cima, G. De Giacomo, M. Lenzerini, and A. Poggi. Querying OWL 2 QL under the SPARQL metamodeling semantics entailment regime. InProc. of the 25th Ital. Symp. on Advanced Database Systems (SEBD), volume 2037, page 165, 2017.

(12)

9. B. Glimm. Using SPARQL with RDFS and OWL entailment. InReasoning Web. Semantic Technologies for the Web of Data – 7th Int. Summer School Tutorial Lectures (RW), pages 137–201. 2011.

10. G. Gottlob, S. Kikot, R. Kontchakov, V. V. Podolskii, T. Schwentick, and M. Zakharyaschev.

The price of query rewriting in ontology-based data access. Artificial Intelligence, 213:42–

59, 2014.

11. G. Gottlob and A. Pieris. Beyond SPARQL under OWL 2 QL entailment regime: Rules to the rescue. InProc. of the 24th Int. Joint Conf. on Artificial Intelligence (IJCAI), pages 2999–3007, 2015.

12. V. Guti´errez-Basulto, Y. A. Ib´a˜nez-Garc´ıa, R. Kontchakov, and E. V. Kostylev. Queries with negation and inequalities over lightweight ontologies. J. of Web Semantics, 35:184–202, 2015.

13. S. Kikot, R. Kontchakov, and M. Zakharyaschev. Conjunctive query answering with OWL 2 QL. InProc. of the 13th Int. Conf. on the Principles of Knowledge Representation and Reasoning (KR), 2012.

14. R. Kontchakov, M. Rezk, M. Rodriguez-Muro, G. Xiao, and M. Zakharyaschev. Answering SPARQL queries over databases under OWL 2 QL entailment regime. InProc. of the 13th Int. Semantic Web Conf. (ISWC), pages 552–567, 2014.

15. M. Lenzerini, L. Lepore, and A. Poggi. A higher-order semantics for metaquerying in OWL 2 QL. InProc. of the 15th Int. Conf. on the Principles of Knowledge Representation and Reasoning (KR), pages 577–580, 2016.

16. B. Motik, B. Cuenca Grau, I. Horrocks, Z. Wu, A. Fokoue, and C. Lutz. OWL 2 Web Ontology Language profiles (second edition). W3C Recommendation, World Wide Web Consortium, Dec. 2012. Available athttp://www.w3.org/TR/owl2-profiles/. 17. A. Poggi. On the SPARQL direct semantics entailment regime for OWL 2 QL. InProc. of

the 29th Int. Workshop on Description Logic (DL), 2016.

18. A. Poggi, D. Lembo, D. Calvanese, G. De Giacomo, M. Lenzerini, and R. Rosati. Linking data to ontologies.J. on Data Semantics, X:133–173, 2008.

19. R. Rosati and A. Almatelli. Improving query answering overDL-Liteontologies. InProc.

of the 12th Int. Conf. on the Principles of Knowledge Representation and Reasoning (KR), pages 290–300, 2010.

20. L. J. Stockmeyer. The polynomial-time hierarchy.Theoretical Computer Science, 3(1):1–22, 1976.

21. M. Y. Vardi. The complexity of relational query languages. InProc. of the 14th ACM SIGACT Symp. on Theory of Computing (STOC), pages 137–146, 1982.

22. G. Xiao, D. Calvanese, R. Kontchakov, D. Lembo, A. Poggi, R. Rosati, and M. Za- kharyaschev. Ontology-based data access: A survey. InProc. of the 27th Int. Joint Conf.

on Artificial Intelligence (IJCAI), pages 5511–5519, 2018.

Références

Documents relatifs

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

This gives rise to the notion of aggregate certain answers, which can be explained as follows: a number is an aggregate certain answer to a counting query over a knowledge base if

Thus, we examined formula-based approaches and proposed two novel semantics for ABox updates, called Naive Semantics and Careful Semantics, which are closed for DL-Lite.. For both,

These considerations lead us to TDLs based on DL-Lite N bool and DL-Lite N core and interpreted over the flow of time ( Z , <), in which (1) the future and past temporal

To address these needs, the DL-Lite family of description logics has been proposed and investi- gated in [6–8, 16], with the aim of identifying a class of DLs that could capture

(The inequality constraints do not affect the complexity.) In the presence of functionality con- straints, dropping the UNA increases the combined complexity of satisfiability

The most interesting result of [7] is the combination TDL-Lite bool of DL-Lite N bool [1, 2]—i.e., DL-Lite extended with full Booleans over concepts and cardinality restrictions

Specifically, these features allow one to express data properties of object properties, denial and identifica- tion constraints, and they include a new ontology component, called