Introduction VQS Conditions based on fuzzy orderings The aggregation issue Summary 2... 1/ The vague query system VQSThe syntax of VQL The operator ‘‘IS’’ should be understood in
Trang 1Advanced Database Systems
Fuzzy Orderings in Flexible Query
Answering Systems
Lê Hồng Dũng – 7140819
Âu Mậu Dương – 7140820
Lê Nguyên Dũng – 7140224 Ngô Đình Dũng – 1570203
1
Trang 2Introduction
VQS
Conditions based on fuzzy orderings
The aggregation issue
Summary
2
Trang 31/ The vague query system (VQS)
VQS is an add-on to conventional relational databases which acts as a proxy between the user and the database
Since VQS communicates with the underlying database only on the basis of standard SQL which allows easy integration into existing
Trang 41/ The vague query system (VQS)
The syntax of VQL
The operator ‘‘IS’’ should be understood in the sense of ‘‘is similar to’’
4
Trang 51/ The vague query system (VQS)
There is one single ‘‘IS’’ condition in the query, VQS retrieves all records
from the data source and ranks them according to the distance from the query value
In case that the column contains numeric values, the distance between two values x;
y can easily be computed as the absolute value of the difference |x - y| (Euclidean norm for the one-dimensional real space R).
If the column under consideration is non-numeric, the distance is computed as the
distance of the associated values in the corresponding NCR table
VQS works with normalized distances Every condition, therefore, is
assigned a distance value normalized to the unit interal [0;1].
5
Trang 61/ The vague query system (VQS)
In case that two or more ‘‘IS’’ conditions are combined with ‘‘AND’’,
a weighted average of the distances in the different columns is used
to rank the results (equal weights are used by default, which can be overridden using the optional ‘‘WEIGHTED BY’’ expression)
6
Trang 7VÍ DỤ 1
Xét bảng dữ liệu
7
Trang 8VÍ DỤ 1
Bảng 2 Ma trận khoảng cách của Location trong bảng 1 (bảng NCR)
8
Trang 9VÍ DỤ 1
Consider the following query:
SELECT FROM HotelTable WHERE Location IS ‘Salzburg Center’
AND Price IS 70 AND Category IS 4 INTO ResultSet
Assume that the distances between locations are given as in Table 2 (as the result of computing a distance measure for corresponding values in an NCR table).
To compute the result set for this query which means that the distance of any two locations is divided by 147.8, each discrepancy in the price is divided by 60, and each discrepancy in the category is divided by 2
9
Trang 10VÍ DỤ 1
Using equal weights, we obtain the result set shown in Table 3 sorted
by the closeness to the query
10
Trang 11NHƯỢC ĐIỂM CỦA VQS
Disadvantages: Example 1 clearly demonstrates two severe shortcomings of
VQS:
1 VQS is restricted to ‘‘IS’’ queries that are interpreted with a certain tolerance for imprecision For the price column, however, this is a painful limitation, as the user is not necessarily interested in a price that is as close to 70 as possible, but more likely in a
price that exceeds 70 as little as possible.
2 The normalization of distances is done for all columns independently solely on the basis of the largest distance between two values in the column The result is that two distance values for different columns may be difficultly comparable.
This paper is to tackle the first problem.
11
Trang 12Ngôn ngữ oVQL (Ordering-enriched vague query language)
Ngôn ngữ oVQL (Ordering-enriched vague query language)
12
Trang 13Ngôn ngữ oVQL (Ordering-enriched vague query language)
It is obvious that oVQL differs from VQL in the respect that there is
an explicit distinction between numeric and non-numeric attributes
For non-numeric ones, only the ‘‘IS’’ condition is defined like in VQL
For numeric ones, three new types of conditions ‘‘IS AT LEAST’’, ‘‘IS AT MOST’’, and ‘‘IS WITHIN’’ are added.
13
Trang 14Introduction
VQS
The aggregation issue
Summary
14
Trang 15Conditions based on fuzzy orderings
The single conditions ‘‘IS’’, ‘‘IS AT LEAST’’, ‘‘IS AT MOST’’, and ‘‘IS WITHIN’’ are modeled
Example: Price IS AT MOST 70
15
Trang 16Conditions based on fuzzy orderings
Definition 1: Fuzzy equivalence relation
A binary fuzzy relation E: X2 → [0,1] is called fuzzy equivalence relation with respect to a t-norm T, for
brevity T-equivalence, if and only if the following three axioms are fulfilled for all x, y, z X:
1 Reflexivity: E(x,x) = 1.
2 Symmetry: E(x,y) = E (y,x).
3 T- transitivity: T(E(x,y), E(y,z)) E(x,z)
16
Trang 17Conditions based on fuzzy orderings
Definition 2: fuzzy ordering
A fuzzy relation L: X2 → [0,1] is called fuzzy ordering with respect to a t-norm T and a T-equivalence E, for brevity T-E-ordering, if and only if it is T-transitive and fulfills the following two axioms for all x, y
1 E-Reflexivity: E(x,y) L(x,y).
2 T-E-antisymmetry: T(L(x,y),L(y,x))
17
Trang 18Conditions based on fuzzy orderings
Definition 3:
A crisp ordering on a domain X and a T-equivalence E: X2 → [0,1] are called compatible if and only if the following holds for all x, y, z X:
x y z => E(x,z)
18
Trang 19Conditions based on fuzzy orderings
Theorem 1: [1, 2] Consider a fuzzy relation L on a domain X and a T-equivalence E Then the following two statements are equivalent:
L is a strongly complete T-E-ordering.
There exists a linear ordering the relation E is compatible with such that L can be represented as follows:
• L(x,y) =
19
Trang 20Conditions based on fuzzy orderings
Theorem 2: Consider a continuous Archimedean t-norm T with additive generator f.
For any pseudo-metric d: X2 → [0,] the mapping Ed: X2 → [0,] defined as Ed(x,y) = f-1 ( min (d(x,y), f(0) ) (1)
Provided that E: X2 → [0,] is a T-equivalence, we can define a pseudo-metric dE: X2 → [0,] as dE (x,y) = f (E(x,y)) (2)
20
Trang 21Conditions based on fuzzy orderings
Proposition 1: Let T be a continuous Archimedean t-norm with an additive generator f and let be an ordering of the domain X.
If a pseudo-metric d: X2 → [0,], fulfills
x y z => d(x,z) (3)
If a fuzzy equivalence relation E: X2 → [0,1] is compatible with , , its induced pseudo-metric
dE defined as in (2), fulfills property (3).
21
Trang 22Conditions based on fuzzy orderings
Some important formula be deduced from theorem 1&2:
EC(x,y) = max(1 ) (TL-equivalence)
E’C(x,y) = exp() (TP-equivalence) The value C is obviously the maximal distance of two objects x and y.
22
Trang 23Conditions based on fuzzy orderings
Some important formula be deduced from theorem 1&2:
LC(x,y) = (TL-Ed,C-ordering)
L’C(x,y) = (TP-Ed,C-ordering)
23
Trang 24Conditions based on fuzzy orderings
Formula is applied following as:
Trang 25Introduction
VQS
Conditions based on fuzzy orderings
Summary
25
Trang 26The aggregation issue
- oVQL with two and more conditions ?
- How to set weighted for a condition?
26
Trang 27Problem (1)● VQS query with n condition:
– C = {t1, , tn}
● Mapping: A: [0, 1]n -> [0, 1]
27
Trang 28Problem (2)
Require the following properties:
–If all conditions are perfect fulfilled, the overall degree be 1
–If all degree are 0, the overall degree be 0
–If one degree ti increased, while others are const, the overall degree not
much decrease
–Allow the user to assign relative importance to each condition as these
weights
28
Trang 29Definition 4● Definition 4: A domination T if
Then:
29
n n
n n
y y
x
x
]1,0[)
, ,(
]1,0[)
, ,(
(), ,
,(
())
, ,(
),, ,
(( A x1 x n A y1 y n A T x1 y1 T x n y n
Trang 30n i
i i
n w
x f
w x
x A
f
x f
w f
f x
x A
1 1
1
1 1
)) (
))
, , (
(
) (
),
0 ( min
) , ,
(
Trang 31Example TL (1)● Lukasiewicz t-norm TL :
f
X X
f
x x
f x
x f
1
1 1
1
) (
),
0 ( min
) , ,
(
1 )
0 (
1 )
(
1 )
( x
1 X
-: Assume
) 1
( 1
) (
Trang 32i
i n
w
x n
x x
A w
With
w x
w
x w
x x
A
1
1 1
1 1
1 1
1 , 0 max )
, , (
1 :
1
, 0 max
1 1
, 1 min 1
) , ,
(
Trang 33Example● Lukasiewicz t-norm TP :
33
n n
i
i n
i
i n
w P
x x
x A
w With
x x
w x
x A
x x
1 1
1
) , ,
( 1
:
ln exp
) , ,
(
ln )
(
Trang 34● If not specify any weight, all weights are equal:
● If specify weight for all conditions:
● If specify weight some conditions, filled up with 1’s
w
w w
1
~
~
Trang 35Table 4 QueryConsider the following query:
SELECT FROM HotelTable
WHERE Location IS ‘Salzburg Center’
Trang 37Introduction
VQS
Conditions based on fuzzy orderings
The aggregation issue
37
Trang 38Does not specify any weight at all
If the weight was defined
38
Trang 39W(Location) = 4
W(Price) = 1
W(Star) = 1
W1 = 4/6 = 2/3W2 = 1/6
W3 = 1/6
39
Trang 41The choice of the underlying t-norm
With equal weights
With Weights
41
Trang 42The choice of the underlying t-norm
We have two choices
Leads to the same results, there is no point in choosing
Condition, radius C has a clear and unambiguous interpretation
However, T(L) is a pragmatic and justifiable choice
42
Trang 44Operation of Fuzzy System
Trang 45Create a new type condition, such as “AT LEAST MEDIUM” or “AT MOST AROUND”
45
Trang 46CÂU HỎI THẢO LUẬN
1/ Trong hệ thống VQS, các thuộc tính phi số được tính như thế nào?
2/ Cách tính khoảng cách lớn nhất giữa các phần tử trong hệ thống VQS?
46