Preferences, Queries, Logics Jan Chomicki University at Buffalo DBRank, August 29, 2011

advertisement
Preferences, Queries, Logics
Jan Chomicki
University at Buffalo
DBRank, August 29, 2011
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
1 / 46
Plan of the talk
1
Preference relations
2
Preference queries
3
Advanced topics
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
2 / 46
Part I
Preference relations
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
3 / 46
Motivation
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
4 / 46
Preference relations
Universe of objects
constants: uninterpreted, numbers,...
individuals (entities)
tuples
sets
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
5 / 46
Preference relations
Universe of objects
constants: uninterpreted, numbers,...
individuals (entities)
tuples
sets
Preference relation
¡
binary relation between objects
x
¡ y x is better
than y
x dominates y
an abstract, uniform way of talking about (relative) desirability,
worth, cost, timeliness,..., and their combinations
preference relations used in preference queries
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
5 / 46
Buying a car
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
6 / 46
Buying a car
Salesman: What kind of car do you prefer?
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
6 / 46
Buying a car
Salesman: What kind of car do you prefer?
Customer: The newer the better, if it is the same make. And cheap, too.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
6 / 46
Buying a car
Salesman: What kind of car do you prefer?
Customer: The newer the better, if it is the same make. And cheap, too.
Salesman: Which is more important for you: the age or the price?
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
6 / 46
Buying a car
Salesman:
Customer:
Salesman:
Customer:
What kind of car do you prefer?
The newer the better, if it is the same make. And cheap, too.
Which is more important for you: the age or the price?
The age, definitely.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
6 / 46
Buying a car
Salesman: What kind of car do you prefer?
Customer: The newer the better, if it is the same make. And cheap, too.
Salesman: Which is more important for you: the age or the price?
Customer: The age, definitely.
Salesman: Those are the best cars, according to your preferences, that we
have in stock.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
6 / 46
Buying a car
Salesman: What kind of car do you prefer?
Customer: The newer the better, if it is the same make. And cheap, too.
Salesman: Which is more important for you: the age or the price?
Customer: The age, definitely.
Salesman: Those are the best cars, according to your preferences, that we
have in stock.
Customer: Wait...it better be a BMW.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
6 / 46
Preferences in perspective
Applications of preferences and preference queries
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
7 / 46
Preferences in perspective
Applications of preferences and preference queries
1
decision making
2
e-commerce
3
digital libraries
4
personalization
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
7 / 46
Preferences in perspective
Applications of preferences and preference queries
1
decision making
2
e-commerce
3
digital libraries
4
personalization
Preferences are multi-disciplinary
economic theory: von Neumann, Arrow, Sen
philosophy: Aristotle, von Wright
psychology: Slovic
artificial intelligence: Boutilier, Brafman
databases: Kießling, Kossmann
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
7 / 46
Properties of preference relations
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
8 / 46
Properties of preference relations
Properties of
¡
@x. x £ x
asymmetry: @x, y . x ¡ y ñ y £ x
transitivity: @x, y , z. px ¡ y ^ y ¡ z q ñ x ¡ z
negative transitivity: @x, y , z. px £ y ^ y £ z q ñ x £ z
connectivity: @x, y . x ¡ y _ y ¡ x _ x y
irreflexivity:
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
8 / 46
Properties of preference relations
Properties of
¡
@x. x £ x
asymmetry: @x, y . x ¡ y ñ y £ x
transitivity: @x, y , z. px ¡ y ^ y ¡ z q ñ x ¡ z
negative transitivity: @x, y , z. px £ y ^ y £ z q ñ x £ z
connectivity: @x, y . x ¡ y _ y ¡ x _ x y
irreflexivity:
Orders
strict partial order (SPO): irreflexive and transitive
weak order (WO): negatively transitive SPO
total order: connected SPO
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
8 / 46
Weak and total orders
Weak order
Total order
a
c
a
b
d
e
f
f
Jan Chomicki
d
Preferences, Queries, Logics
DBRank, August 29, 2011
9 / 46
Order properties of preference relations
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
10 / 46
Order properties of preference relations
Irreflexivity, asymmetry: uncontroversial.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
10 / 46
Order properties of preference relations
Irreflexivity, asymmetry: uncontroversial.
Transitivity:
captures rationality of preference
not always guaranteed: voting paradoxes
helps with preference querying
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
10 / 46
Order properties of preference relations
Irreflexivity, asymmetry: uncontroversial.
Transitivity:
captures rationality of preference
not always guaranteed: voting paradoxes
helps with preference querying
Negative transitivity:
scoring functions represent weak orders
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
10 / 46
Order properties of preference relations
Irreflexivity, asymmetry: uncontroversial.
Transitivity:
captures rationality of preference
not always guaranteed: voting paradoxes
helps with preference querying
Negative transitivity:
scoring functions represent weak orders
We assume that preference relations are SPOs.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
10 / 46
Not every SPO is a WO
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
11 / 46
Not every SPO is a WO
Indifference
x
y x £ y ^ y £ x.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
11 / 46
Not every SPO is a WO
Indifference
x
y x £ y ^ y £ x.
Canonical example
mazda
¡ kia, mazda i vw, kia i vw
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
11 / 46
Not every SPO is a WO
Indifference
x
y x £ y ^ y £ x.
Canonical example
mazda
¡ kia, mazda i vw, kia i vw
Violation of negative transitivity
mazda
£ vw, vw £ kia, mazda ¡ kia
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
11 / 46
Preference specification
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
12 / 46
Preference specification
Explicit preference relations
Finite sets of pairs: bmw
Jan Chomicki
¡ mazda, mazda ¡ kia,...
Preferences, Queries, Logics
DBRank, August 29, 2011
12 / 46
Preference specification
Explicit preference relations
Finite sets of pairs: bmw
¡ mazda, mazda ¡ kia,...
Implicit preference relations
can be infinite but finitely representable
defined using logic formulas in some constraint theory:
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
12 / 46
Preference specification
Explicit preference relations
Finite sets of pairs: bmw
¡ mazda, mazda ¡ kia,...
Implicit preference relations
can be infinite but finitely representable
defined using logic formulas in some constraint theory:
pm1, y1, p1q ¡1 pm2, y2, p2q y1 ¡ y2 _ py1 y2 ^ p1 p2q
for relation Car pMake, Year , Price q.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
12 / 46
Preference specification
Explicit preference relations
Finite sets of pairs: bmw
¡ mazda, mazda ¡ kia,...
Implicit preference relations
can be infinite but finitely representable
defined using logic formulas in some constraint theory:
pm1, y1, p1q ¡1 pm2, y2, p2q y1 ¡ y2 _ py1 y2 ^ p1 p2q
for relation Car pMake, Year , Price q.
defined using preference constructors (Preference SQL)
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
12 / 46
Preference specification
Explicit preference relations
Finite sets of pairs: bmw
¡ mazda, mazda ¡ kia,...
Implicit preference relations
can be infinite but finitely representable
defined using logic formulas in some constraint theory:
pm1, y1, p1q ¡1 pm2, y2, p2q y1 ¡ y2 _ py1 y2 ^ p1 p2q
for relation Car pMake, Year , Price q.
defined using preference constructors (Preference SQL)
defined using real-valued scoring functions:
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
12 / 46
Preference specification
Explicit preference relations
Finite sets of pairs: bmw
¡ mazda, mazda ¡ kia,...
Implicit preference relations
can be infinite but finitely representable
defined using logic formulas in some constraint theory:
pm1, y1, p1q ¡1 pm2, y2, p2q y1 ¡ y2 _ py1 y2 ^ p1 p2q
for relation Car pMake, Year , Price q.
defined using preference constructors (Preference SQL)
defined using real-valued scoring functions: F pm, y , p q α y
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
βp
12 / 46
Preference specification
Explicit preference relations
Finite sets of pairs: bmw
¡ mazda, mazda ¡ kia,...
Implicit preference relations
can be infinite but finitely representable
defined using logic formulas in some constraint theory:
pm1, y1, p1q ¡1 pm2, y2, p2q y1 ¡ y2 _ py1 y2 ^ p1 p2q
for relation Car pMake, Year , Price q.
defined using preference constructors (Preference SQL)
defined using real-valued scoring functions: F pm, y , p q α y
pm1, y1, p1q ¡2 pm2, y2, p2q F pm1, y1, p1q ¡ F pm2, y2, p2q
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
βp
12 / 46
Logic formulas
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
13 / 46
Logic formulas
The language of logic formulas
constants
object (tuple) attributes
comparison operators:
arithmetic operators:
Boolean connectives:
quantifiers:
Ÿ @, D
Ÿ
, , , ¡, . . .
, , . . .
, ^, _
usually can be eliminated (quantifier elimination)
no database relations
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
13 / 46
Representability
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
14 / 46
Representability
Definition
A scoring function f represents a preference relation
x
¡ if for all x, y
¡ y f px q ¡ f py q .
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
14 / 46
Representability
Definition
A scoring function f represents a preference relation
x
¡ if for all x, y
¡ y f px q ¡ f py q .
Necessary condition for representability
The preference relation
Jan Chomicki
¡ is a weak order.
Preferences, Queries, Logics
DBRank, August 29, 2011
14 / 46
Representability
Definition
A scoring function f represents a preference relation
x
¡ if for all x, y
¡ y f px q ¡ f py q .
Necessary condition for representability
The preference relation
¡ is a weak order.
Sufficient condition for representability
¡ is a weak order
the domain is countable or some continuity conditions are satisfied
(studied in decision theory)
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
14 / 46
Preference constructors [Kießling, 2002]
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
16 / 46
Preference constructors [Kießling, 2002]
Good values
Prefer v
P S1 over v R S1.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
16 / 46
Preference constructors [Kießling, 2002]
Good values
Prefer v
P S1 over v R S1.
Jan Chomicki
POS(Make,tmazda,vwu)
Preferences, Queries, Logics
DBRank, August 29, 2011
16 / 46
Preference constructors [Kießling, 2002]
Good values
Prefer v
P S1 over v R S1.
POS(Make,tmazda,vwu)
Bad values
Prefer v
R S1 over v P S1.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
16 / 46
Preference constructors [Kießling, 2002]
Good values
Prefer v
P S1 over v R S1.
Bad values
Prefer v
R S1 over v P S1.
Jan Chomicki
POS(Make,tmazda,vwu)
NEG(Make,tyugou)
Preferences, Queries, Logics
DBRank, August 29, 2011
16 / 46
Preference constructors [Kießling, 2002]
Good values
Prefer v
P S1 over v R S1.
Bad values
Prefer v
R S1 over v P S1.
POS(Make,tmazda,vwu)
NEG(Make,tyugou)
Explicit preference
Preference encoded by a finite
directed graph.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
16 / 46
Preference constructors [Kießling, 2002]
Good values
Prefer v
P S1 over v R S1.
Bad values
Prefer v
R S1 over v P S1.
Explicit preference
Preference encoded by a finite
directed graph.
Jan Chomicki
POS(Make,tmazda,vwu)
NEG(Make,tyugou)
EXP(Make,t(bmw,ford),...,
(mazda,kia)u)
Preferences, Queries, Logics
DBRank, August 29, 2011
16 / 46
Preference constructors [Kießling, 2002]
Good values
Prefer v
P S1 over v R S1.
Bad values
Prefer v
R S1 over v P S1.
Explicit preference
Preference encoded by a finite
directed graph.
POS(Make,tmazda,vwu)
NEG(Make,tyugou)
EXP(Make,t(bmw,ford),...,
(mazda,kia)u)
Value comparison
Prefer larger/smaller values.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
16 / 46
Preference constructors [Kießling, 2002]
Good values
Prefer v
P S1 over v R S1.
Bad values
Prefer v
R S1 over v P S1.
Explicit preference
Preference encoded by a finite
directed graph.
Value comparison
Prefer larger/smaller values.
Jan Chomicki
POS(Make,tmazda,vwu)
NEG(Make,tyugou)
EXP(Make,t(bmw,ford),...,
(mazda,kia)u)
HIGHEST(Year)
LOWEST(Price)
Preferences, Queries, Logics
DBRank, August 29, 2011
16 / 46
Preference constructors [Kießling, 2002]
Good values
Prefer v
P S1 over v R S1.
Bad values
Prefer v
R S1 over v P S1.
Explicit preference
Preference encoded by a finite
directed graph.
Value comparison
Prefer larger/smaller values.
POS(Make,tmazda,vwu)
NEG(Make,tyugou)
EXP(Make,t(bmw,ford),...,
(mazda,kia)u)
HIGHEST(Year)
LOWEST(Price)
Distance
Prefer values closer to v0 .
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
16 / 46
Preference constructors [Kießling, 2002]
Good values
Prefer v
P S1 over v R S1.
Bad values
Prefer v
R S1 over v P S1.
Explicit preference
Preference encoded by a finite
directed graph.
Value comparison
POS(Make,tmazda,vwu)
NEG(Make,tyugou)
EXP(Make,t(bmw,ford),...,
(mazda,kia)u)
Prefer larger/smaller values.
HIGHEST(Year)
LOWEST(Price)
Distance
AROUND(Price,12K)
Prefer values closer to v0 .
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
16 / 46
Combining preferences
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
17 / 46
Combining preferences
Preference composition
combining preferences about objects of the same kind
dimensionality is not increased
representing preference aggregation, revision, ...
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
17 / 46
Combining preferences
Preference composition
combining preferences about objects of the same kind
dimensionality is not increased
representing preference aggregation, revision, ...
Preference accumulation
defining preferences over objects in terms of preferences over simpler
objects
dimensionality is increased (preferences over Cartesian product).
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
17 / 46
Combining preferences: composition
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
18 / 46
Combining preferences: composition
Boolean composition
¡Y y x ¡1 y _ x ¡2 y
and similarly for X.
x
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
18 / 46
Combining preferences: composition
Boolean composition
¡Y y x ¡1 y _ x ¡2 y
and similarly for X.
x
Prioritized composition
x
¡lex y x ¡1 y _ py £1 x ^ x ¡2 y q.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
18 / 46
Combining preferences: composition
Boolean composition
¡Y y x ¡1 y _ x ¡2 y
and similarly for X.
x
Prioritized composition
x
¡lex y x ¡1 y _ py £1 x ^ x ¡2 y q.
Pareto composition
x
¡Par y px ¡1 y ^ y £2 x q _ px ¡2 y ^ y £1 x q.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
18 / 46
Preference composition
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
19 / 46
Preference composition
Preference relation
¡1
bmw
ford
mazda
kia
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
19 / 46
Preference composition
Preference relation
¡1
Preference relation
¡2
ford
kia
bmw
ford
mazda
mazda
kia
Jan Chomicki
bmw
Preferences, Queries, Logics
DBRank, August 29, 2011
19 / 46
Preference composition
Preference relation
¡1
Preference relation
¡2
ford
kia
bmw
ford
mazda
mazda
kia
bmw
Prioritized composition
bmw
ford
mazda
kia
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
19 / 46
Preference composition
Preference relation
¡1
Preference relation
¡2
ford
kia
bmw
ford
mazda
mazda
kia
Prioritized composition
bmw
Pareto composition
bmw
ford
ford
kia
bmw
mazda
mazda
kia
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
19 / 46
Combining preferences: accumulation [Kiessling, 2002]
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
20 / 46
Combining preferences: accumulation [Kiessling, 2002]
Prioritized accumulation:
¡pr p¡1 & ¡2q
px1, x2q ¡pr py1, y2q x1 ¡1 y1 _ px1 y1 ^ x2 ¡2 y2q.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
20 / 46
Combining preferences: accumulation [Kiessling, 2002]
Prioritized accumulation:
¡pr p¡1 & ¡2q
px1, x2q ¡pr py1, y2q x1 ¡1 y1 _ px1 y1 ^ x2 ¡2 y2q.
Pareto accumulation:
¡pa p¡1 b ¡2q
px1, x2q ¡pa py1, y2q px1 ¡1 y1 ^ x2 ©2 y2q _ px1 ©1 y1 ^ x2 ¡2 y2q.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
20 / 46
Combining preferences: accumulation [Kiessling, 2002]
Prioritized accumulation:
¡pr p¡1 & ¡2q
px1, x2q ¡pr py1, y2q x1 ¡1 y1 _ px1 y1 ^ x2 ¡2 y2q.
Pareto accumulation:
¡pa p¡1 b ¡2q
px1, x2q ¡pa py1, y2q px1 ¡1 y1 ^ x2 ©2 y2q _ px1 ©1 y1 ^ x2 ¡2 y2q.
Properties
closure
associativity
commutativity of Pareto accumulation
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
20 / 46
Skylines
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
21 / 46
Skylines
Skyline
Given single-attribute total preference relations ¡A1 , . . . , ¡An for a
relational schema R pA1 , . . . , An q, the skyline preference relation ¡sky is
defined as
¡sky ¡A b ¡A b b ¡A
1
2
n
.
Unfolding the definition
px1, . . . , xn q ¡sky py1, . . . , yn q ©
xi
©A yi ^
i
Jan Chomicki
Preferences, Queries, Logics
ª
i
xi
¡A
i
yi .
i
DBRank, August 29, 2011
21 / 46
Skyline in Euclidean space
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
22 / 46
Skyline in Euclidean space
Two-dimensional Euclidean space
px1, x2q ¡sky py1, y2q x1 ¥ y1 ^ x2 ¡ y2 _ x1 ¡ y1 ^ x2 ¥ y2
Skyline consists of
Jan Chomicki
¡sky -maximal vectors
Preferences, Queries, Logics
DBRank, August 29, 2011
22 / 46
Skyline in Euclidean space
Two-dimensional Euclidean space
px1, x2q ¡sky py1, y2q x1 ¥ y1 ^ x2 ¡ y2 _ x1 ¡ y1 ^ x2 ¥ y2
Skyline consists of
Jan Chomicki
¡sky -maximal vectors
Preferences, Queries, Logics
DBRank, August 29, 2011
22 / 46
Skyline properties
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
23 / 46
Skyline properties
Invariance
A skyline preference relation is unaffacted by scaling or shifting in any
dimension.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
23 / 46
Skyline properties
Invariance
A skyline preference relation is unaffacted by scaling or shifting in any
dimension.
Maxima
A skyline consists of the maxima of monotonic scoring functions.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
23 / 46
Skyline properties
Invariance
A skyline preference relation is unaffacted by scaling or shifting in any
dimension.
Maxima
A skyline consists of the maxima of monotonic scoring functions.
Skyline is not a weak order
p2, 0q £sky p0, 2q, p0, 2q £sky p1, 0q, p2, 0q ¡sky p1, 0q
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
23 / 46
Skyline in SQL
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
24 / 46
Skyline in SQL
Grouping
Designating attributes not used in comparisons (DIFF).
Example
SELECT * FROM Car
SKYLINE Price MIN,
Year MAX,
Make DIFF
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
24 / 46
Part II
Preference queries
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
26 / 46
Winnow [Ch., 2002]
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
27 / 46
Winnow [Ch., 2002]
Winnow
new relational algebra operator ω (other names: Best, BMO)
retrieves the non-dominated (best) elements in a database relation
can be expressed in terms of other operators
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
27 / 46
Winnow [Ch., 2002]
Winnow
new relational algebra operator ω (other names: Best, BMO)
retrieves the non-dominated (best) elements in a database relation
can be expressed in terms of other operators
Definition
¡ and a database relation r :
ω¡ pr q tt P r | Dt 1 P r . t 1 ¡ t u.
Given a preference relation
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
27 / 46
Winnow [Ch., 2002]
Winnow
new relational algebra operator ω (other names: Best, BMO)
retrieves the non-dominated (best) elements in a database relation
can be expressed in terms of other operators
Definition
¡ and a database relation r :
ω¡ pr q tt P r | Dt 1 P r . t 1 ¡ t u.
Notation: If a preference relation ¡C is defined using a formula C , then
we write ωC pr q, instead of ω¡ pr q.
Given a preference relation
C
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
27 / 46
Winnow [Ch., 2002]
Winnow
new relational algebra operator ω (other names: Best, BMO)
retrieves the non-dominated (best) elements in a database relation
can be expressed in terms of other operators
Definition
¡ and a database relation r :
ω¡ pr q tt P r | Dt 1 P r . t 1 ¡ t u.
Notation: If a preference relation ¡C is defined using a formula C , then
we write ωC pr q, instead of ω¡ pr q.
Given a preference relation
C
Skyline query
ω¡sky pr q computes the set of maximal vectors in r (the skyline set).
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
27 / 46
Example of winnow
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
28 / 46
Example of winnow
Relation Car pMake, Year , Price q
Preference relation:
pm, y , pq ¡1 pm1, y 1, p1q y ¡ y 1 _ py y 1 ^ p p1q.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
28 / 46
Example of winnow
Relation Car pMake, Year , Price q
Preference relation:
pm, y , pq ¡1 pm1, y 1, p1q y ¡ y 1 _ py y 1 ^ p p1q.
Jan Chomicki
Make
Year
Price
mazda
2009
20K
ford
2009
15K
ford
2007
12K
Preferences, Queries, Logics
DBRank, August 29, 2011
28 / 46
Example of winnow
Relation Car pMake, Year , Price q
Preference relation:
pm, y , pq ¡1 pm1, y 1, p1q y ¡ y 1 _ py y 1 ^ p p1q.
Jan Chomicki
Make
Year
Price
mazda
2009
20K
ford
2009
15K
ford
2007
12K
Preferences, Queries, Logics
DBRank, August 29, 2011
28 / 46
Generalizations of winnow
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
29 / 46
Generalizations of winnow
Iterating winnow
0 pr q H
ω¡
n
ω¡
1
pr q ω¡pr ”0¤i ¤n ω¡i pr qq
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
29 / 46
Generalizations of winnow
Iterating winnow
0 pr q H
ω¡
n
ω¡
1
pr q ω¡pr ”0¤i ¤n ω¡i pr qq
Ranking
Rank tuples by their minimum distance from a winnow tuple:
η¡ pr q tpt, i q | t
Jan Chomicki
P ωCi pr qu.
Preferences, Queries, Logics
DBRank, August 29, 2011
29 / 46
Generalizations of winnow
Iterating winnow
0 pr q H
ω¡
n
ω¡
1
pr q ω¡pr ”0¤i ¤n ω¡i pr qq
Ranking
Rank tuples by their minimum distance from a winnow tuple:
η¡ pr q tpt, i q | t
P ωCi pr qu.
k-band
Return the tuples dominated by at most k tuples:
ω¡ pr q tt
Jan Chomicki
P r | # tt 1 P r | t 1 ¡ t u ¤ k u.
Preferences, Queries, Logics
DBRank, August 29, 2011
29 / 46
Preference SQL
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
30 / 46
Preference SQL
The language
basic preference constructors
Pareto/prioritized accumulation
new SQL clause PREFERRING
groupwise preferences
native implementation
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
30 / 46
Preference SQL
The language
basic preference constructors
Pareto/prioritized accumulation
new SQL clause PREFERRING
groupwise preferences
native implementation
Winnow in Preference SQL
SELECT * FROM Car
PREFERRING HIGHEST(Year)
CASCADE LOWEST(Price)
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
30 / 46
Algebraic laws [Ch., 2002; Kießling, 2002]
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
31 / 46
Algebraic laws [Ch., 2002; Kießling, 2002]
Commutativity of winnow with selection
If the formula
@t1, t2.rαpt2q ^ γ pt1, t2qs ñ αpt1q
is valid, then for every r
σα pωγ pr qq ωγ pσα pr qq.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
31 / 46
Algebraic laws [Ch., 2002; Kießling, 2002]
Commutativity of winnow with selection
If the formula
@t1, t2.rαpt2q ^ γ pt1, t2qs ñ αpt1q
is valid, then for every r
σα pωγ pr qq ωγ pσα pr qq.
Under the preference relation
pm, y , pq ¡C pm1, y 1, p1q y ¡ y 1 ^ p ¤ p1 _ y ¥ y 1 ^ p p1
1
the selection σPrice 20K commutes with ωC1 but σPrice ¡20K does not.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
31 / 46
Semantic query optimization [Ch., 2004]
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
32 / 46
Semantic query optimization [Ch., 2004]
Using information about integrity constraints to:
eliminate redundant occurrences of winnow.
make more efficient computation of winnow possible.
Eliminating redundancy
Given a set of integrity constraints F , ωC is redundant w.r.t. F iff F
implies the formula
@t1, t2. R pt1q ^ R pt2q ñ t1 C t2.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
32 / 46
Integrity constraints
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
33 / 46
Integrity constraints
Constraint-generating dependencies (CGD) [Baudinet et al., 1995]
@t1. . . . @tn . rR pt1q ^ ^ R ptn q ^ γ pt1, . . . tn qs ñ γ 1pt1, . . . tn q.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
33 / 46
Integrity constraints
Constraint-generating dependencies (CGD) [Baudinet et al., 1995]
@t1. . . . @tn . rR pt1q ^ ^ R ptn q ^ γ pt1, . . . tn qs ñ γ 1pt1, . . . tn q.
CGD entailment
Decidable by reduction to the validity of @-formulas in the constraint
theory (assuming the theory is decidable).
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
33 / 46
Part III
Advanced topics
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
34 / 46
Preference modification
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
35 / 46
Preference modification
Goal
Given a preference relation ¡ and additional preference or indifference
information I, construct a new preference relation ¡1 whose contents
depend on ¡ and I.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
35 / 46
Preference modification
Goal
Given a preference relation ¡ and additional preference or indifference
information I, construct a new preference relation ¡1 whose contents
depend on ¡ and I.
General postulates
fulfillment: the new information I should be completely incorporated
into ¡1
minimal change:
closure:
Ÿ
Ÿ
¡1 should be as close to ¡ as possible
order-theoretic (SPO, WO) properties of ¡ should be preserved in ¡1
finiteness or finite representability of ¡ should also be preserved in ¡1
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
35 / 46
Preference revision [Ch., 2007]
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
36 / 46
Preference revision [Ch., 2007]
Setting
new information: revising preference relation
¡0
composition operator θ: union, prioritized or Pareto composition
composition eliminates (some) preference conflicts
additional assumptions: interval orders
¡1 TC p¡0 θ ¡q to guarantee SPO
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
36 / 46
Preference revision [Ch., 2007]
Setting
new information: revising preference relation
¡0
composition operator θ: union, prioritized or Pareto composition
composition eliminates (some) preference conflicts
additional assumptions: interval orders
¡1 TC p¡0 θ ¡q to guarantee SPO
Jan Chomicki
VW , 2009
Kia, 2009
VW , 2008
Kia, 2008
VW , 2007
Kia, 2007
Preferences, Queries, Logics
DBRank, August 29, 2011
36 / 46
Preference revision [Ch., 2007]
Setting
new information: revising preference relation
¡0
composition operator θ: union, prioritized or Pareto composition
composition eliminates (some) preference conflicts
additional assumptions: interval orders
¡1 TC p¡0 θ ¡q to guarantee SPO
Jan Chomicki
VW , 2009
Kia, 2009
VW , 2008
Kia, 2008
VW , 2007
Kia, 2007
Preferences, Queries, Logics
DBRank, August 29, 2011
36 / 46
Preference revision [Ch., 2007]
Setting
new information: revising preference relation
¡0
composition operator θ: union, prioritized or Pareto composition
composition eliminates (some) preference conflicts
additional assumptions: interval orders
¡1 TC p¡0 θ ¡q to guarantee SPO
Jan Chomicki
VW , 2009
Kia, 2009
VW , 2008
Kia, 2008
VW , 2007
Kia, 2007
Preferences, Queries, Logics
DBRank, August 29, 2011
36 / 46
Preference contraction [Mindolin, Ch., 2011]
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
37 / 46
Preference contraction [Mindolin, Ch., 2011]
Setting
new information: contractor relation CON
¡1: maximal subset of ¡ disjoint with CON
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
37 / 46
Preference contraction [Mindolin, Ch., 2011]
Setting
new information: contractor relation CON
¡1: maximal subset of ¡ disjoint with CON
VW , 2009
VW , 2008
VW , 2007
VW , 2006
VW , 2005
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
37 / 46
Preference contraction [Mindolin, Ch., 2011]
Setting
new information: contractor relation CON
¡1: maximal subset of ¡ disjoint with CON
VW , 2009
VW , 2008
VW , 2007
VW , 2006
VW , 2005
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
37 / 46
Preference contraction [Mindolin, Ch., 2011]
Setting
new information: contractor relation CON
¡1: maximal subset of ¡ disjoint with CON
VW , 2009
VW , 2008
VW , 2007
VW , 2006
VW , 2005
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
37 / 46
Substitutability [Balke et al., 2006]
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
38 / 46
Substitutability [Balke et al., 2006]
Setting
new information: set of indifference pairs
additional preferences are added to achieve object substitutability
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
38 / 46
Substitutability [Balke et al., 2006]
Setting
new information: set of indifference pairs
additional preferences are added to achieve object substitutability
Jan Chomicki
VW , 2009
Kia, 2009
VW , 2008
Kia, 2008
VW , 2007
Kia, 2007
Preferences, Queries, Logics
DBRank, August 29, 2011
38 / 46
Substitutability [Balke et al., 2006]
Setting
new information: set of indifference pairs
additional preferences are added to achieve object substitutability
Jan Chomicki
VW , 2009
Kia, 2009
VW , 2008
Kia, 2008
VW , 2007
Kia, 2007
Preferences, Queries, Logics
DBRank, August 29, 2011
38 / 46
Substitutability [Balke et al., 2006]
Setting
new information: set of indifference pairs
additional preferences are added to achieve object substitutability
Jan Chomicki
VW , 2009
Kia, 2009
VW , 2008
Kia, 2008
VW , 2007
Kia, 2007
Preferences, Queries, Logics
DBRank, August 29, 2011
38 / 46
Preferences over finite sets
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
39 / 46
Preferences over finite sets
Set preferences
Induced:
X
Ï Y @x P X . Dy P Y . x ¡ y
Aggregate:
X
Ï Y sumApX q ¡ sumApY q
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
39 / 46
Preferences over finite sets
Set preferences
Induced:
X
Ï Y @x P X . Dy P Y . x ¡ y
Aggregate:
X
Ï Y sumApX q ¡ sumApY q
Set preference queries
find the best subsets of a given set
restrictions on cardinality
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
39 / 46
Preferences over set profiles [Zhang, Ch., 2011]
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
40 / 46
Preferences over set profiles [Zhang, Ch., 2011]
Name
Area
Rating
Newton
Physics
9
Einstein
Physics
10
Gargamel
Alchemy
0
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
40 / 46
Preferences over set profiles [Zhang, Ch., 2011]
Name
Area
Rating
Newton
Physics
9
Einstein
Physics
10
Gargamel
Alchemy
0
Preferences
2-element subsets
P1 : at most one physicist
P2 : higher total rating
P1 more important than P2
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
40 / 46
Set profile pF1 , F2 q
F1 pSq SELECT COUNT(Name) FROM S WHERE Area=’Physics’
F2 pSq SELECT SUM(Rating) FROM S
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
41 / 46
Set profile pF1 , F2 q
F1 pSq SELECT COUNT(Name) FROM S WHERE Area=’Physics’
F2 pSq SELECT SUM(Rating) FROM S
Set preference relations
Ï1 Y F 1 pX q ¤ 1 ^ F 1 p Y q ¡ 1
X Ï2 Y F 2 pX q ¡ F 2 p Y q
X
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
41 / 46
Set profile pF1 , F2 q
F1 pSq SELECT COUNT(Name) FROM S WHERE Area=’Physics’
F2 pSq SELECT SUM(Rating) FROM S
Set preference relations
Ï1 Y F 1 pX q ¤ 1 ^ F 1 p Y q ¡ 1
X Ï2 Y F 2 pX q ¡ F 2 p Y q
X
Prioritized composition
X
Ï Y X Ï1 Y _ pY Ï1 X ^ X Ï2 Y q
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
41 / 46
Prospective research topics
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
42 / 46
Prospective research topics
Definability
of scoring functions representing preference relations
of CP-nets and other graphical models of preferences
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
42 / 46
Prospective research topics
Definability
of scoring functions representing preference relations
of CP-nets and other graphical models of preferences
Extrinsic preference relations
Preference relations that are not fully defined by tuple contents:
x
¡ y Dn1, n2. Dissatisfied px, n1q ^ Dissatisfied py , n2q ^ n1 n2.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
42 / 46
Prospective research topics
Definability
of scoring functions representing preference relations
of CP-nets and other graphical models of preferences
Extrinsic preference relations
Preference relations that are not fully defined by tuple contents:
x
¡ y Dn1, n2. Dissatisfied px, n1q ^ Dissatisfied py , n2q ^ n1 n2.
Incomplete preferences
tuple scores and probabilities [Soliman et al., 2007]
uncertain tuple scores
disjunctive preferences: a ¡ b _ a ¡ c
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
42 / 46
Prospective applications
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
43 / 46
Prospective applications
Databases
preference queries as decision components: workflows, event systems
personalization of query results
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
43 / 46
Prospective applications
Databases
preference queries as decision components: workflows, event systems
personalization of query results
Multi-agent systems
conflict resolution
negotiating joint preferences and decisions
negotiation preferences
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
43 / 46
Prospective applications
Databases
preference queries as decision components: workflows, event systems
personalization of query results
Multi-agent systems
conflict resolution
negotiating joint preferences and decisions
negotiation preferences
Social media
preference similarity and stability
preference aggregation
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
43 / 46
Preference queries vs. Top-K queries
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
44 / 46
Preference queries vs. Top-K queries
Preference queries
Top-K queries
Binary preference relations
Scoring functions
Clear declarative reading
“Mysterious” formulation
Nondeterminism
No relational data model extension
Rank-relations [Li et al., 2005]
Structured data
Structured and unstructured data
Manual construction
Automatic construction
Preference SQL
Mainstream DBMS
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
44 / 46
Acknowledgments
Paolo Ciaccia
Parke Godfrey
Jarek Gryz
Werner Kießling
Denis Mindolin
Slawek Staworko
Xi Zhang
Companion paper
Jan Chomicki, Logical Foundations of Preference Queries, Data
Engineering Bulletin, 34(2), 2011.
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
45 / 46
Jan Chomicki
Preferences, Queries, Logics
DBRank, August 29, 2011
46 / 46
Download