Microprocossing and Microprogramming 39 (1993) 165-168 North-Holland
165
Extending semantics of relational operators for vague queries Do Heon Lee and Myoung Ho Kim Department of Computer Science, Korea Advanced Institute of Science and Technology 373-1, Kusung-dong, Yusuug-gu, Taejon, 305-701, South Korea Queries with vague qualifications are taking growing interests in various applications such as decision supporting systems and advice giving systems. To accomodate the vagueness handling capabilities into the widely used relational framework, Level-1 Fuzzy Relational Data Model(FRDM-1) has been proposed in [3]. In this paper, we generalize the model to acquire more practical usefulness. We also describe how non-fundamental relational operators such as join and division can have extended semantics in the proposed model.
1. I N T R O D U C T I O N There are several limitations in tile widely used relational data model. One of thenl is lack of dealing with subjective vagueness ill user's data retrieval requests. Many efforts to introduce vagueness into the theory of the relational data model have been made in the past. They can be classified into two major categories, i.e. Crisp Data and Fuzzy Query(CDFQ) and Fuzzy Data and Fuzzy Query(FDFQ) categories. In the CDFQ category, queries with fuzzy concepts call be processed for database storing only crisp values[2-6]. In the FDFQ category, queries with fuzzy concepts can be processed for database which can store fuzzy values[7-10]. To be accepted by most database users, fuzzy database systems need to have sufficient compatibilities with conventional database systems[6]. Even though the FDFQ approaches can greatly enhance database functionalities, they are too far from conventional systems yet.. On t.he other hand, the CDFQ approaches are more compatible with conventional systems while they can also enhance database functionalities significantly. However, most of CDFQ researches are based on their own idiosyncratic extensions and cover only partial ranges of relational operations. In order to overcome these shortcomings, the Level-1 Fuzzy Relational Data Model(FRDM-1) has been proposed in [3]. In this paper, we generalize the proposed FRDM-1 to acquire more practical usefulness. We also describe how non-flmdamental relational operators such as join and division can have ex-
tended semantics in the framework of FRDM-1. 2. LEVEL-1 F U Z Z Y R E L A T I O N A L D A TA MODEL: G E N E R A L I Z E D We have applied the extension principle[l] systematically to define Level-1 Fuzzy Relational Data Model(FRDM-1) in [3]. The extension principle has been commonly used in extensions of crisp mathematical concepts to the fuzzy framework. It provides the means for any function f that maps points xz, . . . , x,, in the crisp set X to the crisp set Y to be extended such that it maps fuzzy sets of X to those of Y. In [3], we use M I N and M A X operators to reflect conjunctive and disjunctive relationships, respectively. Although they are most representative operators in the fuzzy set theory, they are not appropriate in many application-specific sematic interpretations. In this work, we use t - n o r m and t - c o n o r m operators instead of M I N and M A X operators to generalize FRDM-1 more practically. T-norm/tconorm operators do not indicate specific ones but operator classes satisfying some axioms[l]. MIN/MAX operators are in fact special instances of t-norm/t-conorm operator classes. FRDM-1 consists of Level-1 Fuzzy Relational Algebra and Level-1 Fuzzy Relational Calculus, which stem from the relational algebra and calculus, respectively. 2.1. Level-1 Fuzzy R e l a t i o n a l A l g e b r a Level-1 Fuzzy Relational Algebra(FRA-1) has six fundamental operators, i.e., cr, l-I, U, N, × and
166
D.H. Lee, M.H. Kim
- . O p e r a n d s of t h e m are fuzzy relations, t h a t are the s a m e as o r d i n a r y d a t a relations except t h a t they are a u g m e n t e d by it a t t r i b u t e s containing m e m b e r s h i p degrees for individual tuples. Definition
1
FRA-1 has the following six h m d a m e n t a l operators. Suppose t h a t there are two fuzzy relations R1 and R~. axov(R,) = {(t,#~xo,.(R,))l X O Y w . r . t . t is true, l t ~ x o v ( R 1 ) = ltn~(t)}
2. Projection: II IIs(R1) = {(t, ttns(R~)(t))l
= t - . o r , , , [ ~ , . , (t), # . A t ) I }
4. Intersection: ¢3 R1 CI R~ ----{(t, ttn, nn~(t))l = t -- e o . o r , n [ t , ~ , (t), ~ ( t ) ] }
5. Cartisian Product: × R, x R~ = {(t,#a,×n=(t))[ t = C o n c a t e n a t e ( h , t2), # . , ×.~ (t) = t - c o n o r m [ . . ,
( t , ) , . . ~ (t~)]}
2. When the formula is X O Y A f 2 ( X 1 , . . . X k ) , F = {(t, #F(t))[t = f r e e variable list in f , #F(t) = v ( f ) > O } , w h e r e v ( f ) = v ( X O Y f2) = t - n o r m ( v ( X O Y ) , v(f2)).
A
3. When the formula is f l ( X 1 . . . . . X k ) A f2(X1, • . . , Xk),
t - norm(v(f~),
v(f~)).
4. When the formula is f l ( X 1 , . . . , X k )
V f2(X~,
= t -- e o , , o r , . [ t , R ,
F = {(t, ttF(t))lt = f r e e variable list in f , I~F(t) -~ v ( f ) > 0}, w h e r e v ( f ) -~ v ( f l V f~) ---t - c o n o r m ( v ( f ~ ) , v(f2)). 5. When the formula is ,,~ fl A f2,
f~) = t -
.or~(1
- v(f,),
v(f~)).
6. When the formula is (3X) fl (Y1,...,Yp, X, Z, . . . . , Zq), F = {(t, ttF(t))lt = < Y ~ , . . . , Yp, Z I , . . . , Zq > ,l~F(t) = v(f) > O},where v(f) = v ( ( 3 X ) f~ ( Y 1 , . . . , Y p , X , Z 1 , . . . , Z q ) ) = t conorm x ( v ( f , (Y~ . . . . . Yp, X , Z l , . . . , Zq) ).
7. When the formula is (¥X) f~ (Y~,...,Yp, X, Z1 . . . . , Zq),
F = {(t, ttF(t))lt = < Y1,..., Yp, Z1 .... , Zq >,/tF(t) = v ( f ) > 0}, w h e r e v ( f ) =
6. D i f f e r e n c e : Rx - R2 = {(t, ttR,-R~(t))l (t), 1 -- t,R~(t)]}
End of Definition 1
W h e n we restrict the value in p a t t r i b u t e to be either 0 or 1, it is easy to see t h a t FRA-1 is reduced to the relational algebra. 2.2. L e v e l - 1 F u z z y R e l a t i o n a l C a l c u l u s While formulas in Level-I Fuzzy Relational C a l c u l u s ( F R C - 1 ) are the s a m e as those in the relational calculus, interpretations of t h e m are extended for a p p l y i n g to fuzzy relations. Definition
=
F = { ( t , # F ( t ) ) l t = f r e e variable list in f , p F ( t ) = v ( f ) > 0},where v ( f ) = v ( ~ f l A
3. Union: U Rl W R2 = {(t, itn, un2(t))[
t,R,-R~(t)
>,~(t)
..., xk),
ttR,(t') > O, t = S u b L i s t ( t ' l S ), # n s ( R , )(t) = t - norrai[ltR, (t,)], ti = S a m e P r o j e c t S e t ( t ' [ S ) }
.R,,~R~(t)
F = {(t,~(t))lt =< Xl .... Xk v ( P ( X ~ . . . . Xk)) > 0}.
F = {(t, #r(t))[t = f r e e variable list in f , p F ( t ) = v ( f ) > 0},where v ( f ) = v ( f l A f2) =
1. Selection: a
l,n,~(t)
1. When the formula is p(X1 . . . . Xk),
2
T h e followings are i n t e r p r e t a t i o n s of FRC-1 formulas, v ( f ) denotes the t r u t h value of the formula f.
v ( ( V X ) f a (Y~ . . . . . Yp, X , Zl . . . . , Zq)) = n o r m x ( v ( f ~ (Y1 . . . . , Yp, X , Za, . . . , Zq) ).
t -
End of Definition 2
Since the equivalence p r o o f in [3] exploits comm o n properties of t - n o r m / t - c o n o r m o p e r a t o r s rather t h a n specific ones of M A X / M I N operators, the proof procedures used in [3] can be applied straightforward for equivalence p r o o f of the generalized F R D M - 1 . 2.3. A q u e r y l a n g u a g e e x p r e s s i n g u s e r ' s vagueness Now t h a t we have established theoretical f r a m e w o r k F R D M - 1 by defining two basic query languages, we propose a new query language, Fuzzy Selective Relational Algeb r a ( F S R A ) , which is derived f r o m F R A - 1 for the
Extending semantics of relational operators for vague queries
purpose of facilitating for human users to formulate their vague d a t a requests. In FSRA, users can use fuzzy constructs such as fuzzy constants and fuzzy c o m p a r a t o r s as well as ordinary constants and comparators. An example of FSRA query is such that "Find customers whose credits are not good and who have loans similar to 10,000 dollars". The terms no! good and similar to are typical examples of fuzzy constants and fuzzy comparators, respectively. FSRA has an extended selection operator to accomodate such fuzzy constants and fuzzy comparators. Definition 3 Selection operator of FSRA is defined as follows.
~ x o r ( R ) = {(t, po'xor(R)(t)) I m . x o r ( n ) ( t ) = t - ,,or,.(..(t). ,,( x o Y )[t]) }, where X is an attribute name and 0 is a comparator a m o n g = , # , >_, < , > , < , ~ and ! ~. Y is either an attribute name or a constant, llere, ,~ and ! ~ denote 'similar to' and 'dissimilar to' comparisons, respectively, and the constant is either a crisp constant or a fuzzy constant, v(XOY)[t] denotes conformance degree of the tuple t with respect to the fuzzy predicate XOY[1].
E,d of Definition 3 Actual meanings of the fllzzy constructs are maintained in semantic relations[3], which are in forms of ordinary d a t a relations. We classify them into three categories along with /heir domains and types of information.
Table 1 Classification of semantic relations continuous domain scattered domain
fuzzy constant (l) (2)
fuzzy comparator a special case of (1) (3) (3)
The schema of each semantic relation is as follows.
167
1. Fuzzy constant on continuous domain { ( t , , ( 0 ) I t = < lower, upper >} 2. Fuzzy constant on scattered domain {(t, ~(t)) I t = < value >) 3. Fuzzy c o m p a r a t o r on scattered domain {(t,p(t)) It = < valuel, value2 >} Now, we show that FSRA is established in the framework of FRDM-1 by describing methods to transform a FSRA query to FRA-1 queries. T h e methods are dependent on what kinds of fuzzy constructs are used in the FSRA query. 1. Fuzzy constant on continuous domain Fix, ..... x. (~x,>~ . . . . (o'x,<~pp~. (R x SRF~.z~Co..,))) aX,¥Fuz=yconst(R) =
(o'x,<~,vv.,SRF~..~co,,.,)))
H x, ..... x___.( ~rx,>_t . . . .
(R x
2. Fuzzy constant on scattered domain tYXi=FuzzyConst( R ) = [ I x , ..... X k (o'xi=value(R X S R F u z z y C o n s t ) ) tYXiyFuzzyConst( R ) =
Fix, ..... x~(o'x,=,~,,,uo(R × SRF...~co,,.,)) 3. Fuzzy comparator on scattered domain o'x=Y(R) =
HA1,... ,A k ((TX=va~uel
((7Y=value2
(R × S R . . . , o r , , ~ ) ) )
ax,=r(R)
=
HA, ..... A k (O'X=valuel (O'Y=value2 ( R × "~similarity) ) )
The calculus counterpart of FSRA, i.e., Fuzzy Selective Relational Calculus(FSRC), can be defined easily by using the similar method to the FSRA-from-FRA-1 extension. 3. E X T E N D E D S E M A N T I C S O F V A R I OUS RELATIONAL OPERATORS The relational d a t a model have several nonfundamental relational operators such as 0 join, natural join, division and so on. All of t h e m can be expressed as combinations of the fundamental operators. In FRDM-1, there can also be extended forms of non-fundamental relational operators corresponding to those in the conventional model. Likely to the conventional model, those
D.H. Lee, ld.H. Kim
168
operators can be expressed as combinations of the extended fundamental operators. While semantics of some operators are straightforward extensions of conventional ones, other operators need careful considerations on interpretations. Since a 0 join can be resolved simply into a selectionafter-product combination, the extended semantics of selection and product can be directly applicable to the extended 0 join. Similarly, tile extension of natural join semantics is also straightforward. In the other hand, the division operator, which is a complex combination of fundamental operators, needs some clarification on its interpretation. The division operator retreives each tuple from dividend relation that is matched with all tuples in the divisor relation. When the divisor and dividend are fuzzy relations, there may occur two major semantic extensions. First, it can consider similarity-based match as well as exact match on division attributes, l%r each tuple t in the dividend to be qualified, it must match similarly all of the tuph's in the divisor, in the sense that all of divisor tuples have division attribute values similar to those of t. Second, it must account for the degree to how completely the divisor divides the dividend. These two extended semantics should be incorporated in FRDM-1 naturally. The following is the FSRC formula reformulated for a division query R - S, where the schema of R is (A1, A2) and that of S is (A2). Vs E S[3r E R(r.A2 .~ s.A2 A t.A1 = r.A1)] In the above formula, the phrases Vs E S and r.A2 ,~ s.A~ represent the similarity-based match mentioned previously. And implied p attribute values in the result fuzzy relation become to represent the degree to how completely S divides R. Note that, the FSRC query can be easily transformed to relational queries using the proposed transformation method[3]. 4. C O N C L U D I N G
REMARKS
In this paper, we generalized the fuzzy relational data model FRDM-1 that had been proposed in [3]. The generalization is based on tnorm and t-conorm operator classes to reflect
application-dependent operators semantics. We showed that extended semantics of various relational operators can be easily incorporated into the proposed FRDM-1, which gives a strong support that FRC-l(and also FRA-1) can be served as an expressiveness measure for various fuzzy query languages. REFERENCES
1. G.J. Klir and T.A. Folger, Fuzzy Sets, Uncertainty, and Information, Prentice-Hall Int'l, Inc., 1988, pp. 260-265 2. D.H. Lee, H. Lee-Kwang and M.H. Kim, "A Study on the Fuzzy Selective Relational Algebra", Proc. Int'l Conf. on Fuzzy Logic and Neural Network, 1992, pp. 353-356 3. D.H. Lee and M.H. Kim, "Accomodating Subjective Vagueness through a Fuzzy Extension to the Relatinal Data Model", Information Systems (to be published in Vol. 18, No. 6) 4. T. Ichikawa, "ARES: A Relational Database with the Capability of Performing Flexible Interpretation of Queries", IEEE Trans. Software Engineering, Vol. 12, No. 5, 1986 5. A. Motro, "VAGUE: A User Interface to Relational Databases that permit vague queries", A C M Trans. on O]]ice Information Systems, Vol. 6, No. 3, 1988, pp. 187-214 6. A. Motto, "Accomodating Imprecision in Database Systems: Issues and Solutions", Data Engineering, Vol. 13, No. 4, 1990, pp. 29-34 7. B. Buckles and E. Petry, "A Fuzzy Representation of Data for Relational Databases", Fuzzy Sets and Systems, Vol. 7, 1982, pp. 213226 8. M.H. Wong and K.S. Leung, "A Fuzzy Database Query Language", Information Systems, Vol. 15, No. 5, 1990, pp. 583-590 9. M. Zemankova and A. Kandel, "Implementing Imprecision in Information Systems", Information Sciences, Vol. 37, 1985, pp. 107-141 10. Y. Takahashi, "Fuzzy Database Query Languages and Their Relational Completeness Theorem", IEEE Trans. Knowledge and Data Engineering, Vol. 5, No. 1, 1993, pp. 122-125