You are on page 1of 23

GEFRED. A Generalized Model of Fuzzy Relational Data Bases. Ver. 1.

1
Dpto. Ciencias de la Computacion e Inteligencia Arti cial E.T.S. de Ingenier a Informatica. Universidad de Granada 18071 Granada (Spain) email: medina@robinson.ugr.es Tlf. 3458-244079
Abstract
In this paper, we present a Fuzzy Relational Databases model whose main characteristics are: the integration of previous models in the same framework, representation capabilities for a wide series of fuzzy information and a coherent and exible handling of it. This model aims to solve each problem of representation and handling of fuzzy information taking into account its speci c nature, and hence it allows the user to choose the comparison operator and the fuzzy compatibility measure to be used in a query. Besides, it permits the user to specify the precision with which the conditions involved in a query are satis ed.

MEDINA J.M., PONS O. and VILA M.A.

Keywords: Fuzzy Relational Database, Database, Fuzzy Sets, Relational Model

1 Introduction
The aim of this paper is to present a fuzzy extension to the Databases Relational Model. This extension will try to solve the problems related to the representation and handling of imprecise information. Because of this, we will have to incorporate some new elements into the Relational Model in order to include imprecise information inside the data structure, as well as to represent it by using the Fuzzy Sets Theory by Zadeh. The starting point of our model is the Relational Databases 6] which treats information as records grouped in relations or tables, to which it applies a small but powerful set of operators to obtain, organize or update the information in the Database. 1

The two viewpoints (procedural and non procedural) used in the Relational model to obtain the information (Relational Calculus and Relational Algebra) establish that any query to the Database has an answer that is a new relation. Neither of them permits the queries to be formulated in a fuzzy manner, i.e., it will not answer queries like: "Find all young people whose salary is not very high". In the last few years, some authors have taken on the problem of relaxing the relational model in order to admit some vagueness; this leads us to Database systems that lay within the scope of Arti cial Intelligence as they allow us to use information with a terminology which is very similar to that of natural language. Vagueness can be included in the system on two levels: The rst level considers the possibility of making vague queries to the classic databases. The second one is related to the problem of adding vague information to the system. In both cases, the Fuzzy Sets Theory 29] provides a powerful tool to represent vagueness. So, on the rst level, we consider the works of Bosc and Galibourg 2] and Kacprzyk 10]. The handling of the problems on the second level give rise to the fuzzy relational database models, whose theoretical basis will be described in the next section.

2 Main Theoretical Models


There are basically two models that extend the classic relational model allowing the representation of vagueness in the data base. In the model of Buckles and Petry 3], 4] (and also 1]) the relations are subsets of the Cartesian product 2D1 : : : 2Dm , where 2Di is any element of the power set of Di , P (Di). The basic way to represent uncertainty is through similarity relations 28] on scalar or numeric domains (fuzzy numbers are also allowed see 4]). These relations establish a partition on 2Di where the elements of each class are indistinguishable in an similarity level (imposed by the query). More recently, Shenoi and Melton 20] demonstrated that all good properties of this model were conserved when transitivity was eliminated, and, in general in 21] showed that the key to the problem was to partition the domains into equivalence classes. Rundensteiner et all 19], generalizes the model using relations not derived form equivalence classes. In short, the problem involves building classes in the corresponding domain, so that the elements in the same class are indistinguishable depending on the similarity degree permitted. Buckles et all 5], developed a relational calculus for their model. 2

In Prade-Testemale model 16], the relations corresponding to the knowledge base (basic relations) are embodied in the same representation (a table) as Codd's classic relational model, di ering from it in the types of data that may appear in the columns (value of an attribute for a tuple). Whereas the only imposition in the classic model is that the values must be atomic in a certain domain, in our model an attribute value of a tuple can be a possibility distribution; the possible particular cases of this distribution generates an extensive range of alternatives to be included as data types in the practical models, e.g. sets, labels and fuzzy numbers. This is the same approach adopted in 30] , 18]. The paper 17] includes the data type corresponding to a subset of the domain (representing non mutually exclusive possible assignations). In Umano's approximation 22] the basic relations are not classic ones, as the tuples belong to the relation with a certain degree (they are, thus, fuzzy relations). Vagueness is also introduced in the querying process to the database, as it is re ected as a fuzzy set over the corresponding domain. In this way, starting with a basic relation of the database, a new one is obtained that adds to every tuple the degree of matching with the property given by the fuzzy set that appears in the query. The relations so derived are fuzzy although they may be treated in a classic manner understanding the matching degree as one more item. The tuples (of these derived relations) will be selected according to the imposed threshold in their degree. The model we are going to present in the next section tries to integrate, in the same framework, the advantages of the approaches studied in this section, which eliminating their inconveniences and constraints . We have tried to maintain coherency both in the representation and handling of imprecise information. To do that, it has been necessary to introduce a speci c data structure and a modi ed Relational Algebra.

3 Generalized Model of Fuzzy Relational DB


GEFRED is developed in a possibilistic framework but includes a coherent management for fuzzy information without a possibilistic origin or representation. We proceed to show the basic lines concerning the data structure and data management.

3.1 Data Structure


One of the main goals to achieve with the model is to give support which is general enough for the representation and handling of all kinds of fuzzy information: Table 1 shows the data 3

type handled by our model. 1. A single scalar (Behavior = good, represented by the possibility distribution, 1/good) 2. A single number (Age = 28, represented by the possibility distribution, 1/28) 3. A set of mutually exclusive possible scalar assignations (Behavior = fgood, badg, represented by f1/good, 1/badg) 4. A set of mutually exclusive possible numeric assignations (Age = f20; 21g, represented by f1/20,1/21g) 5. A possibility distribution in a scalar domain (Behavior = f0:6/bad,0.7/normalg) 6. A possibility distribution in a numeric domain (Age = f0::=23; 1:0=24; 0:8=25g, fuzzy numbers or linguistic labels) 7. A real number belonging to 0,1], referring to degree of matching (Quality = 0.9) 8. An Unknown value with possibility distribution, Unknown=f1=u : u 2 U g 9. An Unde ned value with possibility distribution, Unde ned=f0=u : u 2 U g 10. A NULL value given by NULL=f1/Unknown,1/Unde nedg Table 1: Data types. Fuzzy information is organized via the following elements:
GENERALIZED FUZZY DOMAIN, DG .
e (D) is the set of all possibility distriDe nition 1 If D is the discourse domain, P

butions de ned on D, including those which de ne the Unknown and Unde ned types, (types 8 and 9 resp. in table 1) and NULL (type 10 in table 1), we de ne the Genee (D) NULL. ralized Fuzzy Domain, DG as DG P

The Generalized Fuzzy Domain constitutes the structural element which organizes the representation of the data types in table 1.

GENERALIZED FUZZY RELATION, RFG .

De nition 2 A Generalized Fuzzy Relation,RFG, is given by two sets "Head",(H) and "Body",(B), RFG = (H; B), de ned as:
- The "Head" consists of a xed set of triple "attribute- domain-compatibility",

H = f(AG1 : DG1 ; CAG ]); (AG2 : DG2 ; CAG ]); : : :; (AGn : DGn ; CAGn ])g (1)
1 2

where each attribute AGj has an underlined fuzzy domain DGj (j=1,2,: : : ,n), which is not necessarily di erent to the others , and CAGj is a "compatibility attribute" taking values in 0,1]. - The "Body" consists of a set of tuples, (called "generalized fuzzy tuples"), where each tuple is composed of a set of triple attribute-value-degrees,

(2) eij with (i = 1; 2; : : : ; m; m being the number of tuples in the relation, where d represents the domain value for the tuple i and the attribute AGj , and cij is the compatibility degree associated to this value.

ei1 ; ci1]); (AG2 : d ei2 ; ci2]); : : :; (AGn : d ein ; cin ])g B = f(AG1 : d

Observations:
1. The square brackets that enclose CAGj and cij denote an optional character for the compatibility degrees, in order to appear, explicitly, in the head and body of the relation respectively. 2. A tuple i, can contains a zero value for some of the cij that compose it, but not for all of them. 3. The de nition of Generalized Fuzzy Relation contemplates the classical relations as a particular case, where the classical domains over which the attributes that constitute the head of the relation are constructed, are particular cases of the de nition of Generalized Fuzzy Domains and where the compatibility attributes neither appear in the head nor compatibility degrees in the body.

De nition 3 Let RFG be a generalized fuzzy relation given by:


= f(AG1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g RFG = H ei1 ; ci1]); : : :; (AGn : d ein ; cin ])g B = f(AG1 : d
we will de ne Value Component of a generalized fuzzy relation, Rv FG , as the following: ( v = f(AG1 : DG1); : : : ; (AGn : DGn )g v RFG = H (3) v ei1 ); : : :; (AGn : d ein )g B = f(AG1 : d
(

where Hv and B v are the value components of the relation head and the body respectively, in this way we will de ne Compatibility Component of a generalized fuzzy relation, Rc FG , as the following: ( c = f CAG1 ]; : : :; CAGn ]g c (4) RFG = H c B = f c ]; : : :; ; c ]g
i1 in

where Hc and B c are the compatibility components of the relation head and body respectively.

GENERALIZED PRIMARY KEY, KG .

De nition 4 Let RFG be a generalized fuzzy relation given by: ( = f(AG1 : DG1 ; CAG ]); : : :; (AGn : DGn ; CAGn ])g RFG = H er1 ; cr1]); : : :; (AGn : d ern ; crn ])g B = f(AG1 : d
1

with r = 1; 2; : : : ; m, m being the number of relation's tuples, we will de ne Generalized Primary Key, KG , as a subset of H expressed as: KG H; KG = f(AGs : DGs ) : s 2 S f1; : : : ; ngg (5) which satisfy: 1. 8s 2 S , DGs is a simple domain, numeric or scalar, types 1 and 2 in table 1. 2. 8i; i0 2 f1; : : : ; mg; 9s 2 S : (AGs : dis ) 6= (AGs : di s ), where the operator 6= picks up the classic meaning of the inequality.
0

With the primary key de ned in this way, it is guaranteed that, on the one hand, the accessibility to each one of the relation's tuples and, on the other, the possibility of giving a fuzzy treatment to the attributes included in the primary key is suitable. Moreover, the existence of a primary key permits us to make demands on a Fuzzy Relational Database, in accordance with our model, to satisfy the Identity and Referential rules.

3.2 Data Manipulation


The model describes a Generalized Fuzzy Relational Algebra to manipulate the RFG ,s. The classic operations, Union, Intersection, Di erence, Cartesian Product, Projection, Join and Selection, are extended in order to enable them to operate coherently over the RFG ,s. Selection and Join base their operation on the use of fuzzy comparators constructed round some fuzzy compatibility measures that have appeared in the literature. Our model adopts a classical setting to construct the fuzzy comparators starting from the meaning of comparison operations de ned over the discourse domain, and extending this meaning to the treatment of generalized fuzzy domain's values. 6

3.2.1 Operators of Fuzzy Comparison


A critical aspect that any SBRD must deal with, is the de nition of operators which are implied in Selection and Join operations. This problem is solved by the Model through the de nition of comparison operators on two levels: as discourse domain D and as DG . On the rst level we de ne the Extended Comparator, e, and with its aid we construct the Generalized Fuzzy Comparator, G , on the second one.
EXTENDED COMPARATOR ( e)

De nition 5 Let D be the considered discourse domain, we will call Extended Comparator, e , any fuzzy relation de ned on D which can be expressed in the following
way:
e

: D D ?! 0; 1] e (di ; dj ) 7?! 0; 1]

(6)

with di ; dj 2 D

The Extended Comparator collects all the modalities of relation that exist among the values of considered discourse domain D, taking into account the speci c nature of these values and the character, classical or fuzzy , of the relation that exists among them. With this de nition, the Extended Comparator,( e), allows us to model, in a consistent way, the following comparison operators: stance, the "extended equal" operator would be expressed by =e (di; dj )= (di; dj ) where (di; dj )=1 for di = dj and (di; dj )=0 for di 6= dj . { Fuzzy Comparators such as "approximately equal","much greater than", etc. This kind of comparator will be expressed by membership functions. For instance, the "approximately equal" operator could be modeled by the corresponding extended comparator 'e with the following membership function:
'e(di ; dj ) = e? jdi ?dj j con

{ Classical Comparators of Relational Algebra such as: =; 6=; >; ; <; . For in-

>0

{ Similitude Comparators, which operate over scalar data with a similitude relation
established in them 28].
GENERALIZED FUZZY COMPARATOR,
G.
e

De nition 6 Let D be the considered discourse domain, let DG be the generalized fuzzy
domain constructed over it and let consider a function Ge de ned as:
G
e

be an extended comparator de ned on D. Let us

: DG DG ! 0; 1] e f f G (d1 ; d2 ) 2 0; 1]

(7)

we will say that Ge is a Generalized Fuzzy Comparator over DG induced by the extended comparator e , if it veri es:
e f f G (d1 ; d2 ) = e (d1 ; d2 )

8d1; d2 2 D

(8)

f f where d 1; d 2 represent the possibility distributions, 1=d1 ; 1=d2 , induced by values d1 ; d2 , respectively.

3.2.2 Generalized Fuzzy Relational Algebra


With the previously de ned fuzzy comparators and with the data structure adopted by the model, we are now ready to extend the meaning of Relational Algebra operator, in order to manipulate the "generalized fuzzy relations" properly.
GENERALIZED FUZZY UNION,
(
G

De nition 7 Let RFG and R0FG be two generalized fuzzy relations given by:
= f(AG1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g RFG = H ei1 ; ci1]); : : :; (AGn : d ein ; cin ])g B = f(AG1 : d

R0FG

( 0 = f(AG1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g = H 0 e0kn ; c0kn ])g e0k1 ; c0k1 ]); : : :; (AGn : d B = f(AG1 : d

with i = 1; : : : ; m and k = 1; : : : ; m0, m and m0 being the respective cardinalities, then the Generalized Fuzzy Union of RFG and R0FG will be de ned by:

RFG

8 > 1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g <HG = f ((AG 0 v B = Bv B0v G RFG = > B : G = B c G = f c00 ]; : : :; c00 ]g
G

l1

ln

(9)

with l = 1; : : : ; m00, m00 being the union cardinality, where

8 > > < 00 clj = > > :

maxfclj ; c0lj g clj c0lj 0

if 9clj & 9c0lj if 9clj & 6 9c0lj if 9c0lj & 6 9clj if 6 9clj ; 6 9c0lj &; 9CAGj o 9CAGj
0

(10)

0 clj being the compatibility degree of d00 lj for the tuple l in the relation RFG , and clj the 00 0 compatibility degree of dlj for the tuple l in the relation RFG .

Therefore, the Generalized Fuzzy Union of two Generalized Fuzzy relations contains these tuples which belong to the union of both relations, adopting, for the compatibility degree to every tuple in the union, c00 lj , the \maximum" of compatibility degrees adopted by these values in the origin relations as shows ec. 10. GENERALIZED FUZZY INTERSECTION, \G

De nition 8 Let RFG and R0FG be two generalized fuzzy relations given by:
= f(AG1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g RFG = H ei1 ; ci1]); : : :; (AGn : d ein ; cin ])g B = f(AG1 : d
(

R0FG

( 0 = f(AG1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g = H 0 e0kn ; c0kn ])g e0k1 ; c0k1 ]); : : :; (AGn : d B = f(AG1 : d

with i = 1; : : : ; m and k = 1; : : : ; m0, m and m0 being the respective cardinalities, then the Generalized Fuzzy Intersection of RFG and R0FG will be de ned by:
8 > 1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g < H\G = f ((AG 0 v RFG \G RFG = > B = B\G = Bv \ B0v : \G Bc = f c00 ]; : : :; c00 ]g
\G
l1 ln

(11)

with l = 1; : : : ; m00, m00 being the intersection cardinality, where 8 > < minfclj ; c0lj g if 9clj & 9c0lj0 00 clj = > clj if 9clj & 6 9clj : c0 if 9c0lj & 6 9clj lj

(12)

0 clj being the compatibility degree of d00 lj for the tuple l in the relation RFG and clj the 0 compatibility degree of d00 lj for the tuple l in the relation RFG

So then, the Generalized Fuzzy Intersection of two Generalized Fuzzy relations contains these tuples which belong to the intersection of both relations, adopting, for the compatibility degree to every tuple in the intersection, c00 lj , the \minimum" of compatibility degrees adopted by these values in the origin relations as shows ec. 12. GENERALIZED FUZZY DIFFERENCE, ?G

De nition 9 Let RFG and R0FG be two generalized fuzzy relations given by:
= f(AG1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g RFG = H ei1 ; ci1]); : : :; (AGn : d ein ; cin ])g B = f(AG1 : d
(

R0FG

( 0 = f(AG1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g = H 0 e0k1 ; c0k1 ]); : : :; (AGn : d e0kn ; c0kn ])g B = f(AG1 : d

with i = 1; : : : ; m and k = 1; : : : ; m0, m and m0 being the respective cardinalities, then the Generalized Fuzzy Di erence of RFG and R0FG will be de ned by:
8 > 1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g < H?G = f ((AG 0 v RFG ?G RFG = > B = B?G = Bv : ?G Bc = f c00 ]; : : :; c00 ]g
?G
l1 ln

(13)

with l = 1; : : : ; m00,m00 being the di erence cardinality, where 8 > minfclj ; (1 ? c0lj )g if 9CAGj ; 9CAGj & l 2 Bv \ B0v > > < clj if 9CAGj & 6 9CAGj 00 clj = > 1 if 6 9CAGj ; 9CAGj & l 2 Bv ? B0v > > : 1 ? c0lj if 6 9CAGj ; 9CAGj & l 2 Bv \ B0v
0 0 0 0

(14)

0 clj being the compatibility degree of d00 lj for the tuple l in the relation RFG and clj the 0 00 compatibility degree of dlj for the tuple l in the relation RFG .

As can be noticed, the "Generalized Fuzzy Di erence" of two Generalized Fuzzy relations, contains these tuples which belong to the di erence of both relations, adopting for the compatibility degree to every tuple in the di erence c00 lj the value shows in ec. 14.

10

GENERALIZED FUZZY CARTESIAN PRODUCT,

De nition 10 Let RFG and R0FG be two generalized fuzzy relations given by: ( = f(AG1 : DG1 ; CAG ]); : : :; (AGn : DGn ; CAGn ])g RFG = H ei1 ; ci1]); : : :; (AGn : d ein ; cin ])g B = f(AG1 : d
1

8 < R0FG = :

0 ; C ]); : : :; (A0 : D0 ; C H0 = f(A0G1 : DG AG AGn ])g 1 Gn Gn 0 0 0 0 0 0 0 e e B = f(AG1 : dk1 ; ck1]); : : :; (AGn : dkn ; ckn ])g
0

with i = 1; : : : ; m and k = 1; : : : ; m0, m and m0 being the respective cardinalities, then the Generalized Fuzzy Cartesian Product of RFG and R0FG will be de ned by: ( H G = H H0 0 RFG G RFG = B (15) = B B0
G

As can be seen, the "Generalized Fuzzy Cartesian Product" operates like the usual Cartesian product, except that it considers the compatibility attributes and their values as integral parts in the relations. GENERALIZED FUZZY PROJECTION, PG

De nition 11 Let RFG be a generalized fuzzy relation given by: ( = f(AG1 : DG1 ; CAG ]); : : :; (AGn : DGn ; CAGn ])g RFG = H er1 ; cr1]); : : :; (AGn : d ern ; crn ])g B = f(AG1 : d
1

with r = 1; : : : ; m, m being the number of tuples in the relation, Let X be a subset of H expressed as:

X H; X = f(AGs : DGs ; CAGs ]) : s 2 S; s0 2 S 0; S; S 0 f1; : : :; ngg


0

then, we will say that the Generalized Fuzzy Projection from RFG onto X, PG (RFG ; X ), is a generalized fuzzy relation given by: ( P = X PG (RFG ; X ) = H (16) ers ; crs ])g BP = f(AGs : d
0

with s 2 S; s0 2 S 0 ; S; S 0

f1; : : :; ng.

The projection can be carried out on any subset in Head, which can include "value attributes" and "compatibility attributes". The result of the projection is a "vertical selection" over the body of the relation. 11

GENERALIZED FUZZY SELECTION, SG

De nition 12 Let RFG be a generalized fuzzy relation given by: ( = f(AG1 : DG1 ; CAG ]); : : :; (AGn : DGn ; CAGn ])g RFG = H er1 ; cr1]); : : :; (AGn : d ern ; crn ])g B = f(AG1 : d
1

with r = 1; : : : ; m, m being the number of tuples in the relation, e 2 DG be a constant, let Ge be a "generalized fuzzy comparator" and let 2 0; 1] Let a be a "compatibility threshold", then the Generalized Fuzzy Selection carried out e and the attribute AGi and on RFG by the condition induced by Ge composed with a S e e ) ), is a relation RFG given by: quali ed by , SG(RFG ; G (Ai; a

with

H = f(AG1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g RS FG = B = f(A : d er i ; c0r i ); : : :; (AGn : d er n ; cr n ])g G1 er 1 ; cr 1]); : : :; (AGi : d (17)
0 0 0 0 0 0

c0r i =
0

e) G (dr i ; a
e
0

(18)

r0 = 1; : : : ; m0, m0 being the selection cardinality.


- Composition Rules for the Generalized Fuzzy Selection, SG

De nition 13 Let RFG be a generalized fuzzy relation given by: ( = f(AG1 : DG1 ; CAG ]); : : :; (AGn : DGn ; CAGn ])g RFG = H er1 ; cr1]); : : :; (AGn : d ern ; crn ])g B = f(AG1 : d
1

with i = 1; : : : ; m,m being the number of tuples in the relation, - let S f1; : : : ; ng be n being the "degree" of RFG , e i 2 DGi ; i 2 S be a set of constants, which are not necessarily di erent, - let a and AGi ; i 2 S a set of attributes in the head of RFG , which are not necessarily di erent, e ; i 2 S be a set of generalized fuzzy comparators, which are not necessarily - let Gi di erent, - let i 2 0; 1] be a set of "compatibility threshold", e (Ai; a ei ) i ); i 2 S be the set of generalized fuzzy selections - and let SG (RFG ; Gi e on the ei and the generalized fuzzy comparators Gi induced by the constants a attributes AGi of RFG and quali ed by i,

12

then we de ne the following compositions on the Generalized Fuzzy Selection: 1. We call Complement of the Generalized Fuzzy Selection, e (A ; a e (A ; a :SG (RFG; Gi i ei ) i ) = SG (RFG ; : Gi i e i) i ), the generalized fuzzy :S relation, RFG given by:

R:S FG
with

= f(AG1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g = H er 1 ; cr 1]); : : :; (AGi : d er i ; c0r i ); : : :; (AGn : d er n ; cr n ])g B = f(AG1 : d (19)
0 0 0 0 0 0

2. The Conjunction of the Generalized Fuzzy Selection is de ned by the expression: VS (R ; e (A ; a T e (Ai ; a e i) i ) G FG Gi i e i ) i ) = G SG (RFG ; Gi (21)
i S
2

r0 = 1; : : : ; m0, m0 being the selection cardinality.

c0r i = 1 ?
0

ei) Gi (dr i ; a
e
0

(20)

i S
2

3. The Disjunction of the Generalized Fuzzy Selection is given by the expression: S W e (A ; a e (A ; a S i ei) i ) = G SG (RFG ; Gi G (RFG ; Gi i e i) i) (22) i S i S
2 2

The Generalized Fuzzy Selection de ned in this way, provides a mechanism which ts the "compatibility degrees" of the "attribute values" according to the conditions imposed in the query and eliminates those tuples which not satisfy an established "compatibility threshold". For this, we make use of the "generalized fuzzy comparators" employed to model the conditions. Also, rules have been introduced to compose complex queries starting from some more simple ones. GENERALIZED FUZZY JOIN, 1G

De nition 14 Let RFG and R0FG be two generalized fuzzy relations, which are not
necessarily di erent, given by: ( = f(AG1 : DG1 ; CAG1 ]); : : :; (AGn : DGn ; CAGn ])g RFG = H ej 1 ; cj 1 ]); : : :; (AGn : d ejn ; cjn ])g B = f(AG1 : d 8 0 0 ; CA ]); : : :; (A0 : D0 ; CA ])g < H = f(A0G1 : DG Gn 1 Gn Gn G1 R0FG = : 0 0 0 0 0 0 e e B = f(AG1 : dk1 ; ck1]); : : :; (AGn : dkn ; c0kn ])g
0 0 0 0 0 0 0 0

with j = 1; : : : ; m y k = 1; : : : ; m0, m and m0 being the respective cardinalities and n, n0 the respective degrees,

13

let Ge be a "generalized fuzzy comparator" and let 2 0; 1] be a "compatibility threshold", then the Generalized Fuzzy Join carried out on RFG G R0FG by the condition Ge induced on the attributes AGi in RFG and A0Gi in R0FG , quali ed by ", 0 e 1G (RFG G R0FG ; 8 ), is given by: G (Ai ; Ai ) 1 H = H H0 > < 1 = f(AG1 : d er1 ; cr1]); : : :; (AGi : d eri ; c00 B (23) R1 ri ); : : :; FG = > : 0 0 00 0 0 e e (AGi : dri ; cri ); : : :; (AGn : drn ; c0rn ])g with n00 = n + n0, where r is the Join cardinality and
0 0 0 0 0 00 00 00

00 c00 ri = cri =
0

e e e0 G (dri ; dri )
0

(24)

The Generalized Fuzzy Join can be understood as a kind of Generalized Fuzzy Selection carried out on the Generalized Fuzzy Cartesian Product of the two implicated relations, and whose result is the variation of the compatibility degrees of the attributes on which the Join is executed and the suppression of these tuples that do not present a "Join degree" higher or equal to an established threshold.

4 Example of Handling and Representation of a Fuzzy Relational DB Using GEFRED


In order to illustrate the behavior of the model, we are using a table with employees' information, where some of the data will be fuzzy. However this table will not exploit all the possibilities of the GEFRED model either in the representation or in the data handling.

H NAME B Luis

ADDRESS Recogidas Antonio Reyes Catolicos Juan Carlos Camino Ronda Francisco P. A. Alarcon Julia Puerta Real Ines Manuel de Falla Javier Gran V a

AGE &.8/30,1/31 Middle Young Old Young #28 *30,35

PRODUCTIVITY Good Fair Bad Excellent Good Good Fair

SALARY 110000 100000 90000 150000 130000 125000 105000

The symbol # means "approximately" and it is de ned in g. 1 c), & indicates possibility distributions and * interval.

Table 2: Employees Table, Emp We suppose that the information stored for NAME and ADDRESS is crisp. The underlying domains for AGE and SALARY are numeric and labeled possibility distributions, 14

se(d; d0) Bad Fair Good Excellent Bad 1 0.8 0.5 0.1 Fair 0.8 1 0.7 0.5 Good 0.5 0.7 1 0.8 Excellent 0.1 0.5 0.8 1 Table 3: Proximity relation over PRODUCTIVITY domain.
(expressed as trapezoidal functions), may be de ned over them, (see gure 1). Both attributes may take the "Unknown" value but, given the nature of the relations, the values "unde ned" and "NULL" are not possible. The underlying domain for PRODUCTIVITY is type 1 in table 1, in table 3 the domains values as well as the proximity relation between them are speci ed. The value "Unknown" is also allowed. According to the GEFRED model, the "heading" of the generalized fuzzy relations is given as follows:

H = f NAME : DNAME ; DADDRESS : ADDRESS; AGE : DAGE ;

PRODUCTIV ITY : DPRODUCTIV ITY ; SALARY : DSALARY g

(25)

Where the "compatibility attributes" don't appear, it is because the tuple compatibility degree of each attribute value is 1. The "body" of the relation is composed by all the tuples in the relation of table 2. In order to show how the Generalized Fuzzy Relational Algebra works, we are going to solve an example of a query. Query: Give me the NAME, AGE, PRODUCTIVITY and SALARY, as well as the satisfaction degree of the conditions for each attribute, for those employees whose PRODUCTIVITY is "good" (degree 0.9) and SALARY is "high" (degree 0.7) or whose AGE is "old" (degree 0.6) and SALARY is "middle" (degree 0.7) The "generalized fuzzy comparison operators" implied in the query should be de ned in the implementations or should be stored as part of the meta-knowledge of the Fuzzy Relational Database. GEFRED, does not specify the way it must be done. In our example, we use the following models for the comparison operators implied: For the compatibility in the attributes AGE and SALARY we use the usual "extended comparison operator" =e (d; d0) = (d; d0) and the induced "generalized fuzzy comparison operator":
=e (d; ed e0 ) = (d;d )2D D
0

sup

0 min (=e (d; d0); d e(d); d e (d ))


0

(26)

15

16

YOUNG
A A

MIDDLE
A A A A

B B B

OLD

B B

16

25 30 35

B B

40

45 50 55

65

B B B

80

AGE

a)

LOW

MEDIUM
B B A B A A A A

HIGH

0 50 65

85

B B B

95

110

A A

130

180

SALARY 1000$

b)
1
6 J J J J J

n-5

J J

n+5

AGE

c)

Figure 1: Labels de nitions on AGE and SALARY attributes. 16

e and d e0 respectively. where d e(d) and d e (d0 ) are the possibility distributions related to d For PRODUCTIVITY we will use the "extended comparison operator" se(d; d0 ) given in table 3. The "generalized fuzzy comparison operator" used will be:
0

se (d; ed e0 ) =

(d;d )2D D
0 0

0 sup min (se (d; d0); d e(d); d e (d ))


0

(27)

e where, as in the above, d e(d) and d e (d0 ) are the possibility distributions related to d e0 , respectively. and d

H NAME ADDRESS B Luis Recogidas


Julia Ines

AGE &.8/30,1/31 Puerta Real Young Manuel de Falla #28

REND Good Good Good

cREND 1 1 1

SALARY 110000 130000 125000

The values for cPROD are obtained from the proximity relations showed in Table 3. The tuples whose value is < = 0:9 for the compatibility degree of PRODUCTIVITY do not belong to the relation.

Table 4: Compute of S1 Once we have xed the comparison operators, the query expressed in GEFRED's Algebra is as follows:

PG((S1 ^G S2) _G (S3 ^G S4) ; X )


where:

(28)

- S1 = SG (Emp; se (PRODUCTIV ITY; Good) 0:9) with "Good" 2 DREND. - S2 = SG (Emp; =e (SALARY; High) 0:7) being "High" the label that refers to the possibility distribution shown in gure 1 b). - S3 = SG(Emp; =e (AGE; Old) 0:6) being "Old" the label that refers to the possibility distribution shown in gure 1 a). - S4 = SG (Emp; =e (SALARY; Medium) 0:7) being "Medium" the label that refers to the possibility distribution shown in gure 1 b). - X = fNAME; AGE; cAGE ; REND; cREND ; SAL; cSAL g The tables 4, 5, 6, 7, 8, 9, 10 y 11, show the operations performed to solve the query. 17

H NAME ADDRESS B Francisco P. A. Alarcon


Julia Ines

AGE Old Puerta Real Young Manuel de Falla #28

PRODUCTIVITY Excellent Good Good

SALARY 150000 130000 125000

cSAL 1 1 0.75

The values for cSAL , calculated from 26, for trapezoidal labels may be obtained through trigonometric rules. The tuples whose value is < = 0:7 for the degree of SALARY do not belong to the relation.

Table 5: Compute of S2

H NAME B Antonio

ADDRESS Reyes Catolicos Francisco P. A. Alarcon Julia Puerta Real

AGE Middle Old Young

cAGE 0.75 1 1

PRODUCTIVITY Fair Excellent Good

SALARY 100000 150000 130000

The values for cAGE , calculated from 26, for trapezoidal labels may be obtained through trigonometric rules. The tuples whose values are < = 0:6 for the degree of AGE do not belong to the relation.

Table 6: Compute of S3

H NAME ADDRESS B Luis Recogidas

AGE &.8/30,1/31 Antonio Reyes Catolicos Middle Ines Manuel de Falla #28 Javier Gran V a *30,35

PRODUCTIVITY Good Fair Good Fair

SALARY 110000 100000 125000 105000

cSAL 1 1 0.75 1

The values for cSAL , calculated from 26, for trapezoidal labels may be obtained through trigonometric rules. The tuples whose value is < = 0:7 for the degree of SALARY do not belong to the relation.

Table 7: Compute of S4 18

H NAME ADDRESS B Julia Puerta Real


Ines

AGE REND cREND SALARY cSAL Young Good 1 130000 1 Manuel de Falla #28 Good 1 125000 0.75

For the computation of the "Fuzzy Generalized Conjunction" we nd the "Fuzzy Generalized Intersection" of the relations obtained by queries S1 and S2.

Table 8: Compute of S1 ^G S2

H NAME ADDRESS AGE cAGE REND SALARY cSAL B Antonio Reyes Catolicos Middle 0.75 Fair 100000 1
For the computation of the "Fuzzy Generalized Conjunction" we nd the "Fuzzy Generalized Intersection" of the relations obtained by queries S3 and S4.

Table 9: Compute of S3 ^G S4

H : : : AGE cAGE PRODUCTIVITY cREND SALARY cSAL B : : : Middle 0.75 Fair 0 100000 1
: : : Young 0 : : : #28 0
Good Good 1 1 130000 125000 1 0.75
For the computation of the "Fuzzy Generalized Disjunction" we nd the "Fuzzy Generalized Union" of (S1 ^G S2) and (S3 ^G S4 ).

Table 10: Compute of ((S1 ^G S2) _G (S3 ^G S4))

H NAME AGE cAGE PRODUCTIVITY cREND SALARY cSAL B Antonio Middle 0.75 Fair 0 100000 1
Julia Ines Young 0 #28 0 Good Good 1 1 130000 125000 1 0.75
The value as well as compatibility attributes are projected.

Table 11: PG((S1 ^G S2) _G (S3 ^G S4) ; X ) 19

5 Conclusions
5.1 Summary
The model that we show in this work provides the following characteristics as contrasted with other proposals that have appeared in the literature: It organizes fuzzy information in a consistent form. The "generalized fuzzy relations" enable us to organize both the starting data and the information resulting from operations carried out in the same way. A "generalized fuzzy tuple", is understood as a set of attribute values, fuzzy or not, which show a compatibility degree, high or low, with the entity or relation that this tuple expresses. In the previous example, one of the tuples that appears as a result of the query , for instance, is fAntonio, (Middle,0.75), (Fair,1), (100000,1)g, this means that in the database there is a tuple which responds to the conditions of the query with a 0.75 degree for the requests of age, and with a degree 1 for those of productivity and salary. The model shows a great exibility in the handling and evaluation of fuzzy information, based on the freedom to select one generalized fuzzy comparator or another and on controlling the degree to satisfy the individual conditions of a query. The type of data to be operated is wide enough in comparison with other proposals. Its fuzzy nature is more dispersed than in other models. In the set of "meta-information" that the expert or user must provide to the Database System we also nd besides, the de nition that it adopts for the di erent labels, the model of fuzzy comparator that is going to associate with each one of the comparisons to establish for each de ned domain. Finally, a large number of the previous models can be considered, under certain conditions, as particular cases of GEFRED. Therefore, this model can be used to represent them.

5.2 Research Course in the Future


A Fuzzy Knowledge Representation model for Databases will be published shortly 12]. Therefore, a Fuzzy Relational Calculus is being developed for GEFRED. At the same time, we are developing a formal syntax for an extended SQL which permits us to operate on the model described in this paper. With GEFRED, an adequate Fuzzy Knowledge Representation and the extended syntax for SQL, we will be able to develop a prototype that implements a FRDBMS using a conventional RDBMS as kernel. Thanks to such a prototype we will evaluate the model e ciency, 20

both in its capability for handling imprecise information and in the execution speed of fuzzy operations.

References
1] Anvari M., Rose G.F. "Fuzzy Relational Databases". Analysis of Fuzzy Information. Bezdek ed. Vol II CRC Press. (1987) 2] Bosc P., Galibourg M., Hamon G. "Fuzzy Querying with SQL: Extensions and Implementation Aspects". Fuzzy Sets and Systems. v.28 pp. 333-349. (1988) 3] Buckles B.P., Petry F.E. "A Fuzzy Representation of Data for Relational Databases". Fuzzy Sets and Systems, 7. 213-226. (1982) 4] Buckles B.P., Petry F.E. "Extending the Fuzzy Database with Fuzzy Numbers". Information Sciences, 34. 145-155. (1984) 5] Buckles B.P., Petry F.E., Sachar H.S. "A Domain Calculus for Fuzzy Relational Databases". Fuzzy Sets and Systems, 29. 327-340. (1989) 6] Codd E.F. "A Relational Model of Data for Large Shared Data Banks". Commun. ACM, 13. (6). pp. 377-387 (1970) 7] Cubero J. C., Medina J. M., Vila M. A. \In uences of Granularity Level in Fuzzy Functional Dependencies" in \Symbolic and Quantitative Approach to Reasoning and Uncertainty", Lectures Notes in Computer Sciences, 747. Springer Verlag, pp. 73-78. (1993) 8] Cubero J. C., Pons O., Vila M. A. \Weak and Strong Resemblances and Fuzzy Functional Dependencies". IEEE'94 International Conference, Florida. 9] Cubero J. C., Vila M. A. \A New De nition of Fuzzy Functional Dependencies in Fuzzy Relational Databases". International Journal of Intelligent Systems, 9(5), pp 441-448. (1994) 10] Kacprzyk J., Ziolkowski A. "Database Queries with Fuzzy Linguistic Quanti ers". IEEE Transactions on Syst., Man, and Cyb. Vol SMC?16 no 3:(1986) 11] Medina J. M., Vila M.A., "Un Modelo de Bases de Datos Difusa Aplicado a Informacion Medica". 1er Congreso Espa~ nol sobre Tecnolog as y Logica Fuzzy. Granada. (1991) 12] Medina J. M., Vila M.A., Cubero J.C., Pons O. \Towards the Implementation of a Generalized Fuzzy Relational Database Model". To appear in Fuzzy Sets & Systems. (1993) 21

13] Medina J. M. \Bases de Datos Relacionales Difusas: Modelo Teorico y Aspectos de su Implementacion". Ph. Thesis. University of Granada. (1994) 14] Pons O., Vila M.A., Delgado M. \Inferencia a Partir de una Base de Datos Difusa, Utilizando Reglas Difusas." 3er Congreso en Tecnologias y Logica Fuzzy. Santiago de Compostela. (1993) 15] O. Pons, M. A. Vila, J. M. Medina. Handling Imprecise Medical Information in the Framework of Logic Fuzzy Databases, Fuzzy Systems & A. I. Vol. III. Nr. 1/1994. Ed. Academiei Romane. (1994) 16] Prade H., Testemale C. "Generalizing Database Relational Algebra for the Treatment of Incomplete/Uncertain Information and Vague Queries". Information Sciences, 34. 115-143. (1984) 17] Prade H., Testemale C. "Representation of Soft Constraints and Fuzzy Attribute Values by means of Possibility Distributions in Databases". Bezdek ed. Analysis of Fuzzy Information. Vol II CRC Press. (1987) 18] Raju K., Majumdar A. "The Study of Joins in Fuzzy Relational Databases". Fuzzy Sets and Systems 21:pp19 ? 34:(1987) 19] Rundensteiner E.A., Hawkes L. W., Bandler W. "On Nearness Measures in Fuzzy Relational Data Models". International Journal of Approximate Reasoning. 3:pp267 ? 298:(1989) 20] Shenoi S., Melton A. "Proximity Relations in the Fuzzy Relational Database Model". Fuzzy Sets and System, 31. 285-296. (1989) 21] Shenoi S., Melton A. "An Extended Version of the Fuzzy Relational Database Model". Information Sciences, 52. 35-52. (1990) 22] Umano M. "Freedom?0 : A Fuzzy Database System". Fuzzy Information and Decision Processes. Gupta-Sanchez edit. North-Holland Pub. Comp. (1982) 23] Vila M.A., "Las Bases de Datos Relacionales y su Tratamiento Logico". Working paper. (1992). 24] Vila M.A., Cubero J.C., Medina J.M., Pons O. \Logic and Fuzzy Relational Databases: a new Language and a new De nition". En P. Bosc y Kacprzyk, editors, Fuzzy Sets and Possibility Theory in Database Management Systems. Physica Verlag. (1993). 25] Vila M.A., Cubero J.C., Medina J.M., Pons O. \On the Use of a Logical De nition of Fuzzy Relational Databases". 2o IEEE International Conference on Fuzzy Systems, S. Francisco, pp 489-499. (1993). 22

26] Vila M.A., Cubero J.C., Medina J.M., Pons O. \The Generalized Selection: An Alternative Way for the Quotient Operations in Fuzzy Relational Databases". In International Conference on Information Systems, IPMU'94. (1994). 27] Vila M.A. et al. \A Logic Approach to Fuzzy Relational Databases", International Journal of Intelligent Systems,9(5), pp 449-461, (1994). 28] Zadeh L.A. "Similarity Relations and Fuzzy Orderings". Information Sciences. vol. 3 177-200. (1971) 29] Zadeh L.A. "Fuzzy Sets as a Basis for a Theory of Possibility". Fuzzy Sets and Systems. 1, 3-28. (1978) 30] Zemankova M., Kandel A. "Fuzzy Relational Data Bases - A Key to Expert Systems". Verlag TUV Rheinland. (1984)

23

You might also like