<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Computing k-Rank Answers with Ontological CP-Nets</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Tommaso Di Noia</string-name>
          <email>t.dinoia@poliba.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Thomas Lukasiewicz</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Maria Vanina Martinez</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gerardo I. Simari</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Oana Tifrea-Marciuska</string-name>
          <email>oana.tifreag@cs.ox.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, University of Oxford</institution>
          ,
          <country country="UK">UK</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Dipartimento di Ingegneria Elettrica e dell'Informazione</institution>
          ,
          <addr-line>Politecnico di Bari</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The tastes of a user can be represented in a natural way by using qualitative preferences. In this paper, we describe how to combine ontological knowledge with CP-nets to represent preferences in a qualitative way and enriched with domain knowledge. Specifically, we focus on conjunctive query (CQ) answering under CP-net-based preferences. We define k-rank answers to CQs based on the user's preferences encoded in an ontological CP-net and we provide an algorithm for k-rank answering CQs.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>From its inception, the Web has been centered around the idea of linking information to
make it more accessible and useful for users. Recently, however, the Web has evolved
at an increasing pace towards the so-called Web 3.0, where classical linked information
lives together with ontological knowledge and social interactions of users. While the
former allows for more precise and rich results in search and query answering tasks,
the latter can be used to provide a personalized access to information. This requires
new techniques for ranking results based not only on the link structure of documents
but also on ontological and user-centred data, i.e., user preferences. These techniques
cannot only be used for users but also for computer applications (e.g., preferences over
different data sources) and agents (e.g., planning with preferences).</p>
      <p>The study of preferences has been carried out in many different areas, such as
philosophy, economics, and choice theory. They can be modeled in a qualitative and in
a quantitative way, where quantitative preferences are associated with a number
representing their worth, while qualitative preferences are related to each other via
pairwise comparisons. Users are more comfortable assessing their preferences qualitatively,
therefore this work uses qualitative preferences.</p>
      <p>
        In this paper, we focus on the problem of ranking answers for conjunctive queries
(CQs) to Datalog+/– ontologies, based on user preferences encoded in CP-nets [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. We
chose CP-nets, because they provide a natural, concise, and flexible graphical
representation of qualitative preferences, and they are a widespread formalism to represent
and reason with qualitative preferences. The Datalog+/– ontology language was
chosen, because it is more expressive than DL-Lite and has a more compact representation
of the attributes of concepts and roles [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. The integration between the ontology and
the CP-net is tight: on the one hand, CP-net outcomes are constrained by the ontology,
and on the other hand, they directly inform how answers to CQs are ranked.
      </p>
      <p>The main contributions of this paper are briefly as follows:
– We introduce ontological CP-nets, which are a novel combination of Datalog+/–
with CP-nets, modeling preferences over ground atoms in Datalog+/– ontologies.
– We define CP-net-based CQs and their skyline and k-rank answers. We also
provide an algorithm for computing k-rank answers to CQs based on the preferences
encoded in an ontological CP-net.
– We analyze the complexity of k-rank answering CP-net-based CQs, providing
precise complexity and tractability results. In detail, we have data tractability, as long
as query answering in the underlying classical Datalog+/– ontology is data tractable,
the CP-net is a polytree, and the query is fixed-width, bounded, or atomic.</p>
      <p>The rest of this paper is organized as follows. In Section 2, we briefly recall
Datalog+/– and CP-nets. Section 3 introduces ontological CP-nets, where preferences are
expressed over ground atoms from a Datalog+/– ontology, as well as the syntax and
the semantics of conjunctive queries (CQs) based on such CP-nets. In Section 4, we
describe how to compute k-rank answers to CP-net-based CQs. Section 5 provides
general complexity and tractability results. In Section 6, we discuss related work. Finally,
Section 7 summarizes the main results and gives an outlook on future work.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>2.1</p>
      <sec id="sec-2-1">
        <title>Datalog+/–</title>
        <p>
          Before introducing ontological CP-nets, we recall the basics on Datalog+/– and
CPnets. We first introduce the Datalog+/– ontology language used in our formalism.
We now recall the main concepts of Datalog+/– [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ], namely, relational databases,
(Boolean) conjunctive queries ((B)CQs), tuple- and equality-generating dependencies
(TGDs and EGDs, respectively), negative constraints, the chase, and ontologies.
Databases and Queries. We assume (i) an infinite universe of (data) constants
(which constitute the “normal” domain of a database), (ii) an infinite set of (labeled)
nulls N (used as “fresh” Skolem terms, which are placeholders for unknown
values, and can thus be seen as variables), and (iii) an infinite set of variables V (used
in queries, dependencies, and constraints). Different constants represent different
values (unique name assumption), while different nulls may represent the same value. We
denote by X sequences of variables X1; : : : ; Xk with k &gt; 0. We assume a relational
schema R, which is a finite set of predicate symbols (or simply predicates).
        </p>
        <p>A term t is a constant, null, or variable. An atomic formula (or atom) a has the
form P (t1; :::; tn), where P is an n-ary predicate, and t1; :::; tn are terms. A term
or atom is ground iff it contains no nulls and no variables. A database (instance) D
for a relational schema R is a (possibly infinite) set of atoms with predicates from
R and arguments from [ N . A conjunctive query (CQ) over R has the form
Q(X) = 9Y (X; Y), where (X; Y) is a conjunction of atoms (possibly equalities,
but not inequalities) with the variables X and Y, and possibly constants, but without
nulls. We use sign(Q) to denote the set of predicates appearing in . A Boolean CQ
(BCQ) over R is a CQ of the form Q(), often written as the set of all its atoms,
without quantifiers. Answers to CQs and BCQs are defined via homomorphisms, which are
mappings : [ N [ V ! [ N [ V such that (i) c 2 implies (c) = c,
(ii) c 2 N implies (c) 2 [ N , and (iii) is naturally extended to atoms, sets of
atoms, and conjunctions of atoms. The set of all answers to a CQ Q(X) = 9Y (X; Y)
over a database D, denoted Q(D), is the set of all tuples t over for which there exists
a homomorphism : X [ Y ! [ N such that ( (X; Y)) D and (X) = t. The
answer to a BCQ Q() over a database D is Yes, denoted D j= Q, iff Q(D) 6= ;.</p>
        <p>Given a relational schema R, a tuple-generating dependency (TGD) is a
firstorder formula of the form 8X8Y (X; Y) ! 9Z (X; Z), where (X; Y) and (X;
Z) are conjunctions of atoms over R (without nulls), called the body and the head of ,
denoted body ( ) and head ( ), respectively. Such is satisfied in a database D for R
iff, whenever there exists a homomorphism h that maps the atoms of (X; Y) to atoms
of D, there exists an extension h0 of h that maps the atoms of (X; Z) to atoms of D.
Since TGDs can be reduced to TGDs with only single atoms in their heads (producing
an equivalent set of TGDs), in the sequel, every TGD has w.l.o.g. a single atom in its
head. A TGD is guarded iff it contains an atom in its body that contains all universally
quantified variables of . A TGD is linear iff it contains only a single atom in its body.
As set of TGDs is guarded (resp., linear) iff all its TGDs are guarded (resp., linear).</p>
        <p>
          Query answering under TGDs, i.e., the evaluation of CQs and BCQs on databases
under a set of TGDs is defined as follows. For a database D for R, and a set of TGDs
on R, the set of models of D and , denoted mods(D; ), is the set of all (possibly
infinite) databases B such that (i) D B and (ii) every 2 is satisfied in B. The set
of answers for a CQ Q to D and , denoted ans(Q; D; ), is the set of all tuples a
such that a 2 Q(B) for all B 2 mods(D; ). The answer for a BCQ Q to D and is
Yes, denoted D [ j= Q, iff ans(Q; D; ) 6= ;. Query answering under general TGDs
is undecidable [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ], even when R and are fixed [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. Decidability of query answering
for the guarded case follows from a bounded tree-width property. Its data complexity in
this case is P-complete.
        </p>
        <p>A negative constraint (or simply constraint) is a first-order formula of the form
8X (X) ! ?, where (X) (called the body of ) is a conjunction of atoms over R
(without nulls). Under the standard semantics of query answering of BCQs in Datalog+/–
with TGDs, adding negative constraints is computationally easy, as for each constraint
8X (X) ! ?, we only have to check that the BCQ 9X (X) evaluates to false in D
under ; if one of these checks fails, then the answer to the original BCQ Q is true,
otherwise the constraints can simply be ignored when answering the BCQ Q.</p>
        <p>
          As another component, the Datalog+/– language allows for special types of
equalitygenerating dependencies (EGDs). Since they can also be modeled via negative
constraints, we omit them here, and we refer to [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] for their details. We usually omit
the universal quantifiers in TGDs, negative constraints, and EGDs, and we implicitly
assume that all sets of dependencies and/or constraints are finite.
The Chase. The chase was first introduced to enable checking implication of
dependencies, and later also for checking query containment. By “chase”, we refer both to
the chase procedure and to its output. The TGD chase works on a database via
socalled TGD chase rules (see [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] for further details and for an extended chase with
also EGD chase rules). The (possibly infinite) chase of a database D relative to a set
of TGDs , denoted chase(D; ), is a universal model, i.e., there is a
homomorphism from chase(D; ) onto every B 2 mods(D; ) [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. Thus, BCQs Q over D
and can be evaluated on the chase for D and , i.e., D [ j= Q is equivalent to
chase(D; ) j= Q. For guarded TGDs , such BCQs Q can be evaluated on an initial
fragment of chase(D; ) of constant depth k jQj, which is possible in polynomial
time in the data complexity.
        </p>
        <p>Datalog+/– Ontologies. A Datalog+/– ontology O = (D; ), where = T [ E [</p>
        <p>NC, consists of a finite database D over , a set of TGDs T , a set of non-conflicting
EGDs E , and a set of negative constraints NC. We say O is guarded (resp., linear)
iff T is guarded (resp., linear).</p>
        <p>Example 1. Consider the following relational schema R representing booking
information about airlines and their flights:
flight(id; d-airport; a-airport; dTime; aTime; plane-id; company);
plane(id; capacity); dPlace(city; airport);
book(flight-id; departure-date; class):
For example, the flight relation contains information about the flight such as the
departure airport, plane id and the company that is responsible; A simple Datalog+/– ontology
O = (D; ) for flights is given below. Intuitively, the database D encodes that for
example f1, f2 and f3 are 3 flights and ma,na are arrival times, etc. The set of constraints
encodes the domain and range of flights, the fact that a flight cannot have the same
departure and arrival city, and an inverse relation between flight and hasFlight.</p>
        <p>
          D =fflight(f1; l2; l3; nd; na; p2; a1); book(f1; d1; e); aTime(ma);
flight(f2; l2; l1; md; ma; p1; a2); book(f2; d1; b); aTime(na);
flight(f3; l3; l2; nd; na; p3; a2); book(f3; d1; b); dTime(nd);
dTime(md); class(b); class(e); dPlace(c1; l1); airline(a1);
dPlace(c1; l2); dPlace(c2; l3); airline(a2)g;
= fflight(A; B; C; D; E; F; G) ! 9Y dPlace(Y; B)
flight(A; B; C; D; E; F; G) ! dTime(D) ^ aTime(E)
flight(A; B; C; D; E; F; G) ! 9Y plane(F; Y )
flight(A; B; C; D; E; F; G) ! 9X airline(G; X)
flight(A; B; B; D; E; F; G) ! ?
flight(A; B; C; D; E; F; G) ! hasFlight(G; A)
book(A; B; C) ! 9X hasFlight(X; A)
book(A; B; C) ! class(C)g:
Conditional preferences networks (CP-nets) [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] are a formalism to represent and reason
with qualitative preferences. They allow the specification of preferences based on the
notion of conditional preferential independence (CPI) [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ].
        </p>
        <p>We assume a set of variables V, where each variable Xi 2 V is associated with
a domain of values, denoted dom(Xi). The domain of values x of a set of variables
X = fX1; : : : ; Xkg V, denoted dom(X), is defined as dom(X1) dom(Xk). If
X = V, then x is a complete assignment (outcome), otherwise it is a partial assignment.
If x and y are assignments to disjoints sets X and Y, then we denote the combination
of x and y by xy.</p>
        <p>A preference relation is a total pre-order over the set of outcomes. We write
o1 o2 to state that o1 is strictly preferred over o2 while we write o1 o2 if o1 is
strictly or equally preferred to o2. We say that o2 is dominated by o1 if o1 o2 and
that o2 is directly dominated by o1, o1 d o2 if o2 is dominated by o1 and there is no
outcome o such that o1 o and o o2. If there is no outcome o such that o o1
we say that o1 is undominated. If both o1 o2 and o2 o1 hold, we say there is an
indifference situation.</p>
        <p>A conditional preference is represented as (x x0 j z) meaning that “given z, I
prefer x over x0”. Let X, Y and Z be nonempty sets that partition V and a preference
relation over dom(V). X is conditionally preferentially independent (CPI) of Y given Z
iff for all x, x’ 2 dom(X); y; y0 2domY), z 2dom(Z), we have xyz x0yz iff xy0z
x0y0z. Using CP-nets, one can model CPI statements. Formally, a CP-net N over V
consists of an annotated directed graph G over fX1; : : : ; Xng in which nodes stand for
problem variables and edges represent conditioning among variables Xi. Each node Xi
is annotated with a conditional preference table CP T (Xi), that associates a total order</p>
        <p>Xiju with each instantiation u of Xi’s parents P a(Xi), i.e., u 2 dom(P a(Xi)). In
the sequel, we use o 2 N to denote that o is an outcome of N . The following are the
two main computational tasks for CP-nets:
– Dominance query: given a CP-net and two outcomes o1 and o2, decide whether
o1 o2.</p>
        <p>– Outcome optimization: given a CP-net, compute an undominated outcome.
Example 2. The CP-net in Figure 1 encodes that the morning departure (md) is
preferred over night departure (nd), and morning arrival (ma) is preferred over night
arrival (na). Business class (b) is preferred over economy class (e) when there is a night
departure and a morning arrival, and the other way around, otherwise.</p>
        <p>To establish an order among possible outcomes of a CP-net, we introduce the notion
of worsening flip. This is a change in the value of a variable that worsens the satisfaction
of the user’s preferences. For example, in Figure 1, we have that md ma e md na e.
Based on the notion of worsening flip, we can derive a preference graph representing
the transitive reduction of the preference relations among possible outcomes. In
Figure 2, the preference graph related to the CP-net in Figure 1 is represented. Given two
outcomes o1 and o2, an edge going from o1 to o2 means that o1 o2.
md nd
class
In this section, we introduce CP-Datalog+/–, which is an extension of Datalog+/– by
CP-net based preferences. We first introduce the syntax and then the semantics of
CPDatalog+/–.
We first define CP-net-based conjunctive queries, which are conjunctive queries along
with a CP-net for defining a preference relation among the ground instances of the
queries’ atoms and thus among the queries’ answers. To this end, we introduce
ontological CP-nets, which informally define preference relations between conjunctions of
ground atoms (which have as arguments constants from as well as the special
constant , which is a placeholder for any null). The preference relation is defined relative
to an underlying ontology.</p>
        <p>Definition 1 (Ontological CP-Net). Let O be a Datalog+/– ontology over the set of
constants . An ontological CP-net over O is a CP-net N , which has as set of variables
V a set of predicates from O, and as the domain of each P 2 V, denoted dom(P ), a
finite set of at least two different atoms P (t1; : : : ; tk) with t1; : : : ; tk 2 [ f g.
dP lace
airline
class</p>
        <p>Observe that every outcome o of an ontological CP-net is a conjunction of grounded
atoms. The following example illustrates the concept of ontological CP-net.
Example 3. Given the ontology O in Example 1, an ontological CP-net N over O is
shown in Figure 3, where V = fdPlace; airline; dTime; aTime; classg and, for instance,
dom(aTime) = fairline(a1); airline(a2)g. For clarity, in the CPT associated with the
variable P , we use ti to denote P (ti). Then, for instance, ti tj means P (ti) P (tj).</p>
        <p>The CP-net shown encodes that the departure place (dPlace) that maps city c1 with
airport location l1 is more preferred than (c1; l2), that is more preferred than (c3; l3)
(this might be dependent on where the user lives). Now, given the departure place, there
are preferences on the departure time (how long it takes to reach the place, etc.). Thus,
if the departure place is (c1; l1) or (c3; l3), then a night departure (nd) is preferred over
a morning departure (md). If the departure place is (c1; l2), then a morning departure
is preferred over a night departure. Business class (b) is preferred over economy class
(e) when there is a night departure and a morning arrival, and the other way around,
otherwise. Airline a1 is preferred over a2.</p>
        <p>As a consequence of the underlying ontology, some of the outcomes of an
ontological CP-net may be inconsistent, and some other outcomes may be ontologically
equivalent. We thus have to assure that the preference relation encoded in an ontological
CP-net is well-defined, which is expressed in the notion of consistency of ontological
CP-nets. In the sequel, let + denote the transitive closure of the preference relation
induced by the ontological CP-net for its outcomes, and + its restriction to the classes
of equivalent consistent outcomes. The notion of consistency of CP-nets then describes
the acyclicity of this preference relation + and the +-incomparability of any two
equivalent consistent outcomes. That is, to obtain +, we remove from + all
inconsistent outcomes relative to the ontology O, and we do not admit equivalent outcomes
relative to O.</p>
      </sec>
      <sec id="sec-2-2">
        <title>Definition 2 (Consistency of Ontological CP-Nets). Let O be a Datalog+/– ontology</title>
        <p>over , and let N be an ontological CP-net over O. Then, N is consistent iff (i) +
is acyclic, and (ii) o1
under O.</p>
        <p>+ o2 for no two outcomes o1 and o2 of N that are equivalent</p>
        <p>We next define CP-Net-based conjunctive queries, which are informally conjunctive
queries along with an ontological CP-net for defining a preference relation among the
queries’ answers.</p>
      </sec>
      <sec id="sec-2-3">
        <title>Definition 3 (CP-Net-Based Conjunctive Query). Let O be a Datalog+/– ontology.</title>
        <p>Then, a CP-net-based conjunctive query (CP-net-based CQ) (Q; N ) consists of a
conjunctive query Q and a consistent ontological CP-net N over O such that all variables
in N occur in Q.</p>
        <p>W.l.o.g., all the atoms in Q have different predicates (which can be easily achieved
by a predicate renaming), and thus there exists a bijection from atoms in Q to the
vertices of N .
3.2</p>
      </sec>
      <sec id="sec-2-4">
        <title>Semantics</title>
        <p>We next define the semantics of CP-net-based CQs (Q; N ). The following definition
formalizes answers to Q in the usual way and relates these answers to the outcomes of
the CP-net N .</p>
        <p>Definition 4 (Answer to a CP-Net-based CQ). Let O = (D; ) be a Datalog+/–
ontology, and let (Q; N ) be a CP-net-based CQ with Q(X) = 9Y (X; Y). Then, the set
of all answers for (Q; N ) to O under the outcome o of N , denoted ans(Q; N ; O; o), is
the set of all tuples a over for which there exists a homomorphism : X [ Y ! [</p>
        <p>N such that (i) ( (X; Y)) chase(D; ) and (X) = a, and (ii) o 0( (X; Y)),
where (a) 0jX = jX, (b) 0(Y ) = (Y ) for all Y 2 Y such that (Y ) 62 N and
(c) 0(Y ) = for all Y 2 Y such that (Y ) 2 N . The set of all answers for (Q; N )
to O, denoted ans(Q; N ; O), is the set of all answers for (Q; N ) to O under some
outcome o of N .</p>
        <p>Example 4. Consider again Example 3, which describes a consistent ontological CP-net
N , and let Q(B; A; Z; C) =</p>
        <p>9X; Y dPlace(X; B) ^ airline(A) ^ dTime(Z) ^ aTime(Y ) ^ class(C):
Then, (Q; N ) is a CP-net-based CQ, and hl1; a1; nd; bi is an answer to Q – note that its
outcome in N is o = fdPlace(c1; l1); airline(a1); dTime(nd); aTime(ma); class(b)g.</p>
        <p>
          We now focus on how to order these answers based on the preferences of the user.
We concentrate on skyline queries [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ], a well-known class of queries for
preferencebased formalisms, and the iterated computation of skyline answers that allows us to
assign a rank to every atom (using the CP-net); we refer to these as k-rank answers.
Definition 5 (Ordering Answers). Let O = (D; ) be a Datalog+/– ontology, and let
(Q; N ) be a CP-net-based CQ with Q(X) = 9Y (X; Y). Let a1 and a2 be two
different answers for (Q; N ) to O under the outcomes o1 and o2 of N , respectively, such
that o1 o2. Then, we say that a1 is ranked better than a2.
        </p>
        <p>We next define skyline and k-rank answers to CP-net-based CQs.</p>
        <p>Definition 6 (Skyline Answer). Let O = (D; ) be a Datalog+/– ontology, and let
(Q; N ) be a CP-net-based CQ with Q(X) = 9Y (X; Y). A skyline answer for (Q; N )
to O is any tuple a in ans(Q; N ; O; o) for some undominated outcome o of N .</p>
        <p>Observe that skyline answers are not unique. Indeed, we may have more than one
undominated outcome o of N , and we may also have more than one homomorphism
that satisfies the conditions (i) and (ii) of Definition 4 for the same undominated
outcome o of N .</p>
        <p>Definition 7 (k-Rank Answer). Let O = (D; ) be a Datalog+/– ontology, and let
(Q; N ) be a CP-net-based CQ with Q(X) = 9Y (X; Y). A k-rank answer for
(Q; N ) to O outside a set of ground atoms S is a sequence ha1; : : : ; aki such that
either:
(a) a1; : : : ; ak are k different skyline answers for (Q; N ) to O that do not belong to S,
if m &gt; k such answers exist; or
(b) (1) a1; : : : ; ai are all i different skyline answers for (Q; N ) to O that do not belong
to S, and (2) hai+1; : : : ; aki is a k i-rank answer for (Q; N fog) to O outside
S [ fa1; : : : ; aig, where o is an undominated outcome of N , otherwise.
A k-rank answer for (Q; N ) to O is a k-rank answer for (Q; N ) to O outside ;.</p>
        <p>Note that when no answer for (Q; N ) to O exists, then hi is its unique k-rank
answer. A k-rank answer is a sequence of k answers to a CP-net-based CQ ranked by
following the order among outcomes induced by the ontological CP-net. Given two
following answers in the sequence, they can be related to the same outcome (as for
the skyline situation, the answer related to a single outcome may not be unique) or to
two different outcomes in directly dominated relation. Finally, the computed answer
is not deterministic. Indeed, a CP-net induces a partial order over the set of possible
outcomes.
4</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>CP-Net-based Query Answering</title>
      <p>We now present an algorithm to compute k-rank answers in an ontological
CP-netbased setting. The procedure in Algorithm 1 exploits + (the transitive closure of
outcomes restricted to the class of equivalent consistent outcomes) to incrementally
compute ordered answers to a conjunctive query Q over an ontology O and an ontological
CP-net N for O. The algorithm stops the computation of answers when it reaches k
different answers to Q. The most preferred solutions are the ones related to the
undominated outcome of N . This is the reason why the computation starts by adding ou to
the set Outcomes (line 7). Then, the algorithm incrementally adds directly dominated
outcomes to Outcomes and finds answers to Q that are related to them. To preserve the
preference order in +, in line 9, there is a check needed to avoid that an outcome in
Outcomes is selected before we have answers related to other better outcomes.</p>
      <p>For a better understanding of line 9, we refer to the preference graph in Figure 2.
Suppose that Outcomes = fmd ma e, md ma b, nd ma b, md na b, nd ma b, nd na b,
Input: O is a Datalog+/– ontology, (Q; N ) is a CP-net-based CQ, and k &gt; 0.</p>
      <p>Output: k-rank answers fa1; : : : ; akg to (Q; N ).
md na eg and Checked = fmd ma e, md ma b, nd ma b, md na bg. Then, we have to
select an outcome in fnd ma b; nd na b; md na eg. By Figure 2, nd na b is the worst
choice. Indeed, although it is directly dominated by nd ma b, it is also dominated (not
directly) by md na e.</p>
      <p>Note that we may have two sources of non-determinism in the algorithm. In
particular, in line 9, we may choose arbitrarily among different incomparable outcomes. In
the situation that we have just discussed, we can select either nd ma b or md na e. The
other source of non-determinism is in line 11. Here, we may have multiple equivalent
(from the outcomes ordering point of view) , and after selecting some of them, we
reach length(Result ) = k.</p>
      <p>Finally, an algorithm to compute skyline answers can be easily modeled by stopping
the computation of answers to the ones related to the undominated outcome ou.
5</p>
    </sec>
    <sec id="sec-4">
      <title>Computational Complexity</title>
      <p>In this section, we analyze the computational complexity of skyline and k-rank
answering CP-net-based CQs (Q; N ) to Datalog+/– ontologies. We also delineate some
tractable special cases.
5.1</p>
      <sec id="sec-4-1">
        <title>General Results</title>
        <p>
          The following theorem shows that k-rank answering CP-net-based CQs (Q; N ) to
linear (resp., guarded) Datalog+/– ontologies is both complete for PSPACE (resp.,
2EXPTIME) and that hardness holds even when Q has a bounded width, is fixed, or is an
atom. The lower complexity bounds follow from the result that the more specialized
problem of answering BCQs to linear (resp., guarded) Datalog+/– ontologies is
complete for PSPACE (resp., 2EXPTIME) [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ], where hardness holds even in the case of
bounded-width, fixed, or atomic BCQs. As for the upper complexity bound, we first
have to decide the consistency of N , which can be done in PSPACE in the linear case
(despite the number of outcomes of N being exponential, as we only have to store
maximally four outcomes) and in 2EXPTIME in the guarded case, by (i) deciding BCQs to
linear (resp., guarded) Datalog+/– ontologies, which is complete for PSPACE (resp.,
2EXPTIME) [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ], and (ii) deciding dominance between two outcomes in a standard
CP-net, which is PSPACE-complete [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]. For the actual k-rank answering, intuitively,
we first compute k ordered top outcomes of N , which can also be done in PSPACE
(resp., 2EXPTIME), following a similar line of argumentation as for consistency, and
we then use these outcomes to instantiate Q and evaluate the resulting CQ Q0 over O,
which is in PSPACE (resp., 2EXPTIME).
        </p>
        <p>Theorem 1. Let k &gt; 0 be fixed. Given a linear (resp., guarded) Datalog+/– ontology O
and a CP-net-based CQ (Q; N ), computing the k-rank answer for (Q; N ) is complete
for PSPACE (resp., 2EXPTIME). Hardness holds even when Q has a bounded width,
is fixed, or is an atom.</p>
        <p>
          The next theorem shows that k-rank answering CP-net-based CQs (Q; N ) to
linear (resp., guarded) Datalog+/– ontologies in the data complexity (where is fixed) is
both complete for PSPACE. The lower complexity bounds follow from the result that
the more specialized problem of deciding dominance between two outcomes in a
standard CP-net is PSPACE-complete [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]. As for the upper complexity bound, we first
have to decide the consistency of N , which can be done in PSPACE, by (i) deciding
BCQs to linear or guarded Datalog+/– ontologies, which is NP-complete in the data
complexity [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ], and (ii) deciding dominance between two outcomes in a standard
CPnet, which is PSPACE-complete [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]. For the actual k-rank answering, intuitively, we
first compute k ordered top outcomes, which is in PSPACE, by a similar argumentation
as for consistency, and we then use these outcomes to instantiate Q and evaluate the
resulting CQ Q0 over O, which is in NP and thus in PSPACE.
        </p>
        <p>Theorem 2. Let k &gt; 0 be fixed. Given a linear or guarded Datalog+/– ontology O, and
a CP-net-based CQ (Q; N ), computing the k-rank answer for (Q; N ) is data complete
for PSPACE.
5.2</p>
      </sec>
      <sec id="sec-4-2">
        <title>Tractability Results</title>
        <p>
          We now delineate special cases where skyline and k-rank answering CP-net-based CQs
(Q; N ) to Datalog+/– ontologies O = (D; ) is tractable in the data complexity (where
is fixed). More precisely, the following result shows that these two problems are
tractable in the data complexity, when (i) O is linear or guarded, (ii) N is a polytree,
and (iii) Q has a bounded width, is fixed, or is an atom (which also implies that N is
bounded). It follows from the results (1) that answering bounded-width, fixed, or atomic
BCQs to linear or guarded Datalog+/– ontologies can be done in polynomial time [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ],
and (2) that for standard polytree CP-nets (of bounded node in-degree), dominance
between two outcomes can be decided in polynomial time [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]. Intuitively, we first decide
whether N is consistent, which can be done in polynomial time, since the number of
outcomes of N is polynomial (by the above assumptions), deciding equivalence and
inconsistency of outcomes can be done in polynomial time, and deciding dominance
of two outcomes can also be done in polynomial time. We then order the outcomes of
N along their preferences, and use them in this order to instantiate Q and evaluate the
resulting CQ Q0 over O, which can be done in polynomial time.
        </p>
        <p>Theorem 3. Let k &gt; 0 be fixed. Given a linear or guarded Datalog+/– ontology O,
and a CP-net-based CQ (Q; N ), where N is a polytree, and Q has a bounded width, is
fixed, or is an atom, computing the skyline and the k-rank answer for (Q; N ) can both
be done in polynomial time in the data complexity.
6</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Related Work</title>
      <p>
        Modeling and dealing with preferences in databases has been studied for almost three
decades, since the seminal work of [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]; see [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ] for a survey of notable works in this
line. Work has also been carried out in the intersection with databases and knowledge
representation and reasoning, such as preference logic programs [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], incorporation of
preferences into formalisms such as answer set programs [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], and answering k-rank
queries in ontological languages [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ].
      </p>
      <p>
        In the philosophical tradition, preferences are usually expressed over mutually
exclusive “worlds”, such as truth assignments to formulas. The work of [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] is framed
in this interpretation of preferences, aiming at bridging the gap between several
formalisms from the AI community such as CP-nets and those studied traditionally in
philosophy. In this regard, CP-nets [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] is one of the most widely known formalisms. Most
of the work on CP-nets has focused on the computation of optimal outcomes and the
problem of dominance testing, i.e., to check if one outcome of the CP-net is preferred
to another. More recently, the work of Wang et al. [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ] proposes an efficient algorithm
and indexing scheme for top k retrieval in CP-nets.
      </p>
      <p>
        Recently, there has been some interest regarding the combination of Semantic Web
technologies with preference representation and reasoning. A combination of
conditional preferences (very different from CP -nets) with description logic (DL) reasoning
for ranking objects is presented in [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. There, conditional preferences are exploited
in the definition of a ranking function that allows to perform a semantic personalized
search and ranking over a set of resources annotated via an ontological description. In
[
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], Datalog+/– is extended with preference management formalisms closely related
to those previously studied for relational databases. The authors focus on two kinds of
answers to queries, skyline and k-rank (a generalization of top-k queries), and develop
algorithms for disjunctions of atomic queries and conjunctive queries.
      </p>
      <p>
        Closest in spirit to this paper is perhaps the preference formalism that combines
CP-nets and DLs in [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ], where variable values of CP-nets are satisfiable DL formulas.
The main difference between this and the proposal here lies in the relationship between
the ontology and the CP-net. While [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] uses ontological axioms to restrict CP-net
outcomes, here we use the preference information contained in the CP-net to inform
how answers to queries over the ontology should be ranked. Finally, in an information
retrieval context in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], Wordnet is used to add a semantics to CP-net variables. Another
interesting approach to mixing qualitative preferences with Semantic Web technology
is presented in [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ], where an extension of SPARQL is studied that can encode user
preferences in the query.
7
      </p>
    </sec>
    <sec id="sec-6">
      <title>Summary and Outlook</title>
      <p>We have introduced ontological CP-nets, which are a novel combination of Datalog+/–
ontologies with CP-nets. We have defined CP-net-based CQs and their skyline and
krank answers on top of ontological CP-nets. We have also provided an algorithm for
computing k-rank answers to CP-net-based CQs. Furthermore, we have provided
precise complexity and tractability results for this problem.</p>
      <p>Interesting topics of ongoing and future research include the implementation and
experimental evaluation of the approach, as well as a more complete complexity
analysis for other Datalog+/– variants and ontology languages as well as other special cases
of CP-nets.</p>
      <p>Acknowledgments. This work was supported by the UK EPSRC grant EP/J008346/1
(“PrOQAW”), by a Google European Doctoral Fellowship, by the EU (FP7/2007-2013)
ERC grant 246858 (“DIADEM”), by a Yahoo! Research Fellowship, and by the grant
PON02 00563 3470993 (“VINCENTE”).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>C.</given-names>
            <surname>Beeri</surname>
          </string-name>
          and
          <string-name>
            <given-names>M. Y.</given-names>
            <surname>Vardi</surname>
          </string-name>
          .
          <article-title>The implication problem for data dependencies</article-title>
          .
          <source>In Proc. of ICALP</source>
          , pages
          <fpage>73</fpage>
          -
          <lpage>85</lpage>
          ,
          <year>1981</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>M.</given-names>
            <surname>Bienvenu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Lang</surname>
          </string-name>
          , and
          <string-name>
            <given-names>N.</given-names>
            <surname>Wilson</surname>
          </string-name>
          .
          <article-title>From preference logics to preference languages, and back</article-title>
          .
          <source>In Proc. of KR</source>
          , pages
          <fpage>214</fpage>
          -
          <lpage>224</lpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. S. Bo¨rzso¨nyi,
          <string-name>
            <given-names>D.</given-names>
            <surname>Kossmann</surname>
          </string-name>
          , and
          <string-name>
            <given-names>K.</given-names>
            <surname>Stocker</surname>
          </string-name>
          .
          <article-title>The skyline operator</article-title>
          .
          <source>In Proc. ICDE</source>
          , pages
          <fpage>421</fpage>
          -
          <lpage>430</lpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>F.</given-names>
            <surname>Boubekeur</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Boughanem</surname>
          </string-name>
          , and L.
          <string-name>
            <surname>Tamine-Lechani</surname>
          </string-name>
          .
          <article-title>Semantic information retrieval based on CP-Nets</article-title>
          .
          <source>In Proc.of FUZZ-IEEE</source>
          , pages
          <fpage>1</fpage>
          -
          <lpage>7</lpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>C.</given-names>
            <surname>Boutilier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. I.</given-names>
            <surname>Brafman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Domshlak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. H.</given-names>
            <surname>Hoos</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Poole</surname>
          </string-name>
          .
          <article-title>CP-nets: A Tool for Representing and Reasoning with Conditional Ceteris Paribus Preference Statements</article-title>
          . JAIR,
          <volume>21</volume>
          :
          <fpage>135</fpage>
          -
          <lpage>191</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>C.</given-names>
            <surname>Boutilier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. I.</given-names>
            <surname>Brafman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. H.</given-names>
            <surname>Hoos</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Poole</surname>
          </string-name>
          .
          <article-title>Reasoning with conditional ceteris paribus preference statements</article-title>
          .
          <source>In Proc. of UAI</source>
          , pages
          <fpage>71</fpage>
          -
          <lpage>80</lpage>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>G.</given-names>
            <surname>Brewka</surname>
          </string-name>
          .
          <article-title>Preferences, contexts and answer sets</article-title>
          .
          <source>In Proc. of ICLP, page 22</source>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. A. Cal`ı, G. Gottlob, and
          <string-name>
            <given-names>M.</given-names>
            <surname>Kifer</surname>
          </string-name>
          .
          <article-title>Taming the infinite chase: Query answering under expressive relational constraints</article-title>
          .
          <source>In Proc. of KR</source>
          , pages
          <fpage>70</fpage>
          -
          <lpage>80</lpage>
          . AAAI Press,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9. A. Cal`ı, G. Gottlob, and
          <string-name>
            <given-names>T.</given-names>
            <surname>Lukasiewicz</surname>
          </string-name>
          .
          <article-title>Datalog : A unified approach to ontologies and integrity constraints</article-title>
          .
          <source>In Proc. of ICDT</source>
          , pages
          <fpage>14</fpage>
          -
          <lpage>30</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. A. Cal`ı, G. Gottlob, and
          <string-name>
            <given-names>T.</given-names>
            <surname>Lukasiewicz</surname>
          </string-name>
          .
          <article-title>A general Datalog-based framework for tractable query answering over ontologies</article-title>
          .
          <source>J. Web Sem</source>
          .,
          <volume>14</volume>
          :
          <fpage>57</fpage>
          -
          <lpage>83</lpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>J. Goldsmith</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Lang</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Truszczynski</surname>
            , and
            <given-names>N.</given-names>
          </string-name>
          <string-name>
            <surname>Wilson</surname>
          </string-name>
          .
          <article-title>The Computational Complexity of Dominance and Consistency in CP-Nets</article-title>
          . JAIR,
          <volume>33</volume>
          :
          <fpage>403</fpage>
          -
          <lpage>432</lpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>K.</given-names>
            <surname>Govindarajan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Jayaraman</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Mantha</surname>
          </string-name>
          .
          <article-title>Preference logic programming</article-title>
          .
          <source>In Proc. of ICLP</source>
          , pages
          <fpage>731</fpage>
          -
          <lpage>745</lpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>R.</given-names>
            <surname>Keeney</surname>
          </string-name>
          and
          <string-name>
            <given-names>H.</given-names>
            <surname>Raiffa</surname>
          </string-name>
          .
          <article-title>Decisions with Multiple Objectives: Preferences and Value TradeOffs</article-title>
          . Cambridge University Press,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <given-names>M.</given-names>
            <surname>Lacroix</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Lavency</surname>
          </string-name>
          . Preferences:
          <article-title>Putting more knowledge into queries</article-title>
          .
          <source>In Proc. of VLDB</source>
          , pages
          <fpage>1</fpage>
          -
          <lpage>4</lpage>
          . Morgan Kaufmann,
          <year>1987</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15. T. Lukasiewicz,
          <string-name>
            <given-names>M.</given-names>
            <surname>Martinez</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G. I.</given-names>
            <surname>Simari.</surname>
          </string-name>
          Preference-Based Query Answering in Datalog+/- Ontologies.
          <source>In Proc. of IJCAI</source>
          , pages
          <fpage>501</fpage>
          -
          <lpage>518</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <given-names>T.</given-names>
            <surname>Lukasiewicz</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Schellhase</surname>
          </string-name>
          .
          <article-title>Variable-strength conditional preferences for ranking objects in ontologies</article-title>
          .
          <source>J. Web Sem</source>
          ,
          <volume>5</volume>
          (
          <issue>3</issue>
          ):
          <fpage>180</fpage>
          -
          <lpage>194</lpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>T. D. Noia</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          <string-name>
            <surname>Lukasiewicz</surname>
            , and
            <given-names>G.</given-names>
          </string-name>
          <string-name>
            <surname>Simari</surname>
          </string-name>
          .
          <article-title>Reasoning with semantic-enabled qualitative preferences</article-title>
          .
          <source>In Proc. of SUM</source>
          , pages
          <fpage>374</fpage>
          -
          <lpage>386</lpage>
          .
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <given-names>W.</given-names>
            <surname>Siberski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. Z.</given-names>
            <surname>Pan</surname>
          </string-name>
          , and
          <string-name>
            <given-names>U.</given-names>
            <surname>Thaden</surname>
          </string-name>
          .
          <article-title>Querying the Semantic Web with preferences</article-title>
          .
          <source>In Proc. of ISWC</source>
          , pages
          <fpage>612</fpage>
          -
          <lpage>624</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <given-names>K.</given-names>
            <surname>Stefanidis</surname>
          </string-name>
          , G. Koutrika, and
          <string-name>
            <given-names>E.</given-names>
            <surname>Pitoura</surname>
          </string-name>
          .
          <article-title>A survey on representation, composition and application of preferences in database systems</article-title>
          .
          <source>ACM TODS</source>
          ,
          <volume>36</volume>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20. H.
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          <string-name>
            <surname>Zhou</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          <string-name>
            <surname>Chen</surname>
            , and
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Ma</surname>
          </string-name>
          .
          <article-title>Top-k retrieval using conditional preference networks</article-title>
          .
          <source>In Proc. of CIKM</source>
          , pages
          <fpage>2075</fpage>
          -
          <lpage>2079</lpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>