Answering Fuzzy Queries over Fuzzy DL-Lite Ontologies

A prominent problem in knowledge representation is how to answer queries taking into account also the implicit consequences of an ontology representing domain knowledge. While this problem has been widely studied within the realm of description logic ontologies, it has been surprisingly neglected within the context of vague or imprecise knowledge, particularly from the point of view of mathematical fuzzy logic. In this paper we study the problem of answering conjunctive queries and threshold queries w.r.t. ontologies in fuzzy DL-Lite. Specifically, we show through a rewriting approach that threshold query answering w.r.t. consistent ontologies remains in $AC_0$ in data complexity, but that conjunctive query answering is highly dependent on the selected triangular norm, which has an impact on the underlying semantics. For the idempodent G\"odel t-norm, we provide an effective method based on a reduction to the classical case. This paper is under consideration in Theory and Practice of Logic Programming (TPLP).


Introduction
Description logics (DLs) (Baader et al. 2007) are a well-known and widely used family of knowledge representation formalisms that, thanks to their clear syntax and formal semantics, have been used to represent and deal with the knowledge of various representation domains.Among the many members of this family, a subfamily of languages with a limited expressivity, known as the DL-Lite family (Calvanese et al. 2007) has a prominent role.In fact, simplifying a bit, DL-Lite was originally designed with the goal of including background knowledge within the task of answering queries, and avoiding the need for an explicit enumeration of all the facts that are implicitly implied by the domain knowledge.
Consider for example a touristic scenario, which includes information about museums, monuments, restaurants, and pubs.Knowing that museums and monuments are touristic attractions, and that restaurants and pubs are eateries, one can immediately deduce that the modern art museum and the peace monument are touristic attractions, and that the Irish pub is an eatery, without having to make this knowledge explicit.A user may thus ask for e.g., a tourist attraction that contains an eatery.Using classical query answering techniques (Ortiz and Šimkus 2012), all attractions that satisfy this requirement can be efficiently retrieved.
Being based on classical logic, DLs in general and DL-Lite in particular are unable to handle imprecise or vague knowledge effectively.In our touristic scenario, for instance, we may want to extend the knowledge with some additional properties of the objects of arXiv:2111.11779v1[cs.AI] 23 Nov 2021 interest.For example, a tourist in a hurry may want to visit the popular attractions first; or a backpacker on a budget may be more interested in finding cheap eateries.Note that cheap and popular are two vague notions that do not allow for any precise definition.In a simplistic scenario, cheapness may be defined in terms of the mean cost for a meal, but even then, it is impossible to specify a precise price-point where an eatery stops being cheap; moreover this is also a subjective notion.The case of popularity is even worse, as there is no obvious proxy for it.
To solve this issue, fuzzy extensions of DLs have been widely studied; see for example (Borgwardt 2014;Borgwardt and Peñaloza 2017;Bobillo et al. 2015;Lukasiewicz and Straccia 2008;Cerami 2012) and references therein.In essence, fuzzy logic (Hájek 1998) extends classical logic by allowing truth degrees in the interval [0, 1] for the propositions that contain fuzzy (or vague) predicates.One can thus say, e.g., that the modern art museum is popular to a degree of 0.8 meaning, intuitively, that it is popular, but more popular attractions may exist.
Interestingly, although fuzzy DLs and their reasoning services have been widely studied, the task of answering queries based on fuzzy ontologies has been mostly ignored.Most of the earlier work from this point of view was carried out by Straccia and Pan.Specifically, Straccia (Straccia 2006) studied the problem of computing the answers with highest degree on a query w.r.t.some background knowledge.This was followed by Pan et al. (Pan et al. 2007), who considered more complex queries to be answered.While from some perspective these works seem to cover the whole area of query answering, they were based on the so-called Zadeh semantics, which does not have adequate properties from a mathematical logic point of view (Hájek 1998).Another limitation of all these approaches is that they allowed only the facts in the ontology to be graded, but restricted the terminological knowledge to be crisp (i.e., hold fully).Other work considering query answering in fuzzy DLs includes (Straccia 2012), where the k answers with the highest degree are retrieved.This latter work is closer to our approach but has several limitations.Perhaps the most obvious is that its semantics follows a closed-world assumption, even in the case of background knowledge.In addition, background knowledge is interpreted as a rule, where the degrees of the body of an axiom define the degree of the head, but knowledge about the head cannot be used to infer knowledge about the body.We, in change, use the open world assumption, as typical in knowledge representation, and use the logical interpretation of axioms.
Later on, Turhan and Mailis studied the problem of query answering w.r.t.background knowledge from the point of view of fuzzy logic (Hájek 1998), where the semantics are based on the properties of continuous triangular norms (Klement et al. 2000).They developed a technique for computing the satisfaction degrees of conjunctive queries when the semantics were based on the Gödel t-norm (Mailis and Turhan 2014).This technique, which is based on the construction of a classical query, was later implemented and shown to be effective in (Mailis et al. 2015).However, it still suffered from two main drawbacks: (i) it was only capable to handle the idempotent (Gödel) t-norm, and (ii) terminological knowledge had to still be precise, allowing no graded axioms.The latter condition is essential for the correctness of their approach: their reduction is unable to keep track of the degrees used by the terminological axioms, as this would require an unbounded memory use.
In this paper, we study the problem of query answering w.r.t.DL-Lite ontologies, filling out the gaps left by the existing work.To be more explicit, our work is the first to consider adequate semantics from the mathematical fuzzy logic point of view, alongside graded axioms stating vague knowledge beyond just vague data.We start by considering the kind of conjunctive queries studied by Turhan and Mailis, but allowing the association of numeric degrees also in the TBox.Interestingly, although this is a generalization of the previously studied setting, we are able to develop a much simpler method, which does not rely on rewriting, but rather on a reduction to a classical query answering scenario.
The method is based on the idea of cut ontologies, where all knowledge holding to a low degree is ignored.Hence, we obtain a more robust and easier to maintain approach than previous work.Still considering the Gödel t-norm, we considered the case of threshold queries, also left open in previous work, in which every conjunct in a query is assigned a different degree.In this case, a direct reduction to classical query answering does not work, but we were able to adapt the classical rewriting methods to handle the degrees effectively.
The final part of the paper considers other t-norms as the underlying semantics for the fuzzy constructors.In this case, we show through several examples that conjunctive queries cannot be easily handled, but we identify some special cases where queries can be effectively answered.On the other hand, we show that we can still apply the rewriting technique to answer threshold queries, even for non-idempotent t-norms.This is a surprising result because in the idempotent scenario threshold queries are a generalization of conjunctive queries.
Some of the results in this paper were previously published in (Pasi and Peñaloza 2020).In addition to full proofs, deeper explanations, and examples, here we extend that previous work by handling threshold queries, including the full rewriting technique from Section 5. We also provide better results for non-idempotent t-norms, and highlight some of the problems of combining conjunctions and non-idempotent t-norms in the appendix.

Preliminaries
We briefly introduce the syntax and semantics of fuzzy DL-Lite R and other related notions that will be important for this paper.Let N C , N R , and N I be three mutually disjoint sets whose elements are called concept names, role names, and individual names, respectively.The sets of DL-Lite R concepts and roles are built through the grammar rules:  Note that negations can never occur on the left-hand side of an axiom.In the remainer of this paper, we will mostly exclude the qualifiers "fuzzy," and "DL-Lite" and simply refer to axioms, ontologies, etc.
The semantics of fuzzy DL-Lite R is based on fuzzy interpretations, which provide a membership degree or for objects belonging to the different concept and role names.Formally, following the basics of classical description logics, concept names are interpreted as fuzzy unary relations, and role names are interpreted as fuzzy binary relations.To fully define this semantics in the presence of other constructors according to fuzzy logic, we need the notion of a triangular norm (or t-norm for short).
Triangular norms are used to generalize the logical conjunction to handle truth degrees that take values from the interval [0, 1].Every continuous t-norm defines a unique residuum ⇒ where f ⊗ d ≤ e iff f ≤ d ⇒ e.The residuum interprets implications.With the help of this operation, it is also possible to interpret other logical operators such as negation ( d := d ⇒ 0).The three basic continuous t-norms are the Gödel, Lukasiewicz, and product t-norms, which are defined, with their residua and negations in Table 1.These t-norms are the "fundamental" ones in the sense that every other continuous t-norm is isomorphic to the ordinal sum of copies of them (Hájek 1998;Mostert and Shields 1957).Hence, as usual, we focus our study on these three t-norms.
Note that the residuum always satisfies that d ⇒ e = 1 iff d ≤ e, and that in the Gödel and product t-norms the negation is annihilating in the sense that it maps to 0 any positive value, while the negation of 0 is 1.In particular, this means that the negation is not involutive; that is, d = d in general.In contrast, the negation operator for the Lukasiewicz t-norm is involutive.In addition, the Lukasiewicz t-norm is the only t-norm (up to isomorphism) with the property that for every x ∈ (0, 1) there exists a y ∈ (0, 1) such that x ⊗ y = 0. Specifically, this y is 1 − x.In other words, the Lukasiewicz t-norm is nilpotent.From now on, unless specified explicitly otherwise, we assume that we have an arbitrary, but fixed, t-norm ⊗ which underlies the operators used.When the t-norm becomes relevant in the following sections, we will often use G, Π, and L as prefixes to express that the underlying t-norm is Gödel, product, or Lukasiewicz, respectively, as usual in the literature.
We can now formally define the semantics of the logic.An interpretation is a pair I = (∆ I , • I ), where ∆ I is a non-empty set called the domain, and • I is the interpretation function which maps: (i) every individual name a ∈ N I to an element a I ∈ ∆ I ; (ii) every concept name A ∈ N C to a function A I : ∆ I → [0, 1]; and (iii) every role name P ∈ N R to a function P I : ∆ I × ∆ I → [0, 1].That is, concept names are interpreted as fuzzy unary relations and role names are interpreted as fuzzy binary relations over ∆ I .The interpretation function is extended to other constructors with the help of the t-norm operators as follows.For every δ, η ∈ ∆ I , (∃Q) I (δ) := sup The interpretation I satisfies the axiom It is a model of the TBox T if it satisfies all axioms in T .I satisfies the assertion It is a model of the ABox A if it satisfies all axioms in A, and it is a model of the ontology O = (T , A) if it is a model of T and of A.
We note that the classical notion of DL-Lite R (Calvanese et al. 2007) is a special case of fuzzy DL-Lite R , where all the axioms and assertions hold with degree 1.In that case, it suffices to consider interpretations which map all elements to {0, 1} representing the classical truth values.When speaking of classical ontologies, we remove the degree and assume it implicitly to be 1.

Example 3
Consider an ontology O exa = (T exa , A exa ) representing some knowledge about a touristic location.The TBox Museum Popular, 0.6 , ∃locIn ¬Cheap, 0.5 } defines some notions about eateries and tourist attractions, including some vague notions in the last two axioms.For example, it expresses that museums are popular (with a degree at least 0.6), and that services located at some attraction are not cheap (with degree at least 0.5).The ABox TouristAttraction, and is Popular to a degree at least 0.6.Under the Gödel t-norm, a possible model of O exa is depicted graphically in Figure 1, where any assertion not depicted is considered to hold to degree 0. For example, the model from Figure 1 interprets the irish pub as being Cheap to degree 0.7, which satisfies the constraint in the ABox requiring this degree to be at least 0.6.In addition, the peace monument is Popular to degree 0.3, even though there is no explicit requirement for this in O exa .Note that under this semantics, any model I of O exa should necessarily satisfy that Cheap I (sioux I ) = 0; this is in fact the case in the model from Figure 1.Hence, adding any assertion of the form Cheap(sioux), d with d > 0 to this ontology would make it inconsistent.
For this paper, we are interested in answering two kinds of queries.The first kind are conjunctive queries, which consider whether a combination of facts can be derived from the knowledge in an ontology.In the fuzzy setting, the degree of such derivation must also be taken into account.
Let N V be a set of variables, which is disjoint from N I , N C , and N R .A term is an element of N V ∪ N I ; that is, an individual name or a variable.An atom is an expression of the form C(t) (concept atom) or P (t 1 , t 2 ) (role atom).Henceforth, x and y denote tuples of variables.
Definition 4 (conjunctive query) A conjunctive query (CQ) is a first-order formula of the form ∃y.φ(x, y) where φ is a conjunction of atoms which only use the variables from x and y.The variables y are called existential variables, and those in x are answer variables.A union of conjunctive queries (UCQ) is a finite set of CQs that use the same answer variables.Henceforth, At(φ) denotes the set of all atoms appearing in φ.
As in the classical setting, an answer to a conjunctive query, or a union of conjunctive queries, is only considered when it is provided by every model of the ontology.This is usually known as a certain answer.
Given the CQ q(x) = ∃y.φ(x,y), the interpretation I, and a tuple of individuals a of the same length as x, a match is a mapping π which assigns to each a ∈ N I the value a I ; to each variable in x the corresponding element of a I ; and to each variable in y an element δ ∈ ∆ I .We extend the match π to apply to assertions as follows: π(B(t)) = B(π(t)) and π(P (t 1 , t 2 )) = P (π(t 1 ), π(t 2 )).The degree of the CQ q(x) w.r.t. the match π is That is, a match maps all the variables in the query to elements of the interpretation domain, where the tuple a is used to identify the mapping of the answer variables.The satisfaction or matching degree of the query is the (fuzzy) conjunction-that is, the t-norm-of the satisfaction or matching degrees of the atoms under this mapping.From now on, Π(I) denotes the set of all matches of q(x) w.r.t. the interpretation I.An important difference between classical query answering and our setting is that the fuzzy semantics provides a degree to every possible atom.Hence, in reality Π(I) is always defined by the set of all tuples of individuals with length |x|.However, the degree of these matches varies and may often be zero.For example, for the model I in Figure 1 and the query q(x) = Popular(x), the set of all matches Π(I) assigns to the variable x any of the constants {mA, cA, c, p, l, s, i, g} to degrees 0.7, 0.6, 0.9, 0.3, 0, 0, 0, and 0, respectively.When answering a query, one is often interested in the matches that hold to at least some degree d, as defined next.
Definition 5 (degree queries) A tuple of individuals a is an answer of the conjunctive query q(x) to degree d w.r.t. the interpretation I (denoted by I |= q(a) ≥ d) iff q I (a I ) := sup π∈Π(I) q I (a I , π(y)) ≥ d.It is a certain answer (or answer for short) of q(x) over the ontology O to degree d (denoted by O |= q(a) ≥ d) iff I |= q(a) ≥ d holds for every model I of O.The crisp set of certain answers of the query q(x) w.r.t.O and their degree is denoted by ans(q(x), O); that is, It is important to keep in mind that the atoms in a CQ are not graded, but simply try to match with elements in the domain as both concept and roles are interpreted as fuzzy relations (unary and binary, respectively).The use of the truth degrees in the ontology becomes relevant in the degree of the answers found.Moreover, recall that every tuple of individuals of length |x| belongs to ans(q(x), O), but with different associated degrees.
Returning to our example, while all individuals belong to the set ans(q(x)), for the query q(x) = Popular(x) to some degree, the certain answers for q(x) w.r.t.O exa to degree at least 0.6 are only modernArt, contArt, and comic.The latter one is the only answer to degree at least 0.8.
The second kind of query we are interested in generalises that of degree queries, when considering the Gödel semantics, by allowing a degree threshold for each of the atoms in the conjunction, rather than for the overall conjunction.We formally define this class next.

Definition 6 (threshold queries)
A threshold atom is an expression of the form α ≥ d, where α is an atom and d ∈ [0, 1].A threshold query (TQ) is a first-order formula of the form ∃y.φ(x, y) where φ is a conjunction of threshold atoms using only the variables from x and y.
The notion of a match and an answer to a threshold query are analogous to those of degree queries, with the proviso that the degree bounds apply at the level of atoms, and not at the level of queries.
Definition 7 (TQ answer ) Given an interpretation I and a tuple of individuals a, the match π satisfies the threshold atom α ≥ d (denoted by π |= α ≥ d) iff α I ≥ d.It satisfies the threshold query q(x) = ∃y.φ(x,y) (π |= q(a)) iff π |= α ≥ d holds for every threshold atom in q.
A tuple of individuals a is an answer to the TQ q(x) w.r.t. the interpretation I (I |= q(a)) iff there is a match π w.r.t. a and I such that π |= q(a).It is a certain answer of q(x) over the ontology O iff for every model I of O it holds that I |= q(a).
Note that, differently from conjunctive queries, but in an analogous manner to degree queries, the answers to a threshold query are not graded.Indeed, a tuple a may or may not be an answer, and we are interested in finding those tuples which satisfy the degrees at each of the threshold atoms.In a sense, threshold queries provide a more fine-grained structure to deal with the properties of interest within a query in relation to degree queries.Indeed, in a degree query, one can only provide an overall degree which should be obtained after the degrees of all the atoms are conjoined via the t-norm.In particular, for non-idempotent t-norms and large queries, this conjunction will tend to be smaller and smaller, and the degrees of the independent atoms have the same influence overall.Even when considering the idempotent Gödel t-norm, a degree query q(x) ≥ d only expresses that all the atoms in q should hold to degree at least d (recall that the Gödel t-norm refers to the minimum operator), but it is not possible to express that some atoms should hold with a higher degree.A threshold query, on the other hand, is capable of requiring different degrees for each of the atoms.

Example 8
Suppose, in our running example, that we are interested in finding a cheap eatery that is nearby a popular tourist attraction, and that we are using the Gödel semantics.This basic query could be expressed as1 q(x) = ∃y.Cheap(x), Popular(y), near(x, y).
Since this query considers vague concepts and roles, we want to find answers that satisfy it to at least some degree.For the degree query q(x) ≥ 0.6, the only possible answer is the irish pub.
Suppose now that for us it is more important that the eatery is cheap than the popularity of the tourist attraction.For example, even though we are content with the tourist attraction being popular to only degree 0.6, the eatery should be cheap to a degree at least 0.8.This can be expressed through the threshold query q (x) = ∃y.Cheap(x) ≥ 0.8, Popular(y) ≥ 0.6, near(x, y) ≥ 0.6.
In this case, the TQ has no answers w.r.t. the ontology O.However, any answer to q would also be an answer to q(x) ≥ 0.6, as overall they define the same minimum over all the degrees of interest.Note that this last claim only holds for the case of the Gödel semantics.Indeed, as we will see later in this paper, for other semantics degree queries are not properly special cases of TQs.
A class of conjunctive queries of special significance is that where the tuple of answer variables x is empty.This means that the answer tuple of individuals provided as an answer must also be empty.In the classical setting, these are called Boolean queries, because they can only return a Boolean value: true if there is a match for the existential variables in every model, and false otherwise.In the fuzzy setting, the set of answers to such a query will only contain one element ((), d).Thus, in that case, we are only interested in finding the degree d, and call those queries fuzzy queries.This degree is the tightest value for which we can find a satisfying matching.Formally, the ontology O entails the fuzzy query q() to degree d iff O |= q() ≥ d and O |= q() ≥ d for all d > d.Fuzzy queries allow us to find the degree of a specific answer a without having to compute ans(q(x), O): simply compute the degree of the fuzzy query q(a).
In the case of threshold queries, we can also consider the special case where the answer tuple x is empty.In that case, as in the classical case, the only possible answer is the empty tuple (if there is a match which satisfies the query) or no answer if no such match exists.For that reason, in the case of threshold queries without answer variables we preserve the classical terminology and call them Boolean (threshold) queries.
As it is typically done for query answering in description logics, we consider two measures of complexity: data complexity, where only the size of the ABox (and the candidate answer, if any) is considered as part of the input, and combined complexity in which the size of the whole ontology (including the TBox) is taken into account.2For data complexity, it is relevant to consider sub-linear complexity classes.In particular, we consider AC 0 and LogSpace.For the full formal definitions, we refer the interested reader to Papadimitriou (1994) and Boppana and Sipser (1990).Here we only mention briefly that evaluation of FO-queries over a database is in AC 0 on the size of the database (Abiteboul et al. 1994) and AC 0 is strictly contained in LogSpace (Furst et al. 1984).
In classical DL-Lite R , query answering w.r.t. an ontology is reduced to the standard problem of query answering over a database through a process known as query rewriting, and thus is in AC 0 w.r.t.data complexity.The main idea is to include in the query all the information that is required by the TBox, in such a way that only assertions from the ABox need to be considered.In our running example, note that there is no assertion in the ABox A exa which explicitly mentions a tourist attraction.We only know that the two monuments and the three museums are tourist attractions thanks to the TBox.In this case, the query rewriting approach would take the query q(x) = TouristAttraction(x) and transform it into the UCQ {TouristAttraction(x), Museum(x), Monument(x)} looking "backwards" over the axioms in the TBox.The answers of this UCQ over the ABox alone are exactly those of the original query over the whole ontology.
As seen in this simple example, there are many possible choices to create the matches that comply with the TBox.Hence, this method results in a UCQ even if the original query is a simple CQ.At this point, the ABox is treated as a database, which suffices to find all the certain answers.Similarly, a special UCQ can be used to verify that the ontology is consistent; that is, whether it is possible to build a model for this ontology.For the full details on how these query rewritings work in classical DL-Lite R , see (Calvanese et al. 2007).In terms of combined complexity, consistency can be decided in polynomial time; in fact, it is NLogSpace-complete (Artale et al. 2009).

The Canonical Interpretation
A very useful tool for developing techniques for answering queries in DL-Lite R is the canonical interpretation.We first show that the same idea can be extended (with the necessary modifications) to fuzzy ontologies, independently of the t-norm underlying its semantics.
Let O = (T , A) be a DL-Lite R ontology and assume w.l.o.g. that there are no axioms of the form ∃Q 1 ∃Q 2 , d ∈ T ; any such axiom can be substituted by the two axioms where N N is a countable set of constants-obtained through the following (infinite) process.Starting from the empty interpretation which sets A Ican (δ) = 0 and P Ican (δ, η) = 0 for every A ∈ N C , P ∈ N R and δ, η ∈ ∆ Ican , exhaustively apply the following rules: then select a fresh element η 0 such that P Ican (δ, η 0 ) = 0 and update the value then select a fresh element η 0 such that P Ican (η 0 , δ) = 0 and update the value where the rules are applied in a fair manner; that is, an applicable rule is eventually triggered.The process of rule application is a monotone non-decreasing function, and as such has a least fixpoint, which is the canonical interpretation I can (O).imposed by the ABox are satisfied, by setting the degrees of the unary and binary relations to the smallest required value.The remaining rules guarantee that all elements of the domain satisfy the positive axioms from the TBox, and each rule is as weak as possible in satisfying these constraints.The canonical interpretation of the ontology O exa from Example 3 is depicted in Figure 2. Note that in general it provides a lower membership degree of each individual to every concept when compared to the model from Figure 1.This intuition justifies the name of canonical interpretation.As in the classical case, I can (O) can be homomorphically embedded in every model of O, and hence be used as a representative of them all.We show a similar result with the difference that in this case, the homomorphism needs to take into account the truth degrees from the interpretation function as well.4This is described in the following proposition.

Proof
Let O = (T , A).We construct the function ψ recursively through the rule applications that define A Ican , and show that the two properties from the proposition are invariant w.r.t. the rule applications.We define first ψ(a) = a I for all a ∈ N I .Recall that initially, Hence, the properties hold trivially in this case.Assume now that the properties hold before a rule application; we show that they also hold afterwards by a case analysis over the rule used: R3. if A 1 A 2 , d ∈ T , the rule application over a given δ ∈ ∆ Ican updates A Ican 2 (δ) to A Ican 1 (δ) ⊗ d.Since I satisfies this axiom, by the induction hypothesis and monotonicity of ⊗ we know that let δ be the element over which the rule is applicable, and η 0 the fresh element selected by the rule application.Since I is a model, we know that there exists an element κ ∈ ∆ I such that P I (ψ(δ), κ) ≥ A I (ψ(δ)) ⊗ d.We thus define ψ(η 0 ) := κ.By the induction hypothesis and monotonicity of ⊗ we get let δ be the element over which the rule is applicable, and η 0 the fresh element selected by the rule application.Since I is a model, we know that there exists an element κ ∈ ∆ I such that P I (κ, ψ(δ)) ≥ A I (ψ(δ)) ⊗ d.We thus define ψ(η 0 ) := κ.By the induction hypothesis and monotonicity of ⊗ we get Since I satisfies this axiom, by the induction hypothesis and monotonicity of ⊗ we know that Hence, the result holds after the fair application of all possible rules.
Importantly, note that the construction of I can (O) does not take the negations into account; e.g., the axiom ∃locIn ¬Cheap, 0.5 is never used during this construction.The effect of this is that I can (O) might not be a model of O at all.

Example 10
Consider the fuzzy DL-Lite R ontology O exa = (T 0 , A 0 ) where Under the Gödel semantics, by application of the first rule, the canonical interpretation maps A Ican 1 (a) = A Ican 2 (a) = 0.5.However, this violates the axiom in T 0 , which requires that , which is only possible when A Ican 1 (a) = 0 or A Ican 2 (a) = 0. Note that a similar phenomenon could be observed also in the TBox T exa of our running example, which contains an axiom with a negated concept.
The issue is that the negative axioms may introduce inconsistencies, by enforcing upper bounds in the degrees used, which are not verified by the canonical interpretation; recall, in fact, that the previously described construction monotonically increases the degrees to satisfy the minimal requirements, but never verifies whether these degrees affect some upper bound.On the other hand, we can prove that, as long as there is a model, I can (O) is one.

Proof
The only if direction is trivial, hence we focus on showing that if O is consistent, then I can (O) is a model of O.Note first that, by construction, I can (O) satisfies all positive axioms.Otherwise, a rule would trigger, and since the construction applies all rules fairly until exhaustion, no rule is applicable in the resulting interpreation I can (O).Hence, if I can (O) is not a model of O, there must exist a negative axiom of the form (i) B ¬C, d or (ii) Q ¬R, d that is not satisfied by the canonical interpretation.We consider the case (i); the other case can be treated analogously. If But this means that I |= B ¬C, d , which contradicts the assumption that I was a model of O.
It can be seen that the ontology O 0 from Example 10 is inconsistent under the Gödel semantics.On the other hand, under the Lukasiewicz semantics, O 0 is in fact consistent which, by this proposition, means that I can (O) is a model of this ontology.This is easily confirmed by recalling that the Lukasiewicz negation is involutive; that is d = 1 − d.
In the case of the example, we have 0.5 = 0.5; the axiom A 1 ¬A 2 , 1 is satisfied because 0.5 = A Ican 1 (a) ≤ (¬A 2 ) Ican (a) = 0.5.The consequence of the last two propositions is that I can (O) is complete for existential positive queries, and in particular for conjunctive queries and threshold queries.

Corollary 12
If O is a consistent fuzzy DL-Lite R ontology, then 1. for every CQ q(x), answer tuple a, and for every TQ q(x) and answer tuple a, O |= q(a) iff I can (O) |= q(a).

Proof
Proposition 11 states that I can (O) is a model; hence anything that does not follow from it cannot be an answer.On the other hand, Proposition 9 states that the degree of every atom in any model is at least the degree given by I can , and hence if a tuple is an answer in I can , it is also an answer in every other model.

A short note on the canonical interpretation
Before delving deeper into the process of answering queries (the main contribution of this paper), it is worth considering the canonical interpretation in more detail, starting From the empty interpretation (a), R1 is applied to each assertion to reach (c).One can either apply R4 to A ∃R, 0.3 and go through the upper branch (d) to build the interpretation (e); or to B ∃R, 0.5 and obtain (f) directly.
with the definite article used in its naming.Indeed, although we always speak about the canonical interpretation, the actual structure produced is not necessarily unique, and depends on the order in which rules are chosen to apply, specially in relation to rules R4 and R5, which introduce new relevant elements.This is highlighted in the following example.

Example 13
Consider an ontology containing the axioms After applying the rule R1 over the ABox axioms, we have an interpretation where A Ican (a) = B Ican (a) = 1.At this point, rule R4 is applicable for any of the two axioms in T .If we first apply it to the first axiom, we select a fresh element, e.g.η 0 and set R(a, η 0 ) = 0.3; at this point, the rule is still applicable to the second axiom.This application requires selecting a new fresh element (now η 1 ) and set R(a, η 1 ) = 0.5.At this point, no rules are applicable and we have a canonical interpretation.
If instead we chose first to apply the rule on the second axiom, we would choose a fresh element (say, η 2 ) and set R(a, η 2 ) = 0.5.This application immediately disallows the application of the rule to the first axiom, and hence the process stops.
Note that the two interpretations built in this example are not equivalent (see Figure 3).However, they are homomorphic in the sense specified by Proposition 9.This is not a coincidence.In fact, note that the proofs of Propositions 9 and 11 do not depend on the order of rule applications, but only on the fact that these rules were exhaustively (and fairly) applied.If the ontology is consistent, by the latter proposition the interpretation obtained is a model, regardless of the order chosen, and by the former proposition, it is homomorphic to all the interpretations which can be derived following different application orderings.In other words, the canonical interpretation is unique up to homomorphism.
In the following, we disregard this issue and consider an arbitrary, but fixed, canonical interpretation as unique.
We now return to the issue of answering queries.Corollary 12 states that these queries can be answered through the canonical interpretation.Obviously, such an approach is impractical; in fact, impossible, because it is an infinite model constructed through an infinitary process.Additionally, we still have the burden to prove that the ontology is consistent, which is a prerequisite for the use of Corollary 12 to answer queries.Fortunately, for the Gödel and product t-norms, we can resort to existing results from the literature for this latter task.
That is, O contains all the axioms and assertions from O which hold with a positive degree-note that any fuzzy axiom or assertion with degree 0 could be removed w.l.o.g.anyway.The following result is a direct consequence of work on more expressive fuzzy DLs (Borgwardt et al. 2015).

Proposition 15
Let O be a G-DL-Lite R or Π-DL-Lite R ontology.Then O is consistent iff O is consistent.
In those cases, consistency checking can be reduced to the classical case, without the need to modify the query or the basic formulation of the ontology.For the ontology O 0 in Example 10, we have O 0 = ({A 1 ¬A 2 }, {A 1 (a), A 2 (a)}), which is inconsistent in the classical case, thus showing (through Proposition 15) that it is inconsistent under the Gödel and product t-norm semantics.We note that the example also shows that Proposition 15 does not hold for the Lukasiewicz t-norm, since we have established that O 0 is consistent under this semantics, although its classical version remains inconsistent under classical interpretations.
A particular consequence of Proposition 15 is that deciding consistency of G-DL-Lite R and Π-DL-Lite R ontologies is in AC 0 w.r.t.data complexity, and NLogSpace-complete w.r.t.combined complexity, where the NLogSpace lower bound comes from known results in classical DL-Lite R (Artale et al. 2009).Thus adding truth degrees does not affect the complexity of this basic reasoning task.We now turn our attention to the task of query answering with the different semantics, starting with the idempotent case of the Gödel t-norm.We consider first the case of conjunctive queries, which allows for a simple solution, and then study threshold queries for which a rewriting technique is needed.
Before studying how to answer queries over fuzzy DL-Lite R ontologies and its complexity, we note that in the case that an ontology is classical-i.e., it uses only degree 1 in all its axioms-its canonical interpretation constructed as described in this section is equivalent to the classical canonical interpretation from (Calvanese et al. 2007).This fact will be used in the following sections.
For this and the following section, we are always considering the Gödel t-norm as the underlying operator for interpreting all fuzzy statements, and in particular the conjunctive queries.
The Gödel semantics are very limited in their expressivity.On the one hand, we have seen that d ∈ {0, 1} for all d ∈ [0, 1].This means that whenever we have an axiom of the form B ¬B , d or Q ¬Q , d with d > 0, we are in fact saying that for every element δ ∈ ∆ I , if B I (δ) > 0, then B I (δ) = 0-because in this case B I (δ) = 1, which is the only possible way of satisfying the axiom.A similar argument holds for role axioms.Thus, for this section we can assume w.l.o.g. that all negative axioms hold with degree 1; i.e., they are of the form B ¬B , 1 or Q ¬Q , 1 .On the other hand, a positive axiom of the form B B , d requires that for every δ ∈ ∆ I , B I (δ) ≥ min{B I (δ), d}.That is, the only way to guarantee that an atom gets a high degree is to use axioms with a high degree.We use these facts to reduce reasoning tasks in this setting to the classical DL-Lite R scenario.
Consider a consistent G-DL-Lite R ontology O.We can decide a lower bound for the degree of a CQ simply by querying a cut of O.
Definition 16 (cut ontology) Given a value θ ∈ (0, 1], the θ-cut of the ontology O is defined as the sub-ontology O ≥θ := (T ≥θ , A ≥θ ) where That is, O ≥θ is the subontology containing only the axioms and assertions that hold to degree at least θ.To show that θ-cuts suffice for answering queries, we use the canonical interpretation.
Note that including new axioms or assertions to an ontology would result in an update of the canonical interpretation which only increases the degree of some of the elements of the domain.More precisely, if is the result of applying the construction rules starting from I can (O).This holds because the resulting canonical interpretation is not dependent on the order in which rules are applied (and hence axioms taken into account) as long as this is done fairly.5Since I can (O) has already applied all the rules on axioms of O exhaustively, the only remaining rule applications will be based on the new axiom B C, d and new applications over T arising from it.Under the Gödel semantics, all the updates increase the interpretation function up to the value d; that is, if • I can is the interpretation function of I can (O ), the difference between I can (O) and I can (O ) is that there exist some elements such that A Ican (δ) < A I can (δ) = d, and similarly for roles there exist some pairs δ, η such that P Ican (δ, η) < P I can (δ, η) = d.For all others, the degrees remain unchanged.Moreover, if d 0 is the smallest degree appearing in the ontology O, then its canonical interpretation uses only truth degrees in {0} ∪ [d 0 , 1]; that is, no truth degree in (0, d 0 ) appears in I can (O).With these insights we are ready to produce our first results.Recall, once again, that for the rest of this section, we always consider that the semantics is based on the Gödel t-norm; i.e., we have a G-DL-Lite R ontology.

Lemma 17
Let O be a consistent G-DL-Lite R ontology, q(x) a query, a a tuple of individuals, and For the converse, assume that O ≥θ |= q(a) ≥ θ.By Corollary 12, this means that Recall that the difference between O and O ≥θ is that the former has some additional axioms with degrees smaller than θ.As argued before, this means that the difference between I can (O) and I can (O ≥θ ) are just some degrees, which are all smaller than θ; that is, for every A ∈ N C , P ∈ N R , and δ, η By assumption, this means that q I can (a I can ) < θ, and hence What this lemma states is that in order to find a lower bound for the degree of a query, one can ignore all the axioms and assertions that provide a smaller degree than the bound we are interested in.However, one still needs to answer a query for a fuzzy ontology (O ≥θ is still fuzzy), for which we still do not have any effective method.The following lemma solves this issue, considering the classical version of this ontology.

Proof
Every model of O is also a model of O, with the additional property that the interpretation function maps all elements to {0, 1}.If O |= q(a) ≥ θ > 0, then for every model I of O it holds that q I (a I ) ≥ θ > 0, and thus q I (a I ) = 1, which means that O |= q(a).
Conversely, if O |= q(a), the canonical interpretation I can (O) must be such that q Ican (a Ican ) > 0; but as argued before, since O only has axioms and assertions with degrees ≥ θ, it must be the case that all degrees of I can (O) are in {0} ∪ [θ, 1], and hence q Ican (a Ican ) ≥ θ.This implies, by Corollary 12 that O |= q(a) ≥ θ.
Note that the condition of this lemma, which requires that O ≥θ = O, is only stating that all the degrees in the ontology O are at least θ.That condition is immediately satisfied by a cut ontology, and hence the lemma can be applied directly to it.
Lemmas 17 and 18 together provide a method for reducing answering degree queries over G-DL-Lite R ontologies to query answering in classical DL-Lite R .
Algorithm 1: Compute the degree of an answer to a query Data: Ontology O, query q, answer a, D = {d 0 , d 1 , . . ., d n+1 } Result: The degree of q(a) w.r.t.O This means that we can use a standard ontology-based query answering system to answer fuzzy queries in DL-Lite R as well.Note that the approach proposed by Theorem 19 can only decide whether the degree of an answer to a query is at least θ, but it needs the value θ ∈ (0, 1] as a parameter.If, instead, we are interested in computing the degree of an answer, or ans(q(x), O), we can still use a classical query answering method as an underlying black-box aid as described next.
Since the TBox T and the ABox A which compose the ontology O are both finite, the set D := {d | α, d ∈ T ∪ A} of degrees appearing in the ontology is also finite; in fact, its size is bounded by the size of O. Hence, we can assume that D is of the form D = {d 0 , d 1 , . . ., d n , d n+1 } where d 0 ≥ 0, d n+1 = 1 and for all i, 0 ≤ i ≤ n, d i < d i+1 .In order to find the degree of an answer a to a query q, we proceed as follows: starting from i := n + 1, we iteratively ask the query O ≥di |= q(a) and decrease i until the query is answered affirmatively, or i becomes 0 (see Algorithm 1).In the former case, d i is the degree for q(a); in the latter, the degree is 0-i.e., a is not an answer of q. 6During the execution of this algorithm, each classical query needed at line 3 can be executed in AC 0 (and in particular in LogSpace) in the size of the data; i.e., the ABox as shown in (Artale et al. 2009).The iterations in the loop do not affect the overall space used, as one can simply produce a new query every time and clean up the previous information.Overall, this means that the degree of an answer can be computed in LogSpace in data complexity, using a classical query answering engine.

Corollary 20
The degree of an answer a to a query q w.r.t. the G-DL-Lite R ontology O is computable in logarithmic space w.r.t. the size of the ABox (i.e., in data complexity).
We will later see that this upper bound can indeed be reduced to AC 0 by seeing a degree query as a special case of a threshold query.However, the method that provides a tight complexity bound requires a new implementation of the rewriting approach, with all its associated optimizations, in contrast to the method from Algorithm 1, which can simply call any existing classical tool; e.g.(De Giacomo et al. 2012;Calvanese et al. 2015).
Computing the whole set of pairs ans(q(x), O) is a more complex task.Although we can follow an approach similar to Algorithm 1, where the answers to q(x) are computed for each ontology O ≥di , in order to assign the appropriate degree to each answer, we need to either keep track of all the answers found so far, or add a negated query which excludes the answers with a higher degree.In both cases, we require a different approach and a potential larger use of memory.On the other hand, the whole set of answers ans(q(x), O) will usually contain many answers that hold with a very low degree, which may not be of much interest to the user making the query.When dealing with degrees, a more meaningful task is to find the k answers with the highest degree, for some natural number k; i.e., the top-k answers of q.
Algorithm 1 once again suggests a way to compute the top-k answers.As in the algorithm, one starts with the highest possible degree, and expands the classical ontology by including the axioms and assertions with a lower degree.The difference is that one stops now when the query returns at least k tuples as answers.At that point, the tuples found are those with the highest degree for the query.As before, each of these queries can be answered in AC 0 in data complexity, which yields a LogSpace upper bound for answering top-k queries in data complexity.

Corollary 21
Top-k queries over consistent G-DL-Lite R ontologies can be answered in logarithmic space w.r.t. the size of the ABox.

Threshold Queries over Gödel Semantics
We now turn our attention to the case of threshold queries, but keeping the assumption of the Gödel semantics in place.The first thing to notice when considering threshold queries is that the simple approach developed in the previous section, where one calls a classical query answering engine over a cut subontology, cannot work.Indeed, as each atom needs to be satisfied potentially to a different degree, there is no one cut that can suffice to answer them all.Indeed, we have already seen a TQ in Example 8 which has no answers even though the natural cut ontology provides one answer.
When considering Boolean threshold queries, it may be tempting to simply try to verify each threshold atom separatedly through a cut ontology.However, such an approach is not sound due to the existentially quantified variables which need to be associated to a (potentially anonymous) individual.This problem is not new, as it arises already for conjunctive queries over classical databases.
To answer these queries, we will adapt the query rewriting technique from the classical setting.The underlying idea is essentially the same, as described previously in this paper, where an atom B(x) may be substituted by an atom C(x) if the TBox contains the axiom C B. However, one has to be careful with the degrees used.In fact, some axioms may not be applied during the rewriting, if their degree is not large enough.

Example 22
Consider once again the TBox T exa from Example 3, and suppose that we are interested in finding all popular attractions, up to a given degree d ∈ [0, 1]; that is, we have the query q(x) = Popular(x) ≥ d.The TBox contains the axiom Museum Popular, 0.6 .This means that answers to q(x) w.r.t.this TBox should also include the answers to Museum(x), but this depends on the value of d, as we explain next.
Suppose that d > 0.6; e.g., if we have q(x) = Popular(x) ≥ 0.7.For an individual a and any model I of the ontology, we have no guarantee that Popular I (a I ) ≥ 0.7 regardless of the degree of Museum I (a I ).Indeed, even if Museum I (a I ) = 1, the only thing that can be guaranteed is that the degree of a belonging to Popular is at least 0.6, which does not suffice to become a positive answer to the query.Hence, there is no need to include Museum in the rewriting.
Suppose now that d ≤ 0.6; e.g., with the query q(x) = Popular(x) ≥ 0.5.In this case, we note that every individual a such that Museum I (a I ) ≥ 0.5 must satisfy also that Popular I (a I ) ≥ 0.5.Indeed, recall that under the Gödel semantics, f ⇒ e is either e if e ≤ f or 1 otherwise.Since I satisfies the axiom Museum Popular, 0.6 , whenever f = Museum I (a I ) ≥ 0.5 holds, we know that the degree e of Popular I (a I ) must be such that f ⇒ e ≥ 0.6.If e ≤ f , this can only be true if e ≥ 0.6 > 0.5.Otherwise, we know that e > f ≥ 0.5, and hence any individual belonging to the concept Museum to degree at least 0.5 is an answer to the query q(x).
This example shows that during the rewriting process, we only need to consider the axioms that hold to a degree greater than the threshold of the current atom of interest.During the rewriting step, the original threshold is preserved regardless of the bound from the axioms.We now proceed to describe the rewriting process in detail, following the ideas developed originally for classical DL-Lite R and other members of the DL-Lite family through the PerfectRef algorithm.To aid understanding from readers knowledgeable with the original method, we preserve as much of the terminology from (Calvanese et al. 2007) as possible.From now on, in a query q(x) = ϕ(x, y), we call all the variables in x distinguished, and any variable that appears at least twice within a query shared.Note that there is no need to keep track of the variables that are not distinguished nor shared (from now on, called undistinguished, unshared variables); it is only relevant that they can be adequately assigned a value.Hence, those variables will be denoted by an underscore (' '), and use y = to express that y is one such variable.
Definition 23 (applicability) An axiom α is applicable to the threshold atom A(x) ≥ d iff α is of the form C A, e and d ≤ e.It is applicable to the threshold atom P (x 1 , x 2 ) iff either (i) x 2 = and α is of the form C ∃P, e with d ≤ e; (ii) x 1 = and α is of the form C ∃P − , e ; or (iii) α is of the form Q P, e or Q P − , e with d ≤ e.
If α is applicable to the threshold atom γ, the result of the application is the atom gr(γ, α) defined through the rules in Figure 4.
The PerfectRef algorithm constructs a union of threshold queries by iteratively substituting atoms γ for which an axiom α is applicable, with the result gr(γ, α) of the application.This follows the idea of tracing backwards the axioms in order to absorb the TBox into the query which was previously outlined.The pseudocode for PerfectRef is more formally described in Algorithm 2. In the algorithm, q[γ, η] is the query resulting from substituting in q the atom γ with the atom η.The function reduce(p, γ 1 , γ 2 ) called in line 10 simply returns the query obtained by applying the most general unifier between γ 1 and γ 2 to For unification, all nondistinguished, unshared variables are considered different.For simplicity, we always assume that all nondistinguished, unshared variables are known, and hence call them when testing applicability.
Note that, just as in the classical case, the application of the reduce function is necessary to guarantee correctness of the rewriting.Specifically, a variable that is bound in a query p may become unbound after the unification process, which may allow more axioms to be applied for the rewriting.
Once again, the algorithm takes as input a threshold query q, and returns a union of threshold queries T which is constructed by taking into account the information from the TBox T .The importance of this rewriting is that at this point, the answers to the original query q w.r.t. an ontology O = (T , A) can be obtained by applying the query T to the ABox A, seen as a standard database.
Let db(A) be the ABox A seen as a database.Note that since we have fuzzy assertions, the database will contain binary relations (representing concept assertions) and ternary relations (representing the role assertions), where the last element of the relation is the degree; a number in the interval [0, 1].Under this view, a threshold query can also be seen as a conjunctive query, taking into account the inequalities in the selection.Given a union of threshold queries T , U CQ(T ) denotes the fact that T is being read as a UCQ in this sense.Given an ABox A and a union of TQs T , we denote by ans(db(A), U CQ(T )) the set of answers to T w.r.t.db(A) from a database perspective.We also denote by ans(q, O) the set of answers to the TQ q w.r.t. the ontology O.We then obtain the following result.

Theorem 24
Let O = (T , A) be a consistent G-DL-Lite R ontology, q a TQ, and T the union of TQs obtained through the rewriting.Then ans(q, O) = ans(db(A), U CQ(T )).
A consequence of Theorem 24 is that, in terms of data complexity, answering a TQ w.r.t. a DL-Lite R ontology is at most as costly as answering a CQ over a database.Indeed, note that althought the query q is transformed into a larger UCQ, the data itself remains unchanged.This yields the following result.

Theorem 25
Answering threshold queries w.r.t.consistent G-DL-Lite R ontologies is in AC 0 w.r.t.data complexity.
Before finishing this section, we return to a question on complexity left open in the previous section; namely, the precise complexity of finding the degree of an answer to a conjunctive query.To answer this question, we first note that under the Gödel semantics, we can always see a degree query as a special case of a threshold query.
Given a CQ q, let At(q) be the set of all the atoms in q.For a degree d ∈ [0, 1], we can define the TQ T Q(q, d) = γ∈At(q) γ ≥ d.That is, T Q(q, d) uses the same atoms as q, but assigns a minimum degree of d to each of them.Since the Gödel semantics interprets the conjunction through the minimum operator, any answer of T Q(q) yields a degree of at least d to the original query q.

Lemma 26
Let O be a consistent G-DL-Lite R ontology, q a CQ, a an answer tuple, and In order to find the degree of an answer, we can simply add as an answer variable after the rewriting one that looks at the degrees from the database db(A).This does not affect the overall data complexity, and hence remains in AC 0 .

Corollary 27
Answering conjunctive queries w.r.t.consistent G-DL-Lite R ontologies is in AC 0 in data complexity.
This finishes our analysis of the Gödel t-norm, which also provides our main results.In the following section we briefly visit the case where the underlying t-norm is not idempotent, and showcase that in general dealing with such semantics becomes harder.

Non-idempotent t-norms
We now move our attention to the t-norms that are not idempotent; in particular the product and Lukasiewicz t-norms.Unfortunately, as we will see, the correctness of the reductions and algorithms presented in the previous sections rely strongly on the idempotency of the Gödel t-norm, and does not transfer directly to the other cases.However, at least for the product t-norm, it is still possible to answer some kinds of queries efficiently.
First recall that Proposition 15 holds for the product t-norm as well.Hence, deciding consistency of a Π-DL-Lite R ontology remains reducible to the classical case and thus, efficient.We now show with simple examples that the other results do not transfer so easily.

Example 28
Consider the ontology O exb := (T exb , A exb ) where T exb := { A i A i+1 , 0.9 | 0 ≤ i < n} and A exb := { A 0 (a), 1 }.Note that O exb = (O exb ) ≥0.9 , but the degree for the query q() = A n (a) is 0.9 n which can be made arbitrarily small by making n large.Similarly, it is not possible to find the top-k answers simply by layering the θ-cuts for decreasing values of θ until enough answers can be found.

Example 29
Let O exb := (T exb , A exb ), where A exb := A exb ∪ { A n (b), 0.85 } and T exb , A exb are as in Example 28.The top answer for q(x) = A n (x) is b with degree 0.85, but from (O exb ) ≥0.9 we already find the answer a, which is not the top one.
The main point with these examples is that, from the lack of idempotency of the t-norm ⊗, we can obtain low degrees in a match which arises from combining several axioms and assertions having a high degree.On the other hand, the product behaves well for positive values in the sense that applying the t-norm to two positive values always results in a positive value; formally, if d, e > 0, then d ⊗ e > 0. Thus, if we are only interested in knowing whether the result of a query is positive or not, there is no difference between the Gödel t-norm and the product t-norm.

Definition 30
A tuple a is a positive answer to the query q(x) w.r.t. the ontology O (denoted by O |= q(a) > 0) iff for every model I of O it holds that q I (a I ) > 0.

Proof
Every model of O is also a model of O, with the additional property that the interpretation function maps all elements to {0, 1}.If O |= q(a) > 0, then for every model I of O it holds that q I (a I ) > 0 and thus q I (a I ) = 1, which means that O |= q(a).
Conversely, if O |= q(a), then the canonical interpretation is such that q Ican (a Ican ) > 0, and hence for every model I it also holds that q I (a I ) > 0. This means that, for the sake of answering positive queries over the product t-norm, one can simply ignore all the truth degrees and answer a classical query using any state-ofthe-art engine.In particular, this means that positive answers can be found in AC 0 in data complexity just as in the classical case.
We now briefly consider the Lukasiewicz t-norm, which is known to be the hardest to handle due to its involutive negation and nilpotence, despite being in many cases the most natural choice for fuzzy semantics (Borgwardt et al. 2017).As mentioned already, Proposition 15 does not apply to the Lukasiewicz t-norm.That is, there are consistent L-DL-Lite R ontologies whose classical version is inconsistent (see Example 10).As a result, there is currently no known method for deciding consistency of these ontologies, let alone answering queries.The culprits for this are the involutive negation, which is weaker than the negation used in the other two t-norms, but also the nilpotence, which may combine positive degrees to produce a degree of 0. The latter also means that, even if one could check consistency, it is still not clear how to answer even positive queries.

Example 32
Consider the ontology O 2 := (T 2 , A 2 ) where Note that O 2 is consistent, but there is a model I (e.g., the canonical interpretation) of this ontology which sets A I 2 (a I ) = 0. Hence, a is not a positive answer to the query q(x) = A 2 (x) even though it is an answer of q(x) over O 2 .
Importantly, if we extend DL-Lite R with the possibility of using conjunctions as constructors for complex concepts, one can show following the ideas from (Borgwardt et al. 2017;Borgwardt et al. 2014) that deciding consistency of a L-DL-Lite R ontology is NP-hard in combined complexity even if negations are disallowed; see Appendix Appendix A for full details.In the classical case, this logic-which is called DL-Lite Horn -has a polynomial time consistency problem (Artale et al. 2009).This gives an indication that dealing with L-DL-Lite R may also lead to an increase in complexity.
Interestingly, the rewriting technique from Section 5 also works for other t-normsmodulo some basic modifications-when answering threshold queries.Recall, for example, that given an axiom A B, e , and a threshold atom B(x) ≥ d, if e ≥ d then the rewriting technique would substitute this atom with A(x) ≥ d.Although this substitution is sound for the idempotent Gödel t-norm, it does not work directly for the other ones.For example, under the product t-norm, if we set d = e = 0.9 we note that guaranteeing A I (x) ≥ 0.9 does not necessarily implies, in a model I of A B, e that B I (x) ≥ 0.9.Indeed, as long as B I (x) ≥ 0.81, the axiom is satisfied in this case.A similar argument can be made for the Lukasiewicz t-norm.Hence, we need to increase the required degree for the rewritten atom.
Recall from the properties of the residuum that for every t-norm ⊗ it holds that A I (x) ⇒ B I (x) ≥ e iff B I (x) ≥ A I (x) ⊗ e.Thus, to ensure that B I (x) ≥ d it suffices to guarantee that A I (x) ⊗ e ≥ d.In the case of the product t-norm, this is akin to the condition A I (x) ≥ d/e.For the Lukasiewicz t-norm the condition translates to the inequality A I (x) ≥ min{1, d + 1 − e}.We can then apply the same PerfectRef algorithm, with a new definition of the function gr that changes the last degree (which is always ≥ d in Figure 4) with the new degree developed here.Overall, this yields the following complexity result.

Theorem 33
Answering threshold queries w.r.t.consistent DL-Lite ontologies is in AC 0 in data complexity.
Note that this theorem does not solve the problems sketched before for non-idempotent t-norms.Indeed, it is still not clear how to check for consistency of a L-DL-Lite ontology.Moreover, this result cannot be used to answer CQs because the analogous to Lemma 26 does not hold.Indeed, suppose that we have a simple CQ with only two atoms: q(x) = A(x) ∧ B(x).
To turn q(x) ≥ d into a TQ, we need to assign a threshold to each of the atoms.Note however that, under a non-idempotent t-norm, we cannot assign the same degree d to each atom, as their conjunction would become in fact lower than d.To be more precise consider the product t-norm and d = 0.9.Note that an answer to the TQ A(x) ≥ 0.9 ∧ B(x) ≥ 0.9 is not necessarily an answer to q(x) ≥ 0.9 because there could be a model that assigns both atoms to degree 0.9; hence the product of those degrees is 0.81 < 0.9.To use a TQ, we need to choose two degrees d 1 , d 2 such that d 1 • d 2 = 0.9, and construct the TQ A(x) ≥ d 1 ∧ B(x) ≥ d 2 .But there are infinitely many choices to make in this regard, hence we cannot even construct a finite UTQ.Thus, unfortunately, although we are able to answer TQs efficiently (if the ontology is known to be consistent), degree queries remain an open problem for non-idempotent t-norms.

Conclusions
In this paper we have studied the problem of answering queries over fuzzy ontologies written in DL-Lite.Our goal was to cover the gap in this area left by previous research.Indeed, although query answering w.r.t.ontologies is still an active topic, most work referring to fuzzy terminologies or ABoxes focused on the so-called Zadeh semantics, which does not preserve desired properties from the mathematical fuzzy logic point of view.To our knowledge, only Mailis and Turhan (Mailis and Turhan 2014;Mailis et al. 2015) have studied this problem based on t-norms, and found solutions based on the Gödel t-norm.However, they limited their approach to classical TBoxes.They left open the problems of dealing with graded TBoxes, handling threshold queries, and dealing with non-idempotent t-norms.
A second goal of our work was to reuse as much as possible the classical techniques, in order to avoid an implementation overhead when our algorithms will be, in future work, implemented and tested.As a result, we developed a method for answering degree queries which relies heavily on a classical query answering tool as a black box.Through this method, we can take advantage of all the existing optimisations and improvements from that area, and simply use a better tool whenever it becomes available without having to worry about the internal intricacies that make it work.In few words, our algorithm for answering CQs w.r.t. the Gödel semantics simply considers the classical version of the cut of the ontology.That is, the method ignores all axioms that hold to a degree lower than the threshold imposed, and then sees the remaining query answering question as a classical one.We emphasise that this approach works perfectly even if the TBox is graded.This means that our results improve those from (Mailis and Turhan 2014) by allowing for fuzzy TBox axioms and not requiring a new rewriting of the query.
Dealing with threshold queries, where each atom can be independently assigned a different degree, turns out to be more complex technically.In fact, we were not able to produce a direct reduction to a classical query answering problem-and it is unlikely that such a reduction could exist, given the nature of the graded axioms.However, we could still exploit the main ideas from the classical scenario, adapting the well-known PerfectRef method to the fuzzy scenario.In some sense PerfectRef absorbs the TBox into the query, forming a larger UCQ which can be answered classically, seeing the ABox as a database.In our case, we also need to take care of the degree at which the rewritten atoms should hold, when creating the new query.Under the Gödel semantics, it suffices to preserve the same degree from the original query, but for non-idempotent t-norms the degree has to be increased accordingly to avoid including spurious answers.Importantly, this shows that answering threshold queries w.r.t.consistent fuzzy ontologies is in the same complexity class (AC 0 ) in data complexity as for the classical case, regardless of the t-norm underlying the semantics.The only caveat is that it is not known how to verify consistency of a fuzzy DL-Lite ontology in general.The idempotency of the Gödel t-norm allowed us then to show that CQ answering w.r.t.consistent G-DL-Lite ontologies is also in AC 0 in data complexity.This latter bound does not hold for non-idempotent t-norms.
It is worth noting that the methods for answering degree and threshold queries both ultimately rely on a rewriting of the query to represent the information expressed in the TBox.While the rewriting does not affect the data complexity, it is well known that the UCQ obtained through PerfectRef may grow exponentially (Calvanese et al. 2007;Pérez-Urbina et al. 2010).This means that, depending on the instance, answering these queries may still be impractical.For that reason, different rewriting and answering techniques have been developed and tested; for example, rewriting into a Datalog program instead of an UCQ (Gottlob and Schwentick 2012;Gottlob et al. 2011).Our approach for solving threshold queries, given its reliance on PerfectRef, suffers from the same drawbacks.In order to use more optimised approaches, it is necessary to study whether other existing rewritings can also be adapted to the fuzzy setting.On the other hand, the approach to degree queries is, as mentioned already, fully black box: we only need to call an unmodified classical query answering tool repeatedly.This allows us to directly plug whichever system performs best, without worrying about the implementation overhead of understanding and adapting the existing tools.
Through illustrative examples, we showed that dealing with CQs is in general harder when the underlying t-norm is not idempotent.The main issue is that there is no unique way to decide the bounds for the different degrees to which atoms should hold to satisfy the lower bound for a conjunction of atoms.The problem is exacerbated by the fact that it is not even clear how to decide consistency of ontologies under the nilpotent t-norm.Indeed, even in the absence of an ABox, the Lukasiewicz t-norm may impose upper bounds in the degrees of some assertions which are not obvious to detect, and could contradict other conditions.
As future work, we are also interested in implementing and testing our ideas, with the help of some fuzzy ontologies which will be developed for specific application domains.
where A ∈ N C and P ∈ N R .Concepts of the form B and roles of the form Q are called basic, and all others are called general.Definition 1 (ontology) A fuzzy DL-Lite R TBox is a finite set of fuzzy axioms of the form B C, d and Q R, d , where d is a number in [0, 1].An axiom is positive if it does not have negation on its right-hand side and negative otherwise.A fuzzy DL-Lite R ABox is a finite set of fuzzy assertions of the form B(a), d and P (a, b), d , where a, b ∈ N I .A fuzzy DL-Lite R ontology is a pair of the form O = (T , A) where T is a TBox and A is an ABox.
R1. if A(a), d ∈ A and A Ican (a) < d, then update the value A Ican (a) := d; R2. if P (a, b), d ∈ A and P Ican (a, b) < d, then update the value P Ican (a, b) :=

Fig. 2 .
Fig. 2. The canonical interpretation for the ontology O exa from our running example.
R1. if A(a), d ∈ A, since I is a model of this axiom, it follows that A I (a I ) ≥ d.The rule application sets A Ican (a) = d and hence A Ican (a) ≤ A I (ψ(a)) = A I (a I ).R2. if P (a, b), d ∈ A, the rule application sets P Ican (a, b) = d.Since I satisfies this axiom, it follows that P I (ψ(a), ψ(b)) = P I (a I , b I ) ≥ d = P Ican (a, b).

Fig. 3 .
Fig. 3. Two canonical interpretation constructions from the ontology in Example 13.From the empty interpretation (a), R1 is applied to each assertion to reach (c).One can either apply R4 to A ∃R, 0.3 and go through the upper branch (d) to build the interpretation (e); or to B ∃R, 0.5 and obtain (f) directly.
Definition 14 (classical version) Let O = (T , A) be a fuzzy DL-Lite ontology.The classical version O of O is defined by O := ( T , A), where

Table 1 .
The three fundamental continuous t-norms and related operations Indeed, the first two rules ensure that the conditions 3Intuitively, I can (O) should be a minimal model of O, which describes the necessary conditions of all other models of O.