• Aucun résultat trouvé

Temporal OBDA with LTL and DL-Lite

N/A
N/A
Protected

Academic year: 2022

Partager "Temporal OBDA with LTL and DL-Lite"

Copied!
12
0
0

Texte intégral

(1)

Temporal OBDA with LTL and DL-Lite

Alessandro Artale1, Roman Kontchakov2, Alisa Kovtunova1, Vladislav Ryzhikov1, Frank Wolter3and Michael Zakharyaschev2

1Faculty of Computer Science, Free University of Bozen-Bolzano, Italy

2Department of Computer Science and Information Systems Birkbeck, University of London, U.K.

3Department of Computer Science, University of Liverpool, U.K.

Abstract. We investigate various types of query rewriting over ontologies given in the standard temporal logicLTLas well as combinations ofLTL withDL-Litelogics. In particular, we consider FO(<)-rewritings that can use the temporal precedence relation, FO(<,+)-rewritings that can also employ the arithmetic predicate PLUS, and rewritings to finite automata with data given on the automaton tape.

1 Introduction

Ontology-based data access (OBDA), one of the most promising applications of description logics, has recently been extended to temporal ontologies and data. Motivated by applications in temporal data management, data stream management and monitoring in context-aware systems [11, 4, 7, 3, 15], a few approaches to temporal OBDA have been suggested. In all of them, data is stored in an ABox as timestamped assertions. It is assumed to be incomplete and supplemented by an ontology representing information about the domain or system under consideration. A user can access the data by means of queries in the vocabulary of the ontology that refer to time via either the temporal precedence relation directly or standard temporal operators from logics such asLTL.

Within this framework, a fundamental challenge is to minimally restrict the use of temporal constructs in ontologies and queries so that query answering is tractable (in data complexity) and can ideally be delegated to existing temporal or stream data management tools after query rewriting into an appropriate query language. For example, [4, 7] have explored the data complexity of query answering and the possibility of first-order rewritability for standard ontologies, which donot employ any temporal constructs, and conjunctive queries extended with the temporal operators ofLTL. The only temporal aspect the ontology can represent in this approach is that some roles and concepts can be declared rigid (time-invariant), which has a strong impact on the complexity of query answering.

An extension of SPARQL with temporal operators was designed in [15].

In contrast, the aim of [3] was to identify most expressive combinations of the ontology languageOWL 2 QL (and other logics of theDL-Lite family) with LTL that would ensure rewritability of temporal ontologies and conjunctive queries with timestamped atoms into first-order queries with the temporal precedence

(2)

relation <. One such combination, TQL, allows the temporal operators 3P

(sometime in the past) and3F (sometime in the future) in axioms of the form 3PsignsForMUu3FendOfContract v onMUcontract, (1) saying that since the signing of a contract with Manchester United and until its end, one is contracted to Manchester United. We can then use the query

q(x) = ∃y, t (n1≤t≤n2)∧Striker(x, t)∧onMUcontract(x, y, t) to find MU strikers in the time interval [n1, n2]. It was also observed that axioms with the next- and previous-time operatorsF andP such as

HamstringPulled v F21Injured,

saying that if a player pulls his hamstring then he is injured for at least three weeks, can ruin FO(<)-rewritability. It was conjectured, however, that the addition of the operations + and×could be enough to guarantee rewritability in this case.

In this paper, we launch a more systematic investigation of various types of query rewritability over temporal extensions of DL-Litelogics. To begin with, we consider ‘ontologies’ formulated in pureLTL, which is interpreted over the timeline (Z, <), and ‘data instances’ with atoms of the formp(n), wherepis a propositional variable andn a moment of time inZ. Ontology axioms in this case are of the form2 ϕ, where2 is the temporal operator ‘always’ andϕis any LTL-formula. Our initial observation is that any FO-queryqwith atomsp(τ), τ < τ0 andτ=τ0 (whereτ,τ0 are variables or constants fromZ) and anyLTL ontologyT can be ‘rewritten’ to a nondeterministic finite automaton (NFA) that computes answers to (T,q) over any data instance given on the automaton tape.

In complexity-theoretic terms, this means that the entailment problem for such ontology-mediated queries is in the classNC1 for data complexity.

We then investigate rewritability of two types of FO-queries over ontologies given in the fragments of LTLthat have been identified in [2]. More specifically, we consider atomic queries (AQs) as well as positive existential queries that can also use a built-in successor relation overZ(UCQ+, for short). The fragments from [2] operate withLTL-formulas inclausal normal form

2(¬λ1∨ · · · ∨ ¬λn∨λn+1∨ · · · ∨λn+m), (2) where the temporal literalsλi are defined by the grammar

λ ::= ⊥ | p | Fλ | Pλ | 2Fλ | 2Pλ. (3)

(Here2F and2P are the operators ‘always in the future’ and ‘always in the past’.) Similarly to [10], one can show that anyLTL-ontology can be transformed to clausal normal form. For example, axiom (1) can be replaced by three axioms

signsForMUv2FB, endOfContractv2PE, BuEvonMUContract

(3)

with fresh conceptsB andE. Borrowing the terminology from [1], we distinguish four types of clauses ¬λ1∨ · · · ∨ ¬λn∨λn+1∨ · · · ∨λn+m in (2): bool clauses with arbitrarynandm;horn clauses withm≤1; krom clauses withn+m≤2;

andcore clauses withn+m≤2 andm≤1. We consider 12 fragments ofLTL denoted byLTL2α,LTLα andLTL2α, whereα∈ {bool,horn,krom,core}indicates the type of clauses and the superscript indicates the temporal operators that can be used in the literalsλin the clauses of the fragments. (For instance,LTLcore contains formulas in clausal normal form with core clauses whose literals can only containF andP.) The obtained results are summarised in the table below:

LTL2α LTLα LTL2α

AQ UCQ+ AQ UCQ+ AQ UCQ+

bool FO(<) NFA NFA NFA NFA NFA

horn FO(<) FO(<) NFA NFA NFA NFA

krom FO(<) NFA FO(<,+) NFA NFA NFA

core FO(<) FO(<) FO(<,+) FO(<,+) NFA NFA Thus, if only the operators 2F and 2P can be used in ontology axioms, then ontology-mediated UCQ+s are rewritable to FO(<)-queries for all Horn ontologies.

If the operatorsF andP are allowed then in the best case we can only have FO(<,+)-rewritings, which use<and +. (By ‘NFA’ we indicate that the exact complexity is still unknown.)

We then ‘lift’ these rewritability results to the temporal description logics T2DL-LiteflathornandTDL-Liteflatcorewhose concept and role inclusions areLTL2horn and LTLcore clauses with concepts or roles in place of propositional variables and without ∃R on the right-hand side (we impose this restriction to focus on the temporal aspects of query rewriting). We prove that temporal UCQ+s overT2DL-Liteflathorn-ontologies are FO(<)-rewritable, while overTDL-Liteflatcore- ontologies they are FO(<,+)-rewritable. We also show that the UCQ+-entailment problem over T2DL-Liteflathorn-ontologies, which do not contain role inclusions, isNC1-complete for data complexity.

2 OBDA with LTL

We begin by considering thepropositional temporal logicLTLover the flow of time (Z, <). LTL-formulas are built from propositional variables P = {p0, p1, . . .}, propositional constants>and⊥, the Booleans∧,∨,→and¬, and the temporal operators: 2 (always), 3 (sometime), S (since) and U (until), 3P (sometime in the past) and3F (sometime in the future),2P (always in the past) and2F

(always in the future),P (in the previous moment) andF (in the next moment).

Atemporal interpretation, I, defines a truth-relation,|=, between moments of timen∈Zand propositional variablespi. We writeI, n|=pi to indicate that pi is true atninI. This truth-relation is extended to allLTL-formulas in the following way (the Booleans are interpreted as expected):

– I, n|=2 ϕiffI, k|=ϕ, for allk∈Z,

(4)

– I, n|=3 ϕiffI, k|=ϕ, for some k∈Z,

– I, n|=ϕUψiff there is k > nwithI, k|=ψ andI, m|=ϕ, forn < m < k, – I, n|=2FϕiffI, k |=ϕ, for allk > n,

– I, n|=3FϕiffI, k|=ϕ, for somek > n, – I, n|=FϕiffI, n+ 1|=ϕ,

and symmetrically for the past-time operators. (Note that the interpretation ofU andS only involves moments of time that are ‘strictly’ in the future and, respectively, past; all other temporal operators are expressible via suchS andU.) AnLTL-ontology, O, is a finite set ofLTL-formulas of the form2 ϕ. With each p ∈ P we associate a unary predicate over Z, also denoted p. A data instance is a finite set,D, of atoms of the formp(`) withp∈ Pand`∈Z. We denote by minD (maxD) the minimal (maximal) number occurring inDand set∆D={`|minD ≤`≤maxD}. To simplify presentation, we assume in this paper that minD = 0 and maxD ≥ 1. A temporal knowledge base (KB) is a pairK= (O,D). We call an interpretation I amodel ofK and writeI |=K if I, n|=ϕ, for all2 ϕinO andn∈Z, andI, `|=p, for allp(`)∈ D.

Atemporal first-order query (FOQ) is any FO(<)-formula, q(t), built from atoms pi(τ), τ =τ0 orτ < τ0, whereτ andτ0 are temporal terms (individual variables or constants fromZ). Although thesuccessor relation S(τ, τ0) (saying thatτ0 =τ+ 1) is expressible in this language, we assume that it can be used as a basic atom. The free variablestofq(t) are theanswer variables ofq; if there are no answer variables,qis calledBoolean. Aunion of conjunctive queries(orUCQ+, with + indicating that we can use the successor relation) is a disjunction of FOQs of the form ∃sϕ(s,t), where ϕ is a conjunction of atoms. Finally, an atomic query (orAQ) takes the form pi(τ), for a temporal termτ. Acertain answer to a FOQ q(t) with t=t1, . . . , tm over a KB (O,D) is any tuple `=`1, . . . , `m of elements in ∆D such that, for every modelI of (O,D), we have I |=q(`) regardingI as a first-order structure; in this case we writeO,D |=q(`). We refer to the problem ‘O,D |=q?’, whereqis a Boolean FOQ, asFOQ-entailment over temporal ontologies.

Letq(t) be a FOQ and OanLTL-ontology. Denote byIDq,O the finite first- order structure defined as follows. The domain∆q,OD ofIDq,O is the minimal closed interval in Zthat contains ∆D as well as somefixed integers that only depend on q andO (for example, all` /∈ ∆D occurring in q should be included into

q,OD ). For any`∈∆q,OD , we setIDq,O |=p(`) iffp(`)∈ D. We also assume that the binary relations<, = andS and ternary relation PLUS are interpreted over

q,OD in a natural way (e.g., PLUS(n, m, k) is true iffn=m+k). If we extend the domain ofIDq,O toZ, then the resulting structure is denoted byIDZ.

A FOQq0(t) is an FO(<)-rewriting ofq(t)and Oif, for any data instanceD and any tuple `from∆D, we haveO,D |=q(`) iff IDq,O |=q0(`). If we allow the use of PLUS inq0(t), then it is called an FO(<,+)-rewriting of q(t) andO.

Example 1. Consider the ontology O = {2(Pp → q),2(Pq → p)}. Then

∃s, n[(p(s)∧(t−s= 2n≥0))∨(q(s)∧(t−s= 2n+ 1≥0))] is an FO(<,+)- rewriting of the AQ p(t) and O, where t−s = 2n ≥ 0 is a shortcut for

(5)

∃n2(PLUS(n2, n, n)∧PLUS(t, s, n2)∧(n2≥0)) andt−s= 2n+ 1≥0 is defined similarly. However,p(t) andOdo not have an FO(<)-rewriting because properties of numbers such as ‘tis even’ are not expressible by FO(<)-formulas [14]. On the other hand, for any`∈Z, the Boolean AQp(`) andOare FO(<)-rewritable: for instance,p(3)∨q(2)∨p(1)∨q(0) is an FO(<)-rewriting ofp(3) andO. Consider next the ontologyO0 with the axioms:

2(?→p0), 2(Fpk∧a→pk) and 2(Fpk∧a→p1−k), k= 0,1.

For w = (w1, . . . , wn)∈ {0,1}n, let Dw containa(i) if wi = 1, a(i) if wi = 0, as well as?(n+ 1). ThenO0,Dw|=p0(0) iff the number of 1s inw is even. It follows that the AQp0(0) and the ontologyO0 are not FO-rewritable even if we are allowed to use arbitrary arithmetic predicates (not only<,Sand PLUS) [12].

This observation motivates the following definitions.

An NFAAis an NFA-rewriting of aBoolean FOQq and anLTL-ontology O if, for any data instance D, we haveO,D |= q iff A accepts D written on the tape as the wordD0, . . . ,Dk,Dk+1, where Di ={p|p(i)∈ D},k= maxD and Dk+1 = ? is a special ‘end of data’ marker. Thus, the alphabet of A is

Σq,O = 2sig(q,O)∪ {?}, where sig(q,O) is the set of variables from P used inq

andO. Now suppose we are given a FOQq(t) with non-emptyt=t1, . . . , tm. We say that an NFAAwith the tape alphabetΣq,O×2{t1,...,tm} is anNFA-rewriting ofq(t) andOwhen, for anyDand`=`1, . . . , `min∆D, we haveO,D |=q(`) iff Aaccepts the input word (D0, V0), . . . ,(Dk, Vk),(Dk+1,∅) with theDi as above andVi={tj|`j=i}, for 0≤i≤k. Note that instead of NFA-rewritability we could define an equivalent notion ofMSO(<)-rewritability (cf. [17, Theorem 1.1]).

It is known [6] that if a Boolean FOQqand anLTL-ontologyOare FO(<,+)- rewritable then the problem ‘O,D |=q?’ is inLogTime-uniformAC0 for data complexity. It is also known [13] that ifq andOare NFA-rewritable then this problem is in the class NC1 for data complexity.

Theorem 2. Any FOQq(t)and any LTL-ontologyO are NFA-rewritable.

Proof. Supposet=t1, . . . , tm. For a data instanceD, letIDN be the restriction of IDZ toN. It is easy to construct an MSO-formula µ(t) such thatIDN |=µ(`) iff O,D |= q(`), for all tuples ` in N. By B¨uchi’s theorem [8], one can now construct a B¨uchi automatonBwhich accepts anω-word (G0, V0),(G1, V1), . . . over the alphabet Σq,O×2{t1,...,tm} iff (i) there is exactly onek withGk =?;

(ii)Vk+1=∅ and (Gk0, Vk0) = (∅,∅), for allk0> k; (iii) for anyDwithDi =Gi fori < k, we haveIDN|=µ(`) for`j=iiftj ∈Vi. Finally, one can transform B to an NFAAthat accepts a finite word (G0, V0), . . . ,(Gk, Vk) iffBaccepts its

ω-extension with (∅,∅),(∅,∅), . . .. q

Let us now assume that the axioms ofLTL-ontologies are represented in clausal normal form (2) and consider the fragmentsLTL2α,LTLα andLTL2α, for α∈ {bool,horn,krom,core}, defined in Section 1. The next theorem establishes NC1-hardness of query entailment for various types of queries and ontologies.

(6)

Theorem 3. (i)AQ-entailment over LTLhorn-ontologies is NC1-hard.

(ii)FOQ-entailment over the empty ontology is NC1-hard.

(iii)UCQ+-entailment over LTL2krom- andLTLkrom-ontologies isNC1-hard.

Proof. We use the fact [5] that there exist NC1-complete regular languages.

Suppose Ais an NFA,q0 its initial state andq1the only accepting state. Given an input wordw=w0. . . wn, we set Dw={wi(i)|i≤n} ∪ {q1(n+ 1)}.

(i) LetO={2(Fq0∧a→q)|q→aq0}. ThenAacceptswiffO,Dw|=q0(0).

(ii) Letq=q0(0)∨W

q→aq0∃t, t0 S(t, t0)∧q0(t0)∧a(t)∧ ¬q(t)

. ThenAaccepts w iff∅,Dw|=q. (iii) Letq0 be the result of replacing each occurrence of¬q(t) inq with ¯q(t), for a fresh ¯q, and letO0 be an ontology containing2(¯q↔ ¬q) for every such ¯q. ThenAaccepts w iffO0,Dw|=q0. q We now establish the FO(<,+)- and FO(<)-rewritability results advertised in the introduction.

Theorem 4. Any AQ andLTLkrom-ontology are FO(<,+)-rewritable, but not necessarily FO(<)-rewritable.

Proof. Suppose we are given an AQ q(τ) and an LTLkrom-ontology O. (That they are not necessarily FO(<)-rewritable was shown in Example 1.) Without loss of generality we assume thatOdoes not contain nestedF andP and write

nϕin place of Fnϕifn >0, ϕifn= 0, andPnϕ ifn <0. By a literal, L, we mean a propositional variable fromsig(q,O) or its negation. Given literals L andL0, we writeO |=2(L→kL0) to say that 2(L→kL0) is true in all models ofO. LetAOL,L0 be an NFA whose tape alphabet is{0}, the states are all the literals, withLbeing the initial andL0 the accepting states, and whose transitions are of the formL10L2, forO |=2(L1L2).

Lemma 5. For anyk >0, the NFA AOL,L0 accepts 0k iff O |=2(L→kL0).

Every unary automatonAOL,L0 withN states gives rise (via Chrobak normal form [9, 18]) toM =O(N2) arithmetic progressionsai+biN={ai+bi·m|m≥0}, for i ≤M, such that 1≤ai, bi ≤N and, for anyk > 0,AOL,L0 accepts 0k iff divbi(k−ai), for some i≤M, wheredivb(v) =∃n((0≤n≤v)∧(v=bn)). Let

PL,LO 0(t) =

M

_

i=1

divbi(t−ai) and EL,LO 0(t, t0) =

((t=t0), ifO |=2(L→L0),

⊥, otherwise.

Lemma 6. (i)If(O,D)is consistent then, for any `∈Z, we haveO,D |=q(`) iff either O |=2 q or there existsp(m)∈ Dsuch that O |=2(p→`−mq).

(ii)If(O,D)is inconsistent then either O |=2 ⊥or there arep(m)∈ Dand r(n)∈ Dsuch that O |=2(p→n−m¬r).

The conditions of this lemma can be encoded as an FO(<,+)-formula ϕq(t), which is>ifO |=2 ⊥orO |=2 q, and otherwise a disjunction of the following formulas, forp, r∈sig(q,O),

∃s, s0 p(s)∧r(s0)∧(Pp,¬rO (s0−s)∨Ep,¬rO (s0, s)))

, (4)

∃s p(s)∧ Pp,qO(t−s)∨Ep,qO (t, s)∨P¬q,¬pO (s−t)

. (5)

(7)

Thus,O,D |= q(`) iff IDZ |= ϕq(`), for any D and ` ∈ Z. In fact, for a slight modification ϕ0q(t) of ϕq(t), we can show that O,D |= q(`) iff IDq,O |= ϕ0q(`) where∆q,OD = [min{0, `},max{maxD,|`|+O(|O|)}]. It follows that ϕ0q(τ) is a FO(<,+)-rewriting of q(τ) andOoverIDq,O. q By Theorem 3, UCQ+s andLTLkrom-ontologies are not always FO(<,+)- rewritable. In the next theorem, we restrict attention to LTLcore-ontologies.

Theorem 7. Any UCQ+q(t)andLTLcore-ontologyO are FO(<,+)-rewritable.

Proof. Letq0(t) result from replacing anyq(τ) inq(t) with the above mentioned ϕ0q(τ). Assuming thatO andD are consistent, denote by CO,D the canonical model of OandD. We then haveCO,D |=q(`) iff IDZ |=q0(`). Let IDq,O be the interpretation defined in the proof of Theorem 4, where` is the constant inq with maximal|`|, if any. Letmaxandmin be the maximum and minimum of

q,OD . By analysing the structure of (4) and (5), we obtain:

Lemma 8. Supposeq0(t) =∃sψ(t,s)with quantifier-free ψand s=s1, . . . , sm. If IDZ |=q0(`), for some ` in ∆D, then there is a tuple n=n1, . . . , nm in the interval [min− |q| ·O(|O||q|),max+|q| ·O(|O||q|)] such thatIDZ |=ψ(`,n).

We can now transformq0 to an FO(<,+)-rewritingq00(t) ofq andO over IDq,O using FO(<,+)-sentencesϕkq such that, fork <0 and`=min+kor for k >0 and`=max+k, we haveIDZ |=q(`) iff IDq,O |=ϕkq(`). To construct such sentencesϕkq, we require the (max+ 1)-ary representation of numbers and a

technique from [12, Sec. 1.4]. q

Consider next theLTL-ontologies whose axioms (in clausal normal form) can only contain the operators2P and2F. All AQs over arbitrary LTL2bool-ontologies turn out to be FO(<)-rewritable.

Theorem 9. Any AQ andLTL2bool-ontology are FO(<)-rewritable.

Proof. LetObe anLTL2bool-ontology. First we construct an NFAAthat describes the structure of models ofOand a given data instance Dwritten on the tape as defined above (cf. [19]). Denote by Φ the set of all subformulas of O and their negations. Each state ofAis a maximal consistent subsetS⊆Φ; letS be the set of all such states. For any S, S0 ∈S and any tape symbol X 6=?, we set S →X S0 just in case (i) X ⊆S0, (ii)2Fψ ∈S iff ψ,2Fψ ∈S0, and (iii) 2Pψ ∈S0 iff ψ,2Pψ∈ S. We also set S →? S0 iff S → S0. A state S ∈ S is accepting if Acontains an infinite ‘ascending’ chain of transitions of the form S→S1S2. . .;S is initial ifAcontains an infinite ‘descending’ chain

· · · →S2S1S. It is not hard to check thatAaccepts DiffOandDare consistent.

An NFA is calledpartially ordered [16] if it contains no cycles other than trivial loops. We now convertAto an equivalent partially-ordered NFAA0. Define an equivalence relation,∼, onS by takingS∼S0 iff eitherS =S0 orAcontains

(8)

a cycle with both S and S0. Denote by [S] the∼-equivalence class of S. It is readily seen that if S →X S0 thenS1X S0, for any S1 ∈[S]. The states of A0 are of the form [S], for S ∈S, and it contains a transition [S] →X [S0] iff S1X S10, for some S1 ∈ [S] and S10 ∈[S0]. The initial (accepting) states of A0 are all [S] with initial (accepting)S. Clearly, A0 is partially ordered, and it follows from the construction thatA0 andAaccept the same language.

Example 10. LetO={2(p→2Pq), 2(2Pq→r)}. The NFA A0 forOis shown below:

[S1] [S2] [S3]

all butq

all all

all

where all states are initial and accepting, [S1] = {{2Pq, q, p, r},{2Pq, q, r}}, [S2] ={{2Pq, p, r},{2Pq, r}}, [S3] = 2{r,q} (negative literals are omitted).

Consider amaximal pathpiinA0 of the form [S0]→X1 · · · →Xn [Sn], where all the [Si] are pairwise distinct, [S0] is initial and [Sn] accepting. We callπa prime path inA0. Suppose [Si]→X [Si] inA0. The operation ofduplicating [Si] (required for technical reasons that will be clear from Lemma 11) in a prime path πreplaces [Si] inπ with [Si]→X [Si]. Denote by ΨO the set of all paths obtained by at most two applications of duplication to some prime path. The length of each path in ΨO is polynomial in|O| and|ΨO| = 2O(|O|2). Given an interpretationI and`∈Z, lettI(`) ={p∈Φ∩ P | I, `|=p}(theI-type of`).

Lemma 11. For any AQq(t), interpretationI and`∈Z, we haveI |=O ∪ D andI 6|=q(`)iff there exist a pathπ= [S0]→X1 · · · →Xn[Sn]inΨO, an injective function f:{0, . . . , n} →Zand numbersk,b,ein{0, . . . , n}such that

– f(k) =`,f(b) = 0,f(e) = maxD andb < e;

– for anym≤f(0), there isS00 ∈[S0] such that tI(m) =S00;

– for anym withf(i)≤m < f(i+ 1), there isSi0 ∈[Si] withtI(m) =Si0; – for anym≥f(n), there isSn0 ∈[Sn]such that tI(m) =Sn0.

Example 12. Consider again the ontologyOfrom Example 10, D={p(0), p(2)}

and the modelI ofOandDshown below:

r, q,2Pq

−2

r, q,2Pq

−1

p, r, q,2Pq

0

r, q,2Pq

1

p, r,2Pq

2 3

We haveI,36|=rand, for the path [S1] = [S0]→{p}[S1]→{p}[S2]→ [S3] in ΨO, we can takef(0) =−1,f(1) = 0,f(2) = 2,f(3) = 3,k= 3,b= 1 ande= 2.

The conditions of Lemma 11 forπcan be expressed by an FO(<)-formula such as

ϕπ,r(t) = ∃tb, te[(tb= 0)∧?(te+ 1)∧(t > te)∧

φπ,[S1](tb)∧φπ,[S2](te)∧ ∀t00((tb< t00< te)→φ[S1](t00))], whereφπ,[S1](t) =φπ,[S2](t) =p(t)∧ ¬q(t)∧ ¬r(t) characterises the transitions [S0]→{p}[S1]→{p}[S2], and φ[S1](t) =>(t) the loops [S1]→all [S1].

Lemma 13. For any AQ q(t) and LTL2bool-ontology O, there is an FO(<)- formula χq(t)such that O,D |=q(`)iff IDZ |=χq(`), for all Dand`∈Z.

(9)

The formulaχq(t) is defined as a negation of a disjunction of formulas such asϕπ,r(t) in Example 12, for all possible choices ofπ,k,bande. To complete the proof of Theorem 14, we proceed in the same way as in Theorem 4. q By using the canonical models and the technique of the proof of Theorem 7, we also obtain:

Theorem 14. Any UCQ+andLTL2horn-ontology are FO(<)-rewritable.

Our next aim is to ‘lift’ these results to temporal extensions ofDL-Litelogics.

3 OBDA with Temporal DL-Lite

Let αbe one ofbool,horn, kromorcore, and let β be one of2, or2. We denote byTβDL-Liteα thetemporal description logic with inclusions of the form λ1u · · · uλn v λn+1t · · · tλn+m (6) such that¬λ1∨ · · · ∨ ¬λn∨λn+1∨ · · · ∨λn+m is anα-clause (according to the definition in Section 1) and theλiare all eitherDL-Litebasic concepts orDL-Lite roles, possibly prefixed with temporal operators indicated inβ. Recall [1] that DL-Lite basic concepts, B, are of the formB ::=⊥ | A | ∃R,whereAis a concept name andR a role.DL-Lite roles are defined byR ::= ⊥ | P | P, where P is a role name. A TβDL-Liteα TBox T (RBox R) is a finite set of TβDL-Liteα concept (respectively, role) inclusions. A TBox is said to beflat if its concept inclusions do not contain∃Ron the right-hand side. We denote by TβDL-Liteflatα the fragment ofTβDL-Liteαin which only flat TBoxes are allowed.

(Note thatDL-Liteflatcoreis basically RDFS.) AnABox Ais a set of atoms of the formA(a, n) andP(a, b, n), wherea,bare object names andn∈Z.

A temporal interpretation is a pair I = (∆II(n)), in which ∆I 6= ∅ and I(n) = (∆I, aI0, . . . , AI(n)0 , . . . , P0I(n), . . .) is a standard DL interpretation for each time instantn∈Z. Thus, we assume that the domain ∆I and the inter- pretationsaIi ∈∆I of the object names are the same for alln∈Z. The DL and temporal constructs are interpreted in I(n) as expected, for example,

(FB)I(n) = BI(n+1) and (2FB)I(n) = \

k>nBI(k). Concept and role inclusions are interpreted inIglobally, that is,I |=d

λi v F λj

just in caseTλI(n)i ⊆ SλI(n)j , forall n∈Z. Given an ABoxA, we denote by IAZ the interpretation with domainind(A), which consists of the object names in A, such thatIAZ |=A(a, n) iffA(a, n)∈ AandIAZ |=P(a, b, n) iffP(a, b, n)∈ A, fora, b∈ind(A) andn∈Z.

Temporal FOQs are built in the same way as in the LTL case, but from atoms of the form A(ξ, τ),P(ξ, ζ, τ) using =, <, S and PLUS. As before, we are interested in various types of FO-rewriting of a FOQ qand a TβDL-Liteα ontologyT,Rover finite first-order structuresIAq,T,R which are restrictions of IAZ to the minimal closed intervals inZcontaining all time instants fromAas well as some fixed integers that only depend onq andT,R.

(10)

Theorem 15. Any UCQ+andTDL-Liteflatcoreontology are FO(<,+)-rewritable.

Proof. Without loss of generality, we assume that the TBox,T, and RBox,R, do not contain nested temporal operators; together with any role inclusion,R contains the respective inclusion for the inverses; and for every role inclusion in R, sayPP vR, there is an inclusion for their domains,P∃Pv ∃R, inT. It can be seen that, for any ABoxAconsistent withT,Rand anya, b∈ind(A) and`∈Z, we have:R,A |=R(a, b, `) iffT,R,A |=R(a, b, `), andT,A |=B(a, `) iffT,R,A |=B(a, `).

Denote byTp (Rp) theLTLcore-ontology that contains all inclusions fromT (R) in which every basic concept (role) is regarded as a propositional variable.

For a concept name A (role name P), let ϕA(t) (respectively, ϕP(t)) be the FO(<,+)-rewriting ofA(t) andTp (ofP(t) andRp) constructed in the proof of Theorem 4. For any ABoxAanda, b∈ind(A), denote by Aa,b theLTLdata instance containingP(n) ifP(a, b, n)∈ AandP(n) ifP(b, a, n)∈ A. Similarly, for anya∈ind(A), letAacontainA(n) ifA(a, n)∈ Aand∃R(n) ifR(n)∈ Aa,b, for some b. ThenRp,Aa,b |=R(n) iffR,A |=R(a, b, n), andTp,Aa |=B(n) iff T,A |=B(a, n).

Now, given an atomP(ξ, ζ, τ), we construct an FO(<,+)-formulaP(ξ, ζ, τ) by replacing every R(τ0) inϕP(τ) withR(ξ, ζ, τ0) ifRis a role name, and with Q(ζ, ξ, τ0) ifR=Q. Similarly, given an atomA(ξ, τ), we construct an FO(<,+)- formulaA(ξ, τ) by replacing everyB(τ0) inϕA(τ) withB(ξ, τ0) ifB is a concept name, with∃y P(ξ, y, τ0) ifB=∃P, and with∃y P(y, ξ, τ0) ifB =∃P. As a consequence of Theorem 4 and the observations above, we obtain:

Lemma 16. For any ABox A, any a, b ∈ ind(A) and any ` ∈ Z, we have:

T,R,A |=P(a, b, `)iffIAZ |=P(a, b, `), andT,R,A |=A(a, `)iffIAZ |=A(a, `).

The remainder of the proof is a straightforward modification of the corre-

sponding part in the proof of Theorem 7. q

Example 17. Supposeq=∃x, y, t(P(x, y, t)∧A(x, t)) and letT contain∃PvA andRcontainPP vP. We will also assume thatPP vP is inRand so, bothP∃Pv ∃PandP∃P v ∃Pare inT. We obtain the following FO(<,+)- rewriting ofq andT,R, where all the variables are existentially quantified:

[(P(x, y, s)∧(t−s= 2n≥0))∨(P(y, x, s)∧(t−s= 2n+ 1≥0))]

| {z }

P(x,y,t)

[A(x, t)∨ ∃z((P(z, x, s)∧(t−s= 2n≥0))∨

(P(x, z, s)∧(t−s= 2n+ 1≥0)))]

| {z }

A(x,t)

.

Theorem 18. Any UCQ+and anyT2DL-Liteflathornontology are FO(<)-rewritable.

Proof. We proceed similarly to the proof of Theorem 15. One important difference is that, given an RBox R, we extend it with 2FR ≡FR, for every 2FR inR,

(11)

and 2PR ≡ PR, for every 2PR in R. (These new roles are auxiliary and do not occur in any ABox.) Treating (the extended) Ras anLTL2horn-ontology, we take the rewritingχR(t) ofR(t) andRconstructed in the proof of Theorem 14.

Let R(ξ, ζ, τ) be the result of replacing every P(τ0) in χR(t) with P(ξ, ζ, τ0) and every P0) with P(ζ, ξ, τ0). To construct a rewriting for atoms A(ξ, τ), we extend T with ∃FR v 2F∃R, for every FR in R, and ∃PR v 2P∃R, for everyPRin R. (The need for such axioms, connectingT andR, is explained by Example 19.) Treating (the extended) T as an LTL2horn-ontology, we take the rewritingχA(t) ofA(t) andT from Theorem 14. Denote byA(ξ, τ) the result of replacing everyA00) inχA(t) withA0(ξ, τ0), every∃P(τ0) with∃y P(ξ, y, τ0), and every∃P0) with∃y P(y, ξ, τ0). The remainder of the proof is now routine.

Example 19. ConsiderR={Rv2PT},T ={2P∃T vA}and the AQA(x, t).

ThenχT(t) =T(t)∨ ∃s[(s > t)∧R(s)]. If we did not extendT with∃PT v2P∃T, we would haveχA(t) =A(t). But due to this inclusion, we obtain

χA(t) =A(t)∨ ∃t0[(t0≥t)∧ ∃PT(t0)]∨

∃t0[(t0< t)∧ ∃PT(t0)∧ ∀s((t0≤s < t)→ ∃T(s))], χPT(t) =∃t0[(t0≥t)∧R(t0)]∨ ∃t0[(t0< t)∧R(t0)∧ ∀s((t0≤s < t)→T(s))].

Theorem 20. The UCQ+-entailment problem overT2DL-Liteflathorn-ontologies without role inclusions isNC1-complete for data complexity.

Proof. To sketch the idea, let us assume that the given TBoxT does not contain roles (roles are mostly harmless without role inclusions). Letq =∃x∃tϕ(x,t) be the given UCQ+. We treat the atomsA(xi, t) inϕas unary predicatesAxi(t) and, using the construction from [19], define an NFAAsuch that, for any ABox Aand any tupleafromA, we haveT,A 6|=∃tϕ(a,t) iffAaccepts a wordDa, constructed by a constant-size circuit and encoding the data inArelevant toa.

We convertAto anNC1 circuit and then use multiple copies of the constructed circuits to assemble an NC1circuit answeringq over any given ABox. q

4 Conclusions

This paper launches a systematic investigation of the rewritability problem for temporal queries and ontologies. We first consider this problem for AQs and UCQ+s overLTL-ontologies in clausal normal form and classify them in terms of FO(<)-, FO(<,+)- or NFA-rewritability. However, it remains unclear whether NFA-rewritability of AQs overLTL2krom -ontologies, and of AQs and UCQ+s over LTL2core-ontologies can be improved to FO(<,+)-rewritability. Another interesting problem is to analyse rewritability of general FO-queries in more detail.

We also show that some of our rewritability results overLTL-ontologies can be lifted to the corresponding flatDL-Lite-ontologies. Extending these results to the non-flat case looks more of less straightforward but is technically challenging.

We are working on the extension of Theorem 20 to the case with role inclusions and on a complete classification of temporalised DL-Lite logics according to query rewritability.

(12)

References

1. Artale, A., Calvanese, D., Kontchakov, R., Zakharyaschev, M.: The DL-Lite family and relations. Journal of Artificial Intelligence Research (JAIR) 36, 1–69 (2009) 2. Artale, A., Kontchakov, R., Ryzhikov, V., Zakharyaschev, M.: The complexity of

clausal fragments of LTL. In: Proc. of the 19th Int. Conf. on Logic for Programming, Artificial Intelligence and Reasoning (LPAR). LNCS, vol. 8312, pp. 35–52. Springer (2013)

3. Artale, A., Kontchakov, R., Wolter, F., Zakharyaschev, M.: Temporal description logic for ontology-based data access. In: Proc. of the 23rd Int. Joint Conf. on Artificial Intelligence (IJCAI 2013). IJCAI/AAAI (2013)

4. Baader, F., Borgwardt, S., Lippmann, M.: Temporalizing ontology-based data access. In: Proc. of the 24th Int. Conf. on Automated Deduction, CADE-24. LNCS, vol. 7898, pp. 330–344. Springer (2013)

5. Barrington, D.A.M., Compton, K.J., Straubing, H., Th´erien, D.: Regular languages in NC1. J. Comput. Syst. Sci. 44(3), 478–499 (1992)

6. Barrington, D.A.M., Straubing, H.: Superlinear lower bounds for bounded-width branching programs. J. Comput. Syst. Sci. 50(3), 374–381 (1995)

7. Borgwardt, S., Lippmann, M., Thost, V.: Temporal query answering in the descrip- tion logic DL-Lite. In: Proc. of the 9th Int. Symposium on Frontiers of Combining Systems (FroCoS’13). LNCS, vol. 8152, pp. 165–180. Springer (2013)

8. B¨uchi, J.R.: On a decision method in restricted second order arithmetic. In: Proc. of the 1960 Int. Congress on Logic, Methodology and Philosophy of Science (LMPS’60).

pp. 1–11. Stanford University Press (1962)

9. Chrobak, M.: Finite automata and unary languages. Theor. Comput. Sci. 47(2), 149–158 (1986)

10. Fisher, M., Dixon, C., Peim, M.: Clausal temporal resolution. ACM Trans. on Computational Logic 2(1), 12–56 (2001)

11. Guti´errez-Basulto, V., Klarman, S.: Towards a unifying approach to representing and querying temporal data in description logics. In: Proc. of the 6th Int. Conf.

on Web Reasoning and Rule Systems (RR 2012). LNCS, vol. 7497, pp. 90–105.

Springer (2012)

12. Immerman, N.: Descriptive Complexity. Springer (1999)

13. Ladner, R.E., Fischer, M.J.: Parallel prefix computation. J. ACM 27(4), 831–838 (1980)

14. Libkin, L.: Elements Of Finite Model Theory. Springer (2004)

15. ¨Ozcep, O., M¨oller, R., Neuenstadt, C., Zheleznyakov, D., Kharlamov, E.: A semantics for temporal and stream-based query answering in an OBDA context. Tech. rep., Deliverable D5.1, FP7-318338, EU (2013)

16. Schwentick, T., Th´erien, D., Vollmer, H.: Partially-ordered two-way automata: A new characterization of DA. In: Revised Papers of the 5th Int. Conf. in Developments in Language Theory (DLT 2001). LNCS, vol. 2295, pp. 239–250. Springer (2002) 17. Straubing, H., Weil, P.: An introduction to finite automata and their connection to

logic. CoRR abs/1011.6491 (2010)

18. To, A.W.: Unary finite automata vs. arithmetic progressions. Inf. Process. Lett.

109(17), 1010–1014 (2009)

19. Vardi, M.Y., Wolper, P.: An automata-theoretic approach to automatic program verification (preliminary report). In: Proc. of the Symposium on Logic in Computer Science (LICS’86). pp. 332–344 (1986)

Références

Documents relatifs

In this paper, we consider (temporally ordered) data represented in Description Logics from the popular DL- Lite family and Temporal Query Language, based on the combination of LTL

showed that the satisfiability of PDL formulas extended with arbitrary path negation (such a logic is denoted PDL ¬ ) is undecidable [20], which already implies the undecidability

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

The algorithm is based on a rewriting technique, and shows that query answering under the considered inconsistency-tolerant semantics in DL-Lite remains first-order rewritable,

We also introduce a new family of languages, DL-Lite HN A α , α ∈ {core, krom, horn, bool}, extending DL-Lite with attributes (A).. The notion of attributes, borrowed from

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 , &lt;), 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