Conjunctive Query Answering in Rough EL

Rough Description Logics have recently been studied as a means for representing and reasoning with imprecise knowledge. Real-world applications need to exploit reasoning over such knowledge in an efficient way. We describe how the combined approach to query answering can be extended to the rough setting. In particular, we extend both the canonical model and the rewriting procedure such that rough queries over rough EL ontologies can be answered by considering this information alone.


Introduction
One of the main challenges in knowledge representation and reasoning is still to cope with vague and imprecise information in an adequate manner.In the presence of instance data, the reasoning task answering conjunctive queries has become well-investigated over the last years.In this report we investigate answering of conjunctive queries for a variant of the description logic EL that is capable of expressing imprecise information.Imprecision is found in many knowledge domains, particularly those related to medicine and life sciences.A typical source of imprecision in these domains arises from the level of detail in which the knowledge is described.For example, a disease is usually diagnosed by a series of symptoms that a patient presents, but two individuals, say Ana and Bob, showing the same symptoms might in fact suffer from different maladies.Thus, while these individuals might be equivalent from a symptomatic point of view, they might be classified into different illness classes.
One of the many approaches suggested for handling imprecise knowledge is based on rough approximations.Unlike fuzzy sets, which allow for arbitrary degrees of membership, rough sets allow for one degree for 'vague' membership, one for definitive membership and one for non-membership.The core idea is to partition the elements in a domain into equivalence classes.This partition is induced by their indiscernibility according to the level of detail currently modeled.An individual belongs to the upper approximation of the class C (denoted C) if it is indiscernible from some element of C. For example, Ana and Bob are in the same symptomatic equivalence class.If Bob is diagnosed with, say the Cooties, then Ana potentially has the Cooties, too.In rough terminology, Ana is in the upper approximation of Cooties (Cooties).An analogous lower approximation of a class can be defined, too.Intuitively, C contains the prototypical elements of the class C: if an element x belongs to C, then every element indiscernible from x is guaranteed to belong to C.
Rough extensions of Description Logics (DLs) [BCM + 07] have been proposed as a formalism capable of expressing and reason over these upper and lower approximations [SKP07].An example is the rough DL EL ρ , which extends EL with two new rough concept constructors: one for the lower and one for the upper approximation.This description logic is investigated in this report.The semantics of this logic is based on interpretations I that, in addition to the classical interpretation function, define an equivalence relation ρ I over the domain elements of I.It has been shown that standard reasoning, such as subsumption or instance checking is decidable in this logic in polynomial time [PZ13].Intuitively, the idea is to construct a minimal model, called the canonical model, that describes all the standard relations between named individuals and concept names in a compact, and easy to read manner.The computation of this kind of model is the core of reasoning algorithms and in particular conjunctive query answering.
Interestingly, there is a very tight connection between canonical models for ELontologies, and those for EL ρ -ontologies.In EL, the canonical interpretation has a domain element x C for each (sub)concept appearing in the ontology.This element x C is a representative for the concept C, and every concept containing this element x C is guaranteed to be a subsumer of C. In the case of EL ρ , the canonical interpretation I O of an ontology O can be understood as a more detailed view into the classical canonical model.While each concept C appearing in the ontology still produces a representative x C , this representative induces a whole equivalence class [x C ] ρ of ρ, rather than a single domain element.This equivalence class provides information regarding the upper and lower approximations of the concept C.This intuition is depicted in Figure 1(a), where the equivalence classes are depicted as grey boxes.Here, the (partial) interpretation is a model for the GCI A C, since there is an auxiliary element in the class [x A ] ρ I that is indistinguishable from x A , i.e., related to it via ρ, and that belongs to C.
Canonical interpretations are the main means for answering conjunctive queries w.r.t.classical ELH ⊥ -ontologies [LTW09].Essentially, here a canonical interpretation is extended with representatives of all individual names from the ABox as well.The information encoded in this interpretation then suffices to answer the queries w.r.t.this interpretation only.Unfortunately, a naïve application of this idea would provide erroneous answers to some queries; for example, an interpretation like the one in Figure 1(b) could return (x A , x C ) to the query φ(x, y) = ∃z.r(x,z) ∧ r(y, z), although this is not true in all models of the ontology.To avoid this problem, one first rewrites the query into a first-order query, which is then answered over the canonical interpretation.This is known as the combined approach [LTW09].We extend the combined approach for conjunctive query answering in ELH ⊥ρ based on its canonical models.
Since ELH ⊥ρ is an extension of ELH ⊥ , all the rewriting rules for query answering in ELH ⊥ apply also in the rough setting.However, the structure of the canonical model of an ELH ⊥ρ -ontology is more complex: each symbol gets a representative equivalence class, which is needed to convey the rough approximations of the concepts.Thus, some elements are connected by an equivalence relation, that essentially is a symmetric, transitive and reflexive role ρ.This special kind of role needs to be treated carefully to avoid erroneous answers to a query.Suppose for example, we have an ABox stating that individual a belongs to concept A and that individual c belongs to concept C. We want to answer the query φ(x 1 , x 2 ) = ∃y 1 , y 2 .r(x 1 , y 1 ) ∧ r(x 2 , y 2 ) ∧ ρ(y 1 , y 2 ).
Here, since ρ is reflexive, the canonical interpretation would, as above, return (x A , x C ) as an answer.It is thus important to adapt the rewriting technique such that the equivalence relation that the rough constructors yield is handled correctly.
In this report, we describe our extension of the combined approach for computing certain answers to conjunctive queries in the rough DL ELH ⊥ρ .As in the case of ELH ⊥ -ontologies, the approach consists in computing the canonical interpretation I O that represents all models of the input ontology O, which can be done in polynomial time [PZ13].This interpretation is used first, as a guide for rewriting a conjunctive query φ into a first-order query φ † , and then as the finite domain over which φ † is answered.As a result, we obtain an effective method for answering queries that can allow to model imprecision by rough approximations of a concept-in the ontology as well as in the query.
The report is structured as follows.After defining the syntax and semantics of ELH ⊥ρ and the reasoning problem studied, query answering, in Section 2, we give the construction of the canonical model in Section 3. The the rewriting is defined in Section 4, and Section 5 finally concludes the report.

Preliminaries
In this section, we define the syntax and semantics of ELH ⊥ρ , which extends ELH by the bottom concept ⊥ and by concept constructors for the lower approximation and the upper approximation.We then define the problem of answering conjunctive queries in this logic.Let N C , N R , and N I be non-empty, pairwise disjoint sets of concept names, role names, and individual names.
are ELH ⊥ρ -concepts as well.Concepts of the form C are called upper approximation of C and concepts of the form C are called lower approximation of C.
The semantics of ELH ⊥ρ is given by interpretations.Here we need to take into account the upper and lower approximation, which is based on the indiscernibility relation ρ.We require that ρ is not an element of the set of role names N R and consequently does not appear in ELH ⊥ρ -concepts.The main difference between ρ and role names is the fact that ρ is always interpreted as an equivalence relation.Intuitively, the indiscernibility relation ρ groups the elements of the domain that cannot be distinguished from each other.The upper approximation C of a given concept C describes those elements that cannot be excluded from belonging to C, as they are indistinguishable from some element belonging to this concept.Dually, the individuals C are those that are discernible (i.e., can be detached) from each element not belonging to C. The extension of a concept in relation to its upper and lower approximation is depicted in Figure 2. Now, as usual, concepts can be used to build DL ontologies.The terminological component of the ontology is defined as follows.

Given an interpretation
Definition 2.3 (GCI, RIA, TBox).Let C and D be ELH ⊥ρ -concepts and r, s ∈ N R .A general concept inclusion (GCI) is an expression of the form C D, a role inclusion axiom (RIA) is an expression of the form r s.A TBox T is a finite set of GCIs and RIAs.
I satisfies a GCI C D if C I ⊆ D I and a RIA r s if r I ⊆ s I .An interpretation that satisfies all GCIs and all RIAs contained in a TBox T is a model of the TBox T .
Observe, that ρ does neither appear in GCIs nor RIAs.The assertional component of a DL ontology allows to specify facts about objects.Here, in contrast to the TBox, the indiscernibility relation can be used directly.We use the standard assumption made for DL systems that all interpretations satisfy the unique name assumption (UNA) which means that, for all distinct individual names a, b ∈ N I occurring in α and A, we have a I = b I .
Based on the semantics, reasoning services can be defined for ontologies.If it has a model, an ontology is consistent.For an axiom, a set of axioms, or an ontology α, we write I |= α, if I satisfies α.For an ontology O together with an axiom or a set of axioms α, we further write O |= α, if every model of O satisfies α.
The reasoning service addressed in this report is answering of conjunctive queries.As customary, we characterize conjunctive queries by means of first order (FO) queries.In this context N C and N R ∪ {ρ} are considered as sets of unary and binary FO predicates, respectively.In addition, the indiscernibility relation ρ can be characterized as an equivalence relation.
Definition 2.5 (Syntax of conjunctive queries in ELH ⊥ρ ).Let N V be a set of variables.The elements of N V ∪ N I are called terms.A first-order (FO) query is an FO formula φ built from terms and the predicates in N C and N R .
We sometimes denote such a query by φ( x), where x = x 1 , . . ., x k and x i ∈ N V for 1 ≤ i ≤ k are the free variables in φ, which are also called answer variables of φ( x).We call the query k-ary, if there are k answer variables.The variables occurring in φ( x), but not in x are called quantified variables.
Let C be an ELH ⊥ρ -concept, r ∈ N R ∪ {ρ} a role or the indiscernibility relation, and t, t ∈ N V ∪ N I .An atom can be a ELH ⊥ρ -concept atom of the form C(t) or a role atom of the form r(t, t ).A conjunctive query (CQ) is a FO query of the form φ( x) = ∃ y.ψ( x, y), where y = y 1 , . . ., y m ∈ N V and ψ is a (possibly empty) finite conjunction of atoms.The empty conjunction is denoted by true.
To conveniently access parts of a conjunctive query, we introduce a bit of notation.We denote by • Ind(φ) the set of individuals occurring in a query φ, • Term(φ) the set of terms occurring in φ, • Var(φ) the set of variables occurring in φ, • AVar(φ) the set of answer variables in φ, and by • QVar(φ) the set of quantified variables in φ.
Note that we sometimes consider a conjunctive query φ as the set of atoms occurring in it.
Definition 2.6.Let I = (∆ I , • I , ρ I ) be an interpretation.A match for I and a CQ φ is a mapping π : Term(φ) → ∆ I such that π(a) = a I for all a ∈ Term(φ)∩N I and all atoms in φ are satisfied.
For a quantifier-free FO query φ, the relation I |= π φ is defined by induction on the structure of φ, as follows: In the following, we introduce the central reasoning problem of this paper, namely to compute certain answers to ELH ⊥ρ -CQs.
Definition 2.7 (Query Answering).Let φ( x) = ∃ y.ψ( x, y) be a query with ψ a quantifier-free FO query.If π maps all terms in accordance with I, then a mapping π : Term(φ) → ∆ I is a match for φ and I if π(a) = a I for all a ∈ Term(φ) ∩ N I and I |= π φ.Moreover, for x = x 1 , . . ., x k such that π( The set of all certain answers to φ w.r.t.O is denoted by Cert(φ, O).
Since our approach is based on the combined approach by rewriting described in [LTW09], we also use the assumptions made there.So, in the remainder of this report we assume 1. queries to contain only individual names that occur in the ontology they refer to, 2. there are no r, s ∈ N R such that r = s, O |= r s, and O |= s r, and 3. A and φ contain only primitive rough concepts.
Note that these assumptions do not represent restrictions since additional individual names can be easily introduced in an ontology by adding tautological assertions to the latter.Moreover, Assumption 2 is satisfied by any ontology if, for example, s is substituted by r in that ontology and the corresponding queries.Assumption 3 is no restriction, since any complex ELH ⊥ρ -concept C occurring in A and φ can equivalently be replaced by a fresh concept name A if A ≡ C is added to T .

On Canonical Interpretations
The combined approach for answering CQs over an ELH ⊥ -ontology O heavily relies on the so-called canonical model I O of O, which represents a materializa-tion of the knowledge encoded in the TBox.In particular, all certain answers to a CQ w.r.t.O can be retrieved by considering the so-called unraveling U O of I O .
In this section, we show that such interpretations I O (in Section 3.1) and U O (in Section 3.2) can be constructed also in our rough setting.However, due to the presence of the indiscernibility relation and its special semantics, these constructions are more involved.In [PZ13] a completion-based algorithm was given that produces the canonical models for a more expressive DL than ELH ⊥ρ .In the following we give a direct definition for anonical models for ELH ⊥ρ -ontologies.

Finite Canonical Interpretations for ELH ⊥ρ
This section describes the canonical model I O of the ELH ⊥ρ -ontology O in detail: 1.An introductory example first gives an intuition of our construction.
2. After the formal definition of I O , we further adapt it to an interpretation I r O .
3. We show that all the equivalence classes of ρ I r O are of a special shape.
4. Finally, we show that I r O can be used to retrieve the certain answers to instance queries, which are a simple form of CQs, and that We define a canonical interpretation that describes all the basic relations between symbols in the signature of O that are entailed by this ontology; the construction is an extension of the canonical models given in [LTW09].In order to do so, the notion of a subconcept is extended to ELH ⊥ρ -concepts in the following way: In what follows, we use Sub(T ) to denote the set of all subconcepts of concepts that occur in GCIs contained in T 1 and Ind(A) for the set of individual names that occur in A. As in the case of ELH ⊥ canonical models, we use an auxiliary set in which all subconcepts of T are collected: 1 Observe that Sub(T ) contains all subconcepts in O, since A only contains concept names.

An Example Ontology and its Canonical Model
In this example, we consider An illustration of the classical canonical model of O ex considered as an ELH ⊥ontology (i.e., without considering the approximations as constructors and considering ρ as an ordinary role, meaning B, C, D ∈ N C and ρ ∈ N R ) is given in Figure 3.Note that this figure and the following ones show only those elements that are reachable from some named individual from Ind(A).
However, in the rough setting, ρ is an equivalence relation.For our procedure to obtain the canonical model I Oex , it is hence critical that the equivalence classes of ρ in I Oex are defined cautiously.We therefore aim at defining one such class for each named individual and each element in N aux I and keep them as separate as long as possible.In particular, the equivalence classes for the N aux I elements never merge with other equivalence classes.In contrast to this, ρ-assertions in the ABox, as in A ex , can require the merging of the equivalence classes of named individuals.
To collect all those concepts that are definitely satisfied by all the elements in one equivalence class of ρ I O (created for some element e ∈ Ind(A) ∪ N aux I ), we add additional elements of the form e .This is depicted in Figure 4, where we still assume C, D ∈ N C , but respect the special semantics of the lower approximation and ρ.This figure also outlines the division of the equivalence classes of ρ I O .Note that the borders of the latter are strictly separated by the role edges to elements of N aux I .Also note that the figure just depicts the ρ-relations that directly follow from O meaning without considering the symmetric and transitive closure.The cases exemplified here give an intuition why the construction of the canonial model for ELH ⊥ρ is a little more involved.We now proceed with the formal definition of the canonical interpretation.

The Definition of the Canonical Model I O
To ease presentation we assume in the remainder of this section that O = (T , A) is an arbitrary, but fixed consistent ELH ⊥ρ -ontology with R the set of RIAs in T , and that φ is a CQ which is to be answered w.r.t.O.
To distinguish the different kinds of elements in the domain of I O , we use the auxiliary sets N aux I , N low I , N up I , and N ρ I , which are disjoint to N I : Using these auxiliary sets, we define the canonical interpretation as follows.

Definition 3.1 (Canonical Interpretation). The canonical interpretation of an ontology O (with the indiscernibility relation ρ) is defined as
• for all a ∈ Ind(A), a I O := a; • ρ I O is based on the relation: {(e, e )}.
We define ρ I O to be the reflexive, symmetric, and transitive closure of ρ O : Note that this definition of I O extends the standard notion of a canonical model in EL as proposed in the literature (e.g., in [LTW09]).The extension is required to handle the upper and lower approximations introduced by the rough constructors, and it is realized by the new elements in N ρ I added to the domain.Moreover, the semantics of ELH ⊥ρ requires ρ to be extended to an equivalence relation ρ I O over the elements of ∆ I O .Nevertheless, the cardinality of ∆ I O is polynomial in the size of O.In addition, I O can be computed in polynomial time [PZ13] and also consistency of O can be checked in polynomial time [PZ13].

O
As described before, the scope of the elements in N ρ I is to describe all possible kinds of elements that are indiscernible from those in N aux I and Ind(A).In particular, and as it is stated by the following proposition, different elements in N aux I are never related via ρ I O ; moreover, elements from Ind(A) can only be related in very specific cases.The following proposition follows directly from the definition of ρ I O .Proposition 3.2.Let a ∈ Ind(A) and x C ∈ N aux I .Then, for every element e ∈ ∆ I O , the following holds: • if e ∈ [a] ρ I O , then either e ∈ Ind(A) or e is of the form x C,b or b for some b ∈ Ind(A); and To be able to use I O for answering (even instance) queries, we have to make sure that we do not have unnecessary elements in our interpretation.Otherwise, for example, a query φ = ∃y.D(y) w.r.t. an ontology O = ({C D}, ∅) would yield true as answer in I O , which clearly is no certain answer to the query.
We therefore restrict I O to the elements that are reachable from the individuals Notice that in the definition of the paths, we consider only elements that are reachable through the relation ρ O , and not through its closure ρ I O .It can be easily seen that every element that is reachable from an individual name through roles and the relation ρ I O in I O is also reachable through a path in Paths(I O ).

Thus, I r
O contains all the reachable elements.Lemma 3.3.For all e ∈ ∆ I r O there is a sequence d 0 , . . ., d n ∈ ∆ I r O and a sequence r 0 , . . ., In the following lemma, we describe some additional properties of the equivalence classes defined by this restricted interpretation.
Lemma 3.4.Let C, D, and E be arbitrary concepts, and a, b ∈ Ind(A).
( ∈ Ind(A).This implies that, for the first element of this path, we have O , for some concept D, then D must be the concept E. For the converse, we can prove analogously to (1) that {x D ,  (1) a Proof.We prove the items simultaneously by induction on the structure of C.
The base case where the result follows trivially from the semantics and the induction hypothesis.We now consider the remaining cases in detail.O .The proof of item (4) is analogous, and the proofs of (5) and ( 6) are analogous to the second case in the proof of (3) and (4), respectively.Having also the assumption that O |= C 1 (a), the proof of (5) corresponds to the one of (3).The proofs of (2), (4), and (6) are similar, but less involved, because the contradicting assumption, by applying the induction hypothesis, always directly yields a contradiction.For example, in the proof of (2), the assumption is O |= D C 1 , and in the case When CQ-answering is considered, another problem, which has already been outlined in Section 1, is the reuse of elements of N aux I representing the role-successors and consequently also that of the elements from N ρ I in I r O (since they are connected to the N aux I -elements).To cope with that, we define another interpretation based on I r O , next.

An Interpretation for Query Answering
Based on the deficiencies of I r O , we now construct the unraveling U O of I r O .In a nutshell, this interpretation is obtained by considering the paths in I r O as domain elements of U O .For later proofs, it is additionally important that we establish a certain correspondence (i.e., a surjective mapping) between the domain elements of U O and those of I r O .Hence, this section covers the following: 1. We formally define U O and show that its domain elements (i.e., the paths) are not arbitrary, but of some specific structure.
2. We show that there is indeed a mapping as mentioned above, which, in particular, is surjective w.r.t. the relation ρ.
3. Finally, we show that U O is a model of O and can be used to retrieve the certain answers to CQs w.r.t.O.

The definition of U O
We define the interpretation In this definition u • v denotes the concatenation of u and v.Note that the construction of U O does not depend on the GCIs in T , but only on R.
We now start proving some relevant properties of U O .Proposition 3.7 concretizes the kinds of paths that can occur as elements of ∆ U O .
Proposition 3.7.For every one of the following conditions hold: (ii) d n = x ∈ N aux I , and p is of the form p rx for some r ∈ N R and p ∈ ∆ U O ; (iii) and there is a path p such that p is of the form Proof.By the definition of U O , every ρ O -successor of prx C must be of the form prx C ρd, where d is either x C or of the form x D 0 ,x C .The latter have only

A mapping between the domain elements of U
given by Tail [p] (q) = Tail(q) for all q ∈ [p] ρ U O .In what follows, we show that this function is well-defined and surjective.Lemma 3.9.For all p, q ∈ ∆ U O , if (p, q) ∈ ρ U O , then (Tail(p), Tail(q)) ∈ ρ I r O .
Proof.We prove this by induction on the construction of ρ U O .Assume first that (p, q) ∈ ρ O .If Tail(p), Tail(q) ∈ Ind(A), we have (Tail(p), Tail(q)) ∈ ρ I r O , by definition of U O .Otherwise, we have q = p • ρq , and the second line in the definition of ρ O implies (Tail(p), q ) ∈ ρ O .But then, (Tail(p), We now consider the induction steps of closing ρ U O to an equivalence relation.O , then there is an element q ∈ ∆ U O with Tail(q) = e such that (p, q) ∈ ρ U O .
Proof.For the proof we use induction on the construction of ρ I r O .For the induction start, we assume (d n , e ) ∈ ρ O .By the definition of O , we have the element q = p • ρe ∈ ∆ U O and hence get (p, q) ∈ ρ O ⊆ ρ U O .We now consider the induction steps of closing ρ I r O to an equivalence relation.Since ρ U O is also an equivalence relation, we obviously have For symmetry, we assume we have (e , d n ) ∈ ρ I r O and, by (IH), that for all e ∈ ∆ U O with Tail(e) = e there is some is also symmetric, this leads to (d, e) ∈ ρ U O .Again, the case for transitivity can be treated analogously.
To note, however, that Tail is not necessarily, consider Figure 6 as an extract of some canonical interpretation I O where both x C D,e and x D C,e are reachable.The two relations ρ I O are clearly induced by the definition of I O and hence we also have the corresponding paths in U O .

U O is suitable for query answering
We are now ready to show that the classical lemma about the connection between concept satisfiability in U O and I r O also holds in our rough setting.This enables us to subsequently prove that U O is also a model of O and especially suitable for query answering.
Lemma 3.11.For all concepts C and p Proof.The proof is by induction on the structure of C. If C = A ∈ N C , the claim directly follows, by the definition of U O .The case C = C 1 C 2 follows easily by definition.We now consider the case C = ∃r.C 1 .
(⇒) If p ∈ (∃r.C 1 ) U O , then there is a q ∈ ∆ U O such that (p, q) ∈ r U O and q ∈ C U O 1 .By definition of U O , either (i) p, q ∈ Ind(A) and (p, q) ∈ r I r O , or (ii) q is of the form q = p•se for some role s with R |= s r.O , either e ∈ Ind(A) ⊆ ∆ U O , or there is a role s and a q ∈ ∆ U O such that R |= s r and, q = p • se hold.For both cases, the definition of U O yields (p, q) ∈ r U O .By induction, q ∈ C U O 1 , and p ∈ (∃r.C 1 ) U O follows.We now focus on the rough constructors.Consider first . By Lemma 3.9, we get (d n , Tail(q)) ∈ ρ I r O , and by induction Tail(e) ∈ C The only remaining case is and by induction Tail(q) ∈ C Finally, using Lemmas 3.5 and 3.11, it is straightforward to establish the following.
Lemma 3.12.Proof.The first point is a direct consequence of Lemmas 3.5 and 3.11.For the second point, the only if direction follows trivially from the first point.We now prove the if direction.
Assume that U O |= ψ(a 1 , . . ., a k ) holds and let I be an arbitrary model of O.We define a mapping π : ∆ U O → ∆ I such that for all p, p ∈ ∆ U O , a ∈ Ind(A), roles r and concepts C: We define π by induction on the structure of the path.If p is of the form a for some a ∈ Ind(A), then set π(a) := a I as required by the first condition.It is easy to see that all other conditions are also satisfied.This section covered the first extension of the combined approach of query answering [LTW09] to the rough setting, namely that of the definition of the canonical interpretation together with that of the unraveling.Due to the special semantics of the indiscernibility relation, we had to take specifically care that our extensions of the classical constructions also retained their properties -because the latter are integral to prove the correctness of the query rewriting.Our extension of that rewriting is described in the next section.

Answering Rough Queries
In the previous section we showed that all rough conjunctive queries can be answered over the unraveled canonical model U O .However, since U O is infinite, it cannot be used as a tool for effective query answering.It was shown in [LTW09] that it is possible to rewrite conjunctive queries written in ELH ⊥ in such a way that they can be answered over the polynomially large canonical interpretation directly.The main idea of this combined approach is to simulate the unraveling of this model by disallowing merging paths over the anonymous variables.We show that this idea can be extended to the rough DL ELH ⊥ρ .Our goal is to prove the following theorem.
Theorem 4.1.For every finite set of role inclusions R and k-ary CQ φ, it is possible to construct in polynomial time a k-ary FO query φ † R such that for all ELH ⊥ρ -ontologies O = (T , A) with R the set of role inclusions in T and all a 1 , . . ., a k ∈ Ind(A), we have This theorem states that it is possible to transform (or rewrite) any CQ φ into a FO-query φ † R that can be answered over the canonical model I r O .Recall from Definition 2.5 that FO queries generalize CQs.The rest of this section is dedicated to proving it.
Let now R and φ be an arbitrary but fixed finite set of role inclusions, and a k-ary CQ, respectively.We construct the FO-query φ † R .To do this, we first introduce two additional unary predicates (i.e., concepts) Aux and Aux ρ , and one new binary predicate ρ L which we assume to be always interpreted by the canonical interpretation I r O and its unraveling U O , as follows: These predicates are new in the sense that they occur neither in A nor in φ.
Let ∼ φ denote the equivalence relation over Term(φ) induced by the atoms of the form ρ(s, t) occurring in φ, and ∼ φ r denote the smallest transitive and reflexive relation on Term(φ) that includes the relation: and satisfies the closure condition: if r 1 (s, t), r 2 (s , t ) ∈ φ and t ∼ φ r t , then s ∼ φ r s .
( * ) The relation ∼ φ r will be fundamental for constructing φ † R .Intuitively, the equivalence classes of ∼ φ r contain those terms that are not discerned by any match for U O and φ; i.e., they are always mapped to the same element in ∆ U O .This is obviously the case for identical terms.To understand the closure condition ( * ), first assume that t = t ; then ( * ) describes a non-tree situation in the query φ since the term t has two predecessors s and s .Therefore, any match of the query in I r O that maps t to the Aux-part should map s and s to the same element; otherwise this match would not exist in the unraveled model U O .The case where t ∼ φ r t can be understood analogously.Since any match for I r O and φ maps t and t to the same element if t ∼ φ t and t is mapped to the Aux-part (see Lemma 3.4) we include such t, t into ∼ φ r .
For any equivalence class ζ of ∼ φ r , we define the sets: It is called a prime implicant if, additionally, R |= r r for all implicants r of R with r = r .By the assumption 2 made in Section 2 (see Page 7), there is a prime implicant for any set R ∈ N R for which there is an implicant.We define the following auxiliary sets: • Fork = is the set of pairs (Pre(ζ), ζ) with Pre(ζ) of cardinality at least two; • Fork = is the set of variables v ∈ QVar(φ) such that there is no implicant of In([v] ∼ φ r ); • Fork H is the set of pairs (I, ζ) such that Pre(ζ) = ∅, there is a prime implicant of In(ζ) that is not contained in In(ζ), and I is the set of all prime implicants of In(ζ); • Cyc is the set of all variables v ∈ QVar(φ) such that there exist atoms r 0 (t 0 , t 0 ), . . ., r m (t m , t m ), m ≥ 0 in φ with r i ∈ N R , and (i) For each equivalence class ζ of ∼ φ r , we select an arbitrary but fixed representative Before continuing with the proof, we provide the basic motivation behind these definitions.Intuitively, the first element of a pair in Fork = describes the variables that are mapped to the same element by any match for φ and U O , which maps the successor variable to the Aux-part.The variables which, by the design of φ (i.e., the role atoms where the variables occur as successors) and the construction of U O , can never be mapped to such a common successor are collected in Fork = .
(U F 1) Let now φ = ∃ x.ψ be a CQ.We construct the FOL query ψ CQ by exhaustively applying the unfolding rules in Figure 7, where a rule applcation corresponds to replacing a conjunction on the left-hand side of the rule, by those on the righthand side.In the rules, C and D denote arbitrary complex concepts, and y 1 , y 2 , and y fresh variables for each rule application.
, where ψ 0 , ψ 1 , ψ 2 , and ψ 3 are given by Notice that the terms used in this construction are based on the original query φ, and hence do not apply to the existentially quantified variables introduced during the application of the unfolding rules in the construction of ψ CQ .
To help understanding this rewriting procedure, we now provide some simple examples of their application.The first example demostrates the role of the set Cyc in the rewriting, while Example 4.3 shows the use of Fork = .For these examples, we consider R = ∅.Notice that in this case, Fork H is always empty, and hence ψ 3 = true.Thus, we ommit this formulas in them.
We have Cyc = {y 1 , y 2 }, Fork = = Fork = = Fork H = ∅, and thus obtain This query guarantees that all the answer pairs provided are indiscernible elements, related via the role hasA, but additionally, none of the auxiliary elements produced in the construction of the canonical interpretation is returned.
For the next example, we have a similar query, demostrating the rewriting of forking situations.
Let now φ = ∃ x.ψ be a CQ, and π a valuation of the variables in φ such that U O |= π ψ.We define the mapping τ : Term(φ † R ) → ∆ I r O inductively on the application of the unfolding rules from Figure 7 as follows: • τ (t) = Tail(π(t)) for all t ∈ Term(φ); and It is easy to see that this function τ is well defined.We now show that I r O |= τ ψ CQ .Lemma 4.4.Let φ = ∃ x.ψ be a CQ, and Proof.We prove this by induction on the application of unfolding rules for constructing ψ CQ .Let ψ 0 , ψ 1 , . . .be the sequence queries obtained at each application of an unfolding rule, with ψ 0 = ψ.For the best case, it follows directly from Lemma 3.11 and the construction of τ that I r O |= τ ψ = ψ 0 .Suppose now that I r O |= τ ψ n , we prove that I r O |= τ ψ n+1 by a case analysis over the rule applied.(UF1) ψ n+1 is obtained from ψ n by replacing C(x) by ∃y.ρ(x, y) ∧ C(y), where x ∈ Term(ψ n ).By induction, we know that τ (x) ∈ ∃ρ.C This lemma shows that τ is an (a 1 , . . ., a k )-match for I r O and ψ CQ .Since our goal is to show that it is a match for φ † R , we need to prove that I r O |= τ ψ i for all i, 0 ≤ i ≤ 3. Notice that all the new variables introduced to φ † R during the rewriting are existentially quantified, and hence cannot be answer variables; moreover, the auxiliary sets Fork = , Fork = , Fork H , and Cyc used are defined w.r.t. the relation ∼ φ r .Thus, it suffices to consider only τ (t) for t ∈ Term(φ).We start by showing the following result.
We prove 1 by induction on the definition of ∼ φ r .If s ∼ φ r t, s = t then there exist r 1 (s , s), r 2 (t , t) such that s ∼ φ t.Since π is a match for φ and U O , we have that π(s), π(t) ∈ Ind(A) ∪ Aux U O .By assumption, π(s) ∈ Aux U O , and from Lemma 3.4 we get π(s) = π(t).The result follows trivially for the reflexive closure.We only need to prove it for the closure under transitivity and ( * ).
The property 2 follows directly from 1 and the closure under ( * ).
Using this result, we can then show that τ is a match for the auxiliary queries ψ i .We now consider the case of ψ 1 .If v ∈ AVar(φ), then as in the previous case, τ (v) / ∈ Aux I r O .Suppose now that τ (v) ∈ Aux I r O .If v ∈ Fork = then, there is no implicant for In([v] ∼ φ r ).By definition, for every r ∈ In([v] ∼ φ r ) there exists r(s r , t r ) ∈ φ such that t r ∼ φ r v.Moreover, since τ (v) ∈ Aux I r O , Lemma 3.11 implies that π(v) ∈ Aux U O ; thus π(v) = π(t r ) (Lemma 4.5), and (π(s r ), π(v)) ∈ r U O .By the unraveling condition, this implies that for all r, r ∈ In([v] ∼ φ r ) π(s r ) = π(s r ); but then every r ∈ In([v] ∼ φ r ) is an implicant for In([v] ∼ φ r ), yielding a contradiction.Finally, if v ∈ Cyc then there exist r i (t i , t i ) ∈ φ, 0 ≤ i ≤ m and j, 0 O , it follows from Lemmas 4.5 and 3.8 that π(t j ) ∈ Aux U O , and therefore π(t j ) = π(t j ) • rd for some d ∈ ∆ I r O .In particular, π(t j ) ∈ Aux U O .Additionally, we know that (t i , t i+1 ) ∈ ∼ φ r ∪ ∼ φ for all i, 0 ≤ i < m and (t m , t 0 ) ∈ ∼ φ r ∪ ∼ φ .Repeating the previous argument, we obtain that π(t j ) = π(t j+m mod m+1 ) = π(t j )r j p for some path p, which is a contradiction.
Finally, we prove the claim for The following is a direct consequence of Lemmas 4.4 and 4.6.
To finish the proof of Theorem 4.1, we need only to show that the converse implication holds too.Proof.Let π be an (a 1 , . . ., a k )-match for I r O and φ † R .We start with introducing some notation.The degree d(ζ) of an equivalence class ζ is the length n ≥ 0 of a longest sequence (if it exists) r 0 (t 0 , t 0 ), . . ., r n (t n , t n ) ∈ φ such that r i ∈ N R , t 0 ∈ ζ and t i ∼ φ r t i+1 for all i < n.If no longest sequence exists, we set We start with proving (a).Assume to contrary of what has to be shown that there is a t 0 with π(t 0 ) ∈ Aux I r O and an infinite sequence r 0 (t 0 , t 0 ), r 1 (t 1 , t 1 ), . . .with r i ∈ N R and t i ∼ φ r t i+1 for all i ≥ 0. By definition of (a 1 , . . ., a k )-match, π(t 0 ) ∈ Aux I r O implies that t 0 ∈ QVar(φ).As φ is finite, there exist m, n with 0 ≤ m ≤ n such that t n = t m .It follows that t 0 ∈ RCyc.Hence ψ 1 contains the conjunct ¬Aux(t 0 ) and we have derived a contradiction to π(t 0 ) ∈ Aux I r O .
We now consider (b).Because of (a), Point (i) of (b) can be proved by induction For the induction start, let s ∼ φ r t with π(s) ∈ Aux I r O and d([s ] ∼ φ r ) = 0.By definition of ∼ φ r , we have s ∼ φ t.If s = t, π(s) = π(t) trivially holds.In case s = t, the definition of ∼ φ r yields that we have r 1 (s , s), r 2 (t , t) ∈ φ, r 1 , r 2 ∈ N R , and hence π(t) ∈ N ρ I , , by the definition of I r O .Therefore, π(s) ∈ Aux I r O and s ∼ φ t lead to π(s) = π(t), by Lemma 3.4.For the induction step, define O , then π(s) = π(t).The induction start is trivial for the identity part of ∼ (0) φ r , which implies s = t.For the other part, the arguments are the same as those given for the start of the outer induction.For the induction step, we distinguish two cases: , , and thus d([s] ∼ φ r ) = n.We hence can apply (inner IH) once more to derive π(s ) = π(t) and thus get π(s) = π(t).
• There are r 1 (s, s ), r 2 (t, t ) ∈ φ such that s ∼ By Claim 1, we have (*) π(s) = π(t) whenever s ∼ π t.Note that ∼ π is an equivalence relation because it is, by Claim 1, the transitive closure of a symmetric relation.Now let the query φ be obtained from ∃ x. y.ψ CQ by identifying all terms t, t ∈ Term(φ) such that t ∼ π t .More precisely, choose from each ∼ π -equivalence class ξ a fixed term t ξ ∈ ξ and replace each occurrence of an element of ξ in ∃ x. y.ψ CQ by t ξ .By (*), π is a match for I r O and the resulting query φ .Claim 2. The unfolding of φ, has the following properties: (a) For all variables v ∈ Var(∃ x. y.ψ CQ ) \ Var(φ) there is maximally one atom (c) If there is a sequence r 0 (t 0 , t 0 ), . . ., r m (t m , t m ) ∈ φ † R with m ≥ 0, t i ∼ φ r t i+1 or t i ∼ φ t i+1 , for all i < m, and t m ∼ φ t 0 , then t i , t i ∈ Var(∃ x. y.ψ CQ )\Var(φ) and especially r i = ρ L , for all r i .
Note that the unfolding can be considered inductively.Moreover, it can be easily seen that each unfolding step uses a freshly introduced variable maximally once as successor in an atom r ∈ N R ∪ {ρ L } that is introduced in the same step and that it does not use other than such variables as successors in such atoms.Note that this directly implies (a) and (b).Together with the fact that the unfolding only uses fresh variables as successors, the assumption that a predicate ρ L ∈ φ † R can only have been introduced during unfolding yields (c).
We now can show the following: , for all i < m, and t m ∼ φ t 0 , then π(t i ), π(t i ) ∈ Aux I r O , for all i ≤ m.
First for (I).Let π(v) ∈ Aux I r O and r 1 (t 1 , v), r 2 (t 2 , v) ∈ φ , r 1 = r 2 .By Claim 2(a), we then have that v cannot be a variable introduced during unfolding.Thus, Claim 2(b) and the construction of ∃ x. y.ψ CQ yields that r 1 (s 1 , s 1 ), r 2 (s 2 , s 2 ) ∈ φ such that s 1 ∼ π t, s 2 ∼ π t, and s 1 ∼ π v ∼ π s 2 .By (*), π(s 1 ) = π(v), and thus π(s ) ∈ Aux I r O .By definition of ∼ π , s ∼ π s implies s 1 ∼ φ r s 2 .Summing up, we thus have t 1 ∼ π t 2 .Since both t 1 and t 2 occur in φ , we have t 1 = t 2 .Now for (II).By Claim 2(a), we obviously have such an implicant for all variables introduced during unfolding, which is, if it exists, the unique role atom in which such a variable occurs as successor.Let now v ∈ Var(φ), π(v) ∈ Aux I r O , and Γ = ∅.Due to the use of Fork = in ψ 1 and since π(v) ∈ Aux I r O , there is an implicant for In([v] ∼ φ r ).By ψ 3 , there thus is an implicant s for In( For (III), let r 0 (t 0 , t 0 ), . . ., r m (t m , t m ) ∈ φ with m ≥ 0, r i ∈ N R ∪ {ρ L }, t i ∼ φ t i+1 , for all i < m, and t m ∼ φ t 0 .By the construction of ∃ x. y.ψ CQ , which does not replace variables introduced during unfolding, and Claim 2(c), we have that there are r 0 (s 0 , s 0 ), . . ., r m (s m , s m ) ∈ φ with s i ∼ π t i and s i ∼ π t i and for all i ≤ m, s i ∼ φ s i+1 , for all i < m, and s m ∼ φ s 0 .Assume now, contrary to what has to be shown, that π(t i ) ∈ Aux I r O for some i ≤ m.Since s i ∼ π t i , (*) yields π(s) = π(t).Thus π(s i ) ∈ Aux I r O , which implies s i ∈ QVar(φ) by definition of (a 1 , . . ., a k )matches.Together with ∼ π ⊆∼ φ r , s i ∈ QVar(φ) implies s i ∈ Cyc.Thus, ¬Aux(s i ) is a conjunct of ψ 1 and π(s) ∈ Aux I r O , which is a contradiction.This finishes the proof of (I)-(III).
For the induction step, proceed as follows.The mapping τ is clearly well-defined for the three base cases of the induction.For (iii 0 ) this is the case because it always is applicable only once for an equivalence class of ∼ φ .By (I), τ is well-defined for the first induction step (i.e., the term t in the induction step is unique).For (ii) we must show that if there are several t already defined, the equivalence class chosen for τ (v) is the same for all t.This is obviously the case if we have π(t) ∈ Ind(A) for any such t.If this is not the case, τ (t) must have been defined by (a) (iii 0 ) or (b) during induction.For (a), we have that (iii 0 ) can only be applied for one t and only if there is no atom r(t , t ) ∈ φ , with t , t ∈ Term(φ ), r ∈ N R ∪ {ρ L } and t ∼ φ t .In the subsequent induction to define τ (t) for all other t, hence only step (ii) is applicable and the equivalence class chosen for τ (v) is the one selected during application of (iii 0 ).For (b), Claim 2(b) yields that if some τ (t) is defined during induction by step (i) or (iii), this can only happen once and only if (iii 0 ) was not applied before.Hence, in case the equivalence class of τ (t) was chosen 'arbitrarily' (i.e., though in 'Tailaccordance' to π(t)) there is no other such choice in future for any t ∈ Term(φ ) with t ∼ φ t .Step (iii) is well-defined because atoms of the form ρ L (t, v) ∈ φ must have been introduced during the construction of ψ CQ , which does not use a variable as v twice as successor (i.e., again, the term t in the induction step is unique).By construction of φ L , we further have that if the third induction step can be applied to an atom ρ L (t, v), then (i) cannot be applicable, by I.The latter also yields that only one (i) or (iii) can be applicable with (ii) for a v at the same time.But then, there must be some t defined, which can only have happened by (i 0 ).Hence, there is no ambiguity with the selection of the equivalence class.
Moreover, the mapping τ is total, which means that τ (t) is defined for all t ∈ Term(φ ).This is partly because of (III), which describes that there cannot be a 'cycle' of role/ρ atoms in φ where one variable is mapped to an unnamed element (i.e., such a variable is potentially undefined).Hence, the mapping is defined for the terms occurring in such a cycle.In addition, the case of a cycle formed by only ρ atoms is covered in base case (iii) of the definition of τ .
The constructed τ is also a match for U O and φ .To show that, we only need to consider concepts of the form A ∈ N C because of the unfolding.It is immediate that U O |= τ A(t) for all A(t) ∈ φ by Tail(τ (t)) = π(t), which is a property of the construction of τ , and Lemma 3.11.Now let r(t, t ) ∈ φ , r ∈ N R .If π(t), π(t ) ∈ Aux For ρ(t, t ) ∈ φ , (π(t), π(t )) ∈ ρ I r O , given by the semantics, directly yields that (τ (t), τ (t )) ∈ ρ U O since this is a property of the construction of τ .For ρ L (t, t ) ∈ φ , we have (π(t), π(t )) ∈ ρ I r O L and that π(t) and π(t ) must be of the form e and a e , e ∈ Ind(A) ∪ (N aux I ∩ ∆ I r O ).But then, the construction of τ implies that there is an element τ (t ) = τ (t) • ρπ(t ) ∈ ∆ U O , and then the definition of ρ U O L yields (τ (t), τ (t )) ∈ ρ U O L .Finally, we adapt τ to get a mapping from Term(φ) to ∆ U O by setting τ (t) := τ (t ) if t ∈ Term(φ) \ Term(φ ) and t ∼ φ r π(t ).It is straightforward to verify that τ is a match for U O and φ.Since τ (t) = π(t) if π(t) ∈ Ind(A) for all t ∈ Term(φ ), it is also clear that τ is an (a 1 , . . ., a k )-match.

Conclusions
In this report, we proposed an extension of the combined approach of answering CQs over ELH ⊥ -ontologies [LTW09] to answer CQs over ontologies in the rough DL ELH ⊥ρ .This, in particular, consists of the extension of the classical canonical model construction as well as that of the definition of the query rewriting.Since our techniques especially retain the P complexity of the original approach, we provide a method to directly address vague knowledge in ontologies as well as CQs that does not further increase the complexity.
I, [x] ρ I denotes the equivalence class of an element x ∈ ∆ I w.r.t. the relation ρ I .Definition 2.2 (Semantics of ELH ⊥ρ -concepts).A (rough) interpretation is a triple I = (∆ I , • I , ρ I ), where • the domain ∆ I is a non-empty set, • • I is a function that assigns to every A ∈ N C a set A I ⊆ ∆ I , to every r ∈ N R a binary relation r I ⊆ ∆ I × ∆ I , and • the indiscernibility relation ρ I is an equivalence relation on ∆ I .The function • I maps I := ∆ I and ⊥ I := ∅.It is extended to complex ELH ⊥ρconcepts as follows:

Figure 2 :
Figure 2: Semantics of a concept, its upper (dark grey) and lower (light grey) approximation.
Definition 2.4 (Assertion, ABox).Let C be an ELH ⊥ρ -concept, r ∈ N R ∪ {ρ}, and a, b ∈ N I .A concept assertion is an expression of the form C(a) and a role assertion is an expression of the form r(a, b).An ABox A is a finite set of assertions.Together, a TBox T and an ABox A form an ontology O = (T , A).I satisfies a concept assertion C(a) if a I ∈ C I , a role assertion r(a, b), r ∈ N R , if (a I , b I ) ∈ r I , and an assertion ρ(a, b) if (a I , b I ) ∈ ρ I .An interpretation that satisfies all assertions contained in an ABox A is a model of the ABox A. I is a model of an ontology O = (T , A), if it is a model for T and A.

Figure 3 :
Figure 3: The classical canonical model for the example ontology O ex .

Figure 4 :
Figure 4: The classical canonical model with the extensions for the lower approximation-constructor (before taking the symmetric and transitive closure to get the full relation ρ I O ).

Figure 5 :
Figure 5: The classical canonical model with the rough extensions.
i+1 for all i < n.We denote the set of all paths in I O as Paths(I O ) and the last element d n in a path p = d 0 r 1 d 1 • • • r n d n as Tail(p).The interpretation I r O is obtained by restricting the domain of I O to the set {Tail(p) | p ∈ Paths(I O )}.
then there is a p ∈ Paths(I O ) with Tail(p) = x C,b .Suppose that there is a sequence d i r i+1 d i+1 in this path such that r i+1 ∈ N R .By the latter and the definition of I r O , d i+1 must be of the form x D for some concept D, and Tail(p) cannot be of the form x C,b .Thus, p must be of the form d 0 ρ O d 1 ρ O • • • ρ O d n .Moreover, dρ O x D,b can hold only if d is the individual name b, or of the form x E,b / Lemma 3.5.Let C, D, E be ELH ⊥ρ , and a, b ∈ Ind(A).
then there is an e ∈ ∆ I r O such that (a, e) ∈ r I r O and e ∈ C I r O 1 .By the definition of I r O , e ∈ N ρ I .If e ∈ N I , then s(a, e) ∈ A for some role s with O |= s r.By induction hypothesis, we have that O |= C 1 (e); hence O |= ∃r.C 1 (a).Otherwise, if e is of the form e = x D ∈ N aux I , then O |= ∃r.D(a).Since O |= D D, the induction hypothesis yields x D ∈ D I r O , and hence O |= D C 1 .This implies that O |= ∃r.C 1 (a).The remaining items can be treated analogously.(⇐) (1) If O |= ∃r.C 1 (a), then (a, x C 1 ) ∈ r I r O , by definition; the induction hypothesis also yields x C 1 ∈ C I r O 1 .Hence, a ∈ (∃r.C 1 ) I r O follows.The proof for the other items is analogous.
then there is an e ∈ ∆ I r O with (a, e) ∈ ρ I r O and e ∈ C I r O 1 .By Proposition 3.2, either e ∈ N I , or e is of the form x D,b or b for some b ∈ Ind(A) and concept D. If e ∈ N I , then by the induction hypothesis, O |= C 1 (e), and hence O |= C 1 (a).If e is of the form x D,b , we either get O |= D C 1 or O |= C 1 (b) by IH (3).In the latter case, the semantics directly yields O |= C 1 (a) since (a, e) ∈ ρ I r O .For the former case, x D,b ∈ ∆ I r O together with the definition of I r O implies O |= D(b).Thus, O |= C 1 (b).Since (a, b) ∈ ρ I r O , the semantics yields O |= C 1 (a).If e is of the form b , Lemma 3.4 (1) yields (a, b) ∈ ρ I r O .By IH (5), we additionally have O |= C 1 (b) and thus O |= C 1 (a).The proof for item (2) is very similar.For (3), we can restrict ourselves to the same kinds of elements e as in the proof of item (1), by Proposition 3.2.Then, x D,a ∈ C 1 I r O implies a ∈ C 1 I r O .By IH (1), we thus get O |= C 1 (a), which corresponds to O |= (C 1 )(a).The proof of (5) is analogous to the one of (3), and the proofs of items (4) and (6) correspond the one of (2) in the same way.(⇐) (1) If O |= C 1 (a), then (a, x C 1 ,a ) ∈ ρ I r O .We then can apply IH (3) to obtain x C 1 ,a ∈ C I r O 1 .But then, the semantics directly yields a ∈ C 1 I r O .The proof for item (2) is analogous.For (3), if O |= D C 1 holds, the proof is analogous to the one of (1) and (2).Assume O |= (C 1 )(a).We then have a ∈ C 1 I r O by IH (1); the semantics then yields x D,a ∈ C 1 I r then all elements that are ρ I r O -related to a satisfy C 1 , too.By Lemma 3.4, (a, a ) ∈ ρ I r O and hence a ∈ C I r O 1 .IH (5) directly leads to O |= C 1 (a).The proof for the other items is analogous.(⇐) (1) Suppose that O |= C 1 (a) and that there is an element e ∈ ∆ I r O such that aρ I r O e and e ∈ C I r O 1 .By Proposition 3.2, e is either an individual name or of the form x D,b or b for some concept D and b ∈ N I .If e ∈ N I , we have ρ(a, b) ∈ A, by Lemma 3.4, and hence get O |= C 1 (b), by the semantics.But then, the application of (IH 1) yields b ∈ C I r O 1 , which is a contradiction.If e is of the form e = x D,b /a b , we have x D,b /a b ∈ [b] ρ I r O , by Lemma 3.4(1), and thus get b ∈ [a] ρ I r O , by the semantics.Lemma 3.4(2) then yields ρ(a, b) ∈ A. Given O |= C 1 (a), the semantics leads to O |= C 1 (b).Then, the application of (IH 3/5) yields O |= C 1 (b), which is a contradiction.For (3), there are two possible cases to be considered.However, given x D,a ∈ ∆ I r O (i.e., it is reachable in I r O ), the definition of I r O yields that O |= D(a).But then, the first case, O |= D ⊆ C 1 , by the semantics, implies the second case O |= C 1 (a).Given O |= C 1 (a), the proof basically follows the one of (1) and only differs from the latter in that Lemma 3.4 has to be applied for the case e = b ∈ IndA to obtain x D,a ∈ [a] ρ I r O and get aρ I r O b, by the transitivity of ρ I r O .

Proof.O 1 .
By definition, I r O is a model of A and all role inclusions in T .Let now C 1 C 2 ∈ T and x ∈ C I r If x ∈ N I , Lemma 3.5 (1) yields O |= C 1 (x) and O |= C 2 (x) since O |= C 1 C 2 holds.Applying Lemma 3.5 (1) leads to x ∈ C I r O 2 .The cases with x ∈ N aux I and x ∈ N ρ I can be treated analogously.

I
and p is of the form p eρ e .Proof.Notice that the five conditions consider all possible cases for the last element d n .Hence, it suffices to show that the type of element used enforces the corresponding shape of the path p.We first consider (i).Since the definition of path states that individuals can only appear in the first position of a path, we must haveTail(d) = d n = d 0 if d n ∈ Ind(A).Consider now (ii).If d n ∈ N aux I ,then by the definition of ∆ U O , p must be of the form p rx for some p ∈ ∆ U O and r ∈ N R ∪ {ρ}.By the definition of I r O , further, no element of N aux I can be an ρ O -successor.Hence, r ∈ N R .For (iii), by the same arguments as in (ii), we only have to consider the relation symbols in N R and ρ.Elements of the form x C,a neither appear in the first position of a path, nor, by the definition of I r O , as r-successors, r ∈ N R , and only have ρ O -predecessors of the form x D,a ∈ N ρ I or a.Hence, d n must be of the form proposed if Tail(p) = x C,a .Item (iv) is analogous to (iii), and (v) holds by the definition of I r O .The next Lemma 3.8 concretizes Proposition 3.7 even further, concerning the elements of ∆ U O that belong to the equivalence class of some p ∈ ∆ U O with Tail(p) ∈ N aux I .In particular, it restricts the kinds of paths occurring as elements of ∆ U O that are indiscernible from p in U O .Lemma 3.8.Let p ∈ [prx C ] ρ U O with x C ∈ N aux I , and r ∈ N R .Then either p

Figure 6 :
Figure 6: Example situation showing that Tail is not injective.
For the latter, we get p•se ∈ Paths A (I r O ), by the definition of U O , which leads to (d n , e) ∈ s I r O .By induction, Tail(q) ∈ C I r O 1 , in both cases, and d n ∈ (∃r.C 1 ) I r O follows.(⇐) If d n ∈ (∃r.C 1 ) I r O , then there is an e ∈ C I r O 1 with (d n , e) ∈ r I r O .By definition of I r Lemma 3.10, for every e ∈ [d n ] ρ I r O , there is a q ∈ [p] ρ U O such that Tail(q ) = e, and hence e ∈ C I r O 1 .This implies Let now p = p rd ∈ ∆ U O , where r ∈ N R ∪ {ρ}, and let d = Tail(p ).If r ∈ N R , then (d , d) ∈ r I r O and d is of the form x D ∈ N aux I .By Lemma 3.5, x D ∈ D I r O , and hence d ∈ (∃r.D) I r O .By Lemma 3.11 it follows that p ∈ (∃r.D) U O and by induction π(p ) ∈ (∃r.D) I .Hence there exists an e ∈ ∆ I with (π(p ), e) ∈ r I and e ∈ D I .We define π(p) := e.Alternatively, if r = ρ, then (d , d) ∈ ρ O , and by Proposition 3.7, d ∈ N ρ I .If d is of the form x D,y ∈ N up I , then d ∈ D I r O .As before, this implies that π(p ) ∈ D I , and hence, there exists an e ∈ ∆ I such that (π(p ), e) ∈ ρ I and e ∈ D I .We define π(p) := e.Finally, if d is of the form y ∈ N low I , then we set π(p) := π(p ).As a result, π satisfies Properties 1. and 3. by construction.For 4. this is the case because I also must interpret ρ as equivalence relation.To see that 2. is also satisfied, let p = d 0 r 1 d 1 • • • r n d n ∈ C U O .If d n = x D,x E for some x E ∈ N aux I , then by Lemmas 3.5 and 3.11, either (i) O |= D C or (ii) O |= E C. By construction, we have π(x D,x E ) ∈ D I and hence get π(x D,x E ) ∈ C I for (i), by the semantics.For (ii), we have that d is of the form d = p • x E (ρx D i ,x E ) i ρx D,x E , by Proposition 3.7, and also p•x E ρ U O d, by the definition of U O .Further, Lemmas 3.5 and 3.11 imply p • x E ∈ E U O .We thus have some element e ∈ ∆ I with e ∈ E I , by (IH 2), for which we have π(d)ρ I e, by (IH 4).But then, we get π(d) ∈ C I for (i), by the semantics, too.The case for d n = x D,a , a ∈ Ind(A) can be shown correspondingly.The case for d n ∈ N aux I and d n ∈ N low I is similar to (i) and (ii), respectively.

Figure 7 :
Figure 7: Unfolding rules for constructing ψ CQ I r O .Lemma 3.4, τ (x) can only be an equivalence class of the form [b] ρ I r O , b ∈ Ind(A), or [x D ] ρ I r O , x D ∈ N aux I .From Lemma 3.5 it then follows that O |= ∃ρ.C(a) or O |= D ∃ρ.C, respectively.But then (τ (x), x C,e ) ∈ ρ I r O and x C,e ∈ C I r O , where e is either b or x D , respectively.This implies that I r O |= τ ψ n+1 .The other cases can be shown similarly.
do the following.By the definition of U O and because each d ∈ ∆ I r O is reachable from an element of Ind(A) I r O , there is a sequence d 0 , . . ., d n ∈ ∆ I r O and a sequence r 0 , . . ., r n−1∈ N R ∪ {ρ} such that d 0 ∈ Ind(A) I r O ,d n = π(v), (d i , d i+1 ) ∈ r I r O if r ∈ N R , and (d i , d i+1 ) ∈ ρ O if r = ρ for all 0 ≤ i < n.Set τ (v) := d 0 r 0 d 1 • • • r n−1 d n ∈ ∆ U O .
I r O ∪ Aux I r O ρ , then τ (t) = π(t), τ (t ) = π(t ), and (π(t), π(t )) ∈ r U O , by the definition of U O .If π(t ) ∈ Aux I r O , then the construction of τ implies that τ (t ) = τ (t) • sπ(t) with T |= s r.By the definition of U O , it follows that (τ (t), τ (t )) ∈ r U O .The cases that π(t) ∈ Aux I r O ∪ Aux I r O ρ and π(t ) ∈ Ind(A), and π(t ) ∈ Aux I r O ρ cannot occur, by the definition of I r O .
a k )-match for I and φ (or answer to φ w.r.t.I, written I |= φ(a 1 , . . ., a k )).Let now φ be a k-ary CQ and O be an ontology.Then, a tuple (a 1 , . . ., a k ), a i ∈ N I and a i occurring in O, is a certain answer to φ w.r.t.O if I |= φ(a 1 , . . ., a k ) holds for every I with I |= O.
By the definition of I r O , it follows that any path p with Tail(p) = x C,x D must contain x D , and use only the relation ρ O between x D and the tail.This thenimplies that x C,x D ∈ [x D ] ρ I r O .Having established important properties about ρ I r O We now can show that I r O is a model of O whenever this ontology is consistent.Moreover, this model provides relevant information about the properties of all models of O, which, among other reasoning tasks, can be used to answer instance queries.We start by showing that several entailments can be obtained from I r 3.1.4I O is a model of O O , which makes it easy to show that I r O is a model of O, afterwards.