Sei sulla pagina 1di 6

Fuzzy Object-Oriented Databases

and
tS
Motohide Umano'

Implementation of ata Manipulation Language


Takafumi Imada2 Itsuo Hatono2 Hiroyuki Tamura2

1: Department of Mathematics and Information Sciences College of Integrated Arts and Sciences

Osaka Prefecture University 1-1, Gakuen-eho, Sakai, Osaka 599, Japan Phone: +81-722-52-1161 ext.2739, Fax: +81-722-55-2981
.

Internet: umano@mi.cias.osakafu-u.ac.jp 2: Division of Systems Science Department of Systems and Human Science Graduate School of Engineering Science Osaka University, Toyonaka, Osaka 560, Japan

Abstract
Ordinary object-oriented databases have been well studied. We have already proposed a fuzzy objectoriented database that can treat fuzzy-set attribute values with certainly factors and fuzzy inheritance. I n this paper, we design and implement an SQLtype data manipulation language and demonstrate its facilities using several examples.

OODB (FOODB) and its data manipulation language based on Encore query algebra [6] written in AKCL (Austin Kyoto Common Lisp) and running
on a UNIX operating system. In this paper, we design and implement a new data manipulation language, a FOODB version of SQL (structured query language) and demonstrate its facilities using several examples.

1. Introduction
Recently, object-oriented databases (OODB) have been well studied [1] and applied t o many fields such as office information and knowledgebased systems, CAD/CAM, hardware and software design and network management. It is, however, very difficult for OODB to represent and manipulate fuzzy data in the real world. Studies on fuzzy databases have mainly focused on fuzzy relational ones [2], but very recently several fuzzy object-oriented database systems are proposed [3], [41, [51. In [4], we implemented a prototype of a fuzzy

2. Fuzzy Qbject-Oriented Databases


We have an example of a fuzzy object-oriented database of human shown in Fig. 1, where we have classes human, student, male, female, home and university and instances Suzuki-Ichiro, TanakaNanako and Yumadu- Taro. The attribute values of Yamada-Taro are height=75, weight={0.5/70, 1/80, 1/90} and age=25, which are not shown in Fig. 1. We can have a fuzzy set with a certainty factor as an attribute value and define fuzzy terms (names of fuzzy sets) and fuzzy predicates in an attribute for its own usage. In Fig. 1, the attribute

0-7803-4863-Xl98 $10.0001998 IEEE

1344

Authorized licensed use limited to: Jaypee Institute of Technology. Downloaded on September 8, 2009 at 19:10 from IEEE Xplore. Restrictions apply.

height weight age (term old: { 0.3/40,0.7/50,6 , 1 01/70} / young:{ 1 01 1 , / ,/ 0 0.5/20,0.3/30) (Prd old: (s x 4 60) 0 young: (z x 20 30) )
\
r

university lecture

height (term tall:( 0.4/175,0.8/180,

(term

1/185, 1/190} short:( 1/155, 1/160,0.5/165}) (pred tall: (s x 170 1 5 8) short: (z x 160 1 0 ) 7)
weight (term 1/80} heavy: { 0.5/70, 1/75, light:{ 1 5 , / 0 1/55,0.5/60} ) @red 5 heavy: (s x 657 ) light: (z x 55 65)

tl:05100815 al(./6,./6, 1/170,1/175} short:( 1/145, 1/150,0.5/155} (pred tall: (s x 160 1 0 7) short: (z x 150 1 0 ) 6)
weight (term 1/65, / 0 17} heavy: { 0.5/60, light: { 1 4 , / 01/45,0.5/50} ) (Pred heavy: (s x 55 65) light: (z x 45 55) )

grade

I
height: weight: age: university:

OID

%t10

170
light young

height: weight: age:

15 6
light

.-

....... lecture:
grade:

am. ....... ........ .......... homg.. ............. a ......


{0.8/fuzzy-theory, ...}

(0.5124, 1/25,0.5/26} university: *---....... (cf 0 4 . .................... ) ....... home: a .... lecture: ..f fuzzy-theory (cf: 0.5)

..

m2

'***qrade:{

-.-

{ml, m2)

(cf 0 8 .)

suzuki OID: %t2 tel-no: 0727-99-9999


address: kawanishi

* . -

* .*

tanaka OID: %t4


address: sakai

tel-no Osaka-u %to tel-no: 06-844-1 1 1 5

om:

tel-no: 0722-44-4444

address:

toyonaka

Fig. 1. An example of fuzzy data

1345

weight of Suzuki-Ichiro and Tanaka-Hanako have the same fuzzy set name (term) light but its values are different since the former is defined as the fuzzy set {1/50, 1/55, 0.5/60} in the class maze and the latter {1/40, 1/45, 0.5/50} in the class female. Thus, a term can be defined by different fuzzy sets in different attributes or different objects [2]. It should be noted that a term young has the same meaning in Suzuki-lchiro and TanakaHanako because it is defined in the common super class human. A certainty factor can be a fuzzy set 1 in the unit interval [0, 1 although we have no such examples in this paper. We can describe, for example, the class human and the instance Suzuki-Ichiro in the followings:
(%def class 'human :super n i l :attribute ' ((height (%value nil)) (weight (%value nil) (age (%term (old (0.3/40, 0 . 7 / 5 0 , 1/60, 1/70>) (Young C l / O , 1/10, 0.5/20, 0.3/30))) (%pred (old (x) (s x 40 60)) (young (x) (z x 20 30)))
)> )

1 inheritance [1 .

3. SQL-type Data Manipulation Lan-

wee
The SQL (structured Query Language) [7] is now the standard data manipulation language in ordinary databases. It is very important to investigate the possibility of applicability of SQL to fuzzy object-oriented databases. We design and implement an SQL-type data manipulation language for the FOODB. We will demonstrate the seEect statement for retrieving fuzzy data using several simple examples. These examples only show how queries are written in the language and how they retrieve from the fuzzy object-oriented database. More discussions will be described in the subsequent papers.
Example 1. (non-fuzzyretrieval) Retrieve height of a student whose name is Suxuki-

Ichiro.
>(select height from student where (%= student.%name 'Suzuki-Ichiro)) (170)

(yaakeinstance ' Suzuki-Ichiro :super '((student 1) (male 1)) :attribute ((height (%value 170 1)) (weight (%value light 1)) (age (%value young)) (university (%value Osaka-U I)) (home (%value Suzuki I)) (lecture (%value {0.8/fuzzy-theory, (grade ('/.valuem2 1))

where > is a prompt, followed by the user input and the result. The select is followed by attribute names to be retrieved, the from by class names for retrieving instances and the where by the condition to be satisfied by the instances. Since %name is a special attribute for the name of instance, student.%name means student's name.
Example 2. (retrieval with funetion %=) Retrieve names of students whose weights arc 70.
>(select %me from student

...>>

>>

where (%= student.weight 7 0 ) )

CO. 167/yamada-taro)

Classes and instances inherit attributes of their super classes. In our system, we can define degrees of inheritance which can be numbers or fuzzy sets in [0, 1 . Note that an instance, say, Suzuki-Ic'chiro, 1 belongs to more than one class, student and maze, which means that this system supports a multiple

The %=is a built-in function defined as

where (f f(z1,2 , . z

z1 z2

.. - 2 ) ,

.. ,z,),

is a Lisp-like notation for the symbols n and U mean the

1346

Authorized licensed use limited to: Jaypee Institute of Technology. Downloaded on September 8, 2009 at 19:10 from IEEE Xplore. Restrictions apply.

intersection and the union of fuzzy sets, respectively, and [AI stands for the cardinality of the fuzzy set A, i.e., the sum of the membership values of A. Note that (%= A B ) = 1 for A = B and = 0 for A n B = 8. For the values of student. weight, Yamada-Taro is {0.5/70, 1/80,1/90}, Tanaka-Hanako is light in the class female and Suzuki-lchiro is light in the class male. We have their matching degrees as follows:

While Tanaka-Hanako belongs to the class female and a fuzzy predicate tall in the class female is applied to her as follows:

Suzuki : (tall 165) = (S 165 160 170) = 0.5


Although Tanaka-Hanako is shorter than Suzuki-lchiro, she is included in the result but not Suzuki-Ichiro. Note that when the result is a fuzzy set, the order of membership value/elements pairs is alphabetical of their elements. We have a good notation (so called, syntax sugar) like (height = young) for (young height) only for fuzzy predicates.

Yamada : 1{0.5/70}1 f ~{1/70,1/80,1/90}~ == 0.5 i3 = 0.167 Tanaka : 1{0/70}( i I{ 1/40,1/45,0.5/50,1/70}~ == 0 -+ 3.5 = 0 Suzuki : I{0/70}I i
~{1/50,1/55,0.5/60,1/70}~
==

Example 4. (retrieval with fuzzy predicate


No.2) Retrieve names of students whose ages are young.
> (select h a m e
from student where (young age)) ((0.3/0,l/l)/suzuki-ichiro, (0.5/0.4,1/0.5,0.5/0.6)/tanaka-hanako, 0.5/yamada-taro)

0 +35 =0 .

Note that symbols are output in lower case letters even if we input them in capitalized string.

Example 3. (retrieval with fuzzy predicate No.1) Retrieve names of students whose heights are tall. > (select %name
from student where (tall height)) IO. 5/tanaka-hanako, 0.333/yamada-taro}

The attribute values of the instances YamadaTaro and Sumki-lchiro are 175 and 170, respectively. Since they belong to the class male, the fuzzy predicate tall in male is applied to their heights. The truth values of the male's predicate tall is (s z 170 185),where a function (z x a b) is a linear-shaped S function defined as 0 for z < a, 1 - (z - U ) / @ - U ) for a 5 z < b and 1 for b 5 z. Thus, we have their degrees of tall as follows:

In this example, a fuzzy predicate young is defined in the class human whose truth value is (z x 20 30), where (z z a b) is a linear-shaped Z function defined as 1 for x < a, (z - a ) / ( b- a) z < b and 0 for b 5 2. Since the age of for a Yumada-Taro is 25, his degree of young is 0.5.In the other hand, since the age of Tanaka-Hanako is {0.5/24, 1/25, 0.5/26}, we have the degree of young for her computed using the extension principle for 1-variate functions proposed by Zadeh [8] as follows:

<

(young {0.5/24,1/25,0.5/26}) = {0.5/(young 24),l/(young 25), 0.5/(young 26)) = {0.5/0.6,1/0.5,0.4/0.5}


The age for Suxuki-lchiro is defined in the human as a term young={l/O, 1/10, 0.5/20, 0.3/30} not as a predicate and the degree of young is computed using a predicate young=(z z 20 30) in the human.

Suxuki : (tall 175) = (S 175 170 185) = 0.333 Yamada : (tall 170) '= (S 170 170 185) = 0

1347

Authorized licensed use limited to: Jaypee Institute of Technology. Downloaded on September 8, 2009 at 19:10 from IEEE Xplore. Restrictions apply.

Thus we have the followings:

(young Young) = (young { l / O , 1/10,0.5/20,0.3/30})


= { l / ( y o u n g o>,l/(Yo.tlng l o ) ,

0.5/(young 20), 0.3/(youAg 3 0 ) ) = {1/1,1/1,0.5/1,0.3/0} ={l/l, 0.3/0}

Example 5 . (making a new class) Retrieve heavy persons and make a class of heavy persons.
> (xdef-rclass
heavy-person (select from human where (heavy weight))) heavy-person

> (select %name


from heavy-person) ({0.5/0.5,1/0.9)/yamada-taro)

an instance of the class C through inheritance i degrees iij and wk is a value of the attribute ak with the certainty factor cfk. First, the degree I; with which the instance Oi belongs to the class Ci through the inheritance degrees i i j is computed by the function f~ bound in the global variable func-inherit$. Second, the total degree Itotd of the inheritances is computed from I1, 1 2 , ..., I, by a function f 2 bound in *func-inherit-for-select*. Third, the total certainty factor cftotal is computed from certainty factors cfi, cf2, - - -,cfm for the attributes a l , a2, . . ., a m in the predicate pred by a function f3 bound in *finecf-for-select*. Forth, the degree T~ with which attributes values VI, 212, . . ., v satisfy the predicate , pred. Finally, the degree ptotal the result is comof puted from Ittotal, cftotal and T~ by a function f4 bound in *func-grade-inherit-cf*. These default functions are min.

We retrieve persons whose weights are heavy with the select and define a class heavy-person, where the degree of heavy for weight becomes a degree of inheritance. Now we have a class heawy-person and we can use it in queries. For example, a query retrieve tall person in heavy-person is as follows:
>(select %name from heavy-person where ( t a l l height)) CO. 333/yamada-taro)

5. Conclusion
We have designed and implemented an SQLtype data manipulation language for fuzzy objectoriented databases. The future problems include retrieval of classes and fuzzy integrity.

References
W. Kim and F.H. Lochovsky (1989) : ObjectOriented Concepts, Databases, and Applications, ACM Press (New York, New York, US-

4. Execution Process for Select State-

A).
M. Umano and S. Miyamoto (1993) : Recent Development of Fuzzy Database Systems and Applications, Fifth International Fuzzy Systems Association World Congress, pp.537540.

ment
As illustrated in the examples in the previous section, we must consider three degrees in the execution process for a select statement, that is, ( 1 ) degrees with which instances belong to the specified class, (2) certainty factors in the specified attributes in the instances in the specified classes and ( 3 ) degrees with which the instances satisfy the condition. More specifically, consider that (select from C C2 . . . C, where ( p e d a1 a2 . . . a,)). Its ex1 ecution process is shown in Fig. 2, where Oi is

R. George, B.P. Buckles and P.E. Petry (1993)


: Modelling Class Hierarchies in the Fuzzy

Object-Oriented Data Model, Fuzzy Sets and Systems, Vo1.60, pp.259-272. M. Umano, T. Imada, I. Hatono and H. Tamura (1995) : Implementation of a

1348

Fig. 2. Computing Process for Query

Fuzzy Object-Oriented Database, Sixth International Fuzzy Systems Association World Congress, pp.40 1-404. [5] R. de Caluwe (1997) (ed.) : Fuzzy and Uncertain Object- Oriented Models-Concepts and Models, World Scientific (Singapore).

[7] C.J. Date and H. Darwen (1993) : A Guide to the SQL Standard (3rd Edition), AddisonWesley (Reading, Massachusetts, USA).
[8] L.A. Zadeh (1975) : The Concept of a Linguistic Variable and Its Application to Approximate Reasoning, Information Sciences, V0l.8, pp.199-248; Vo1.8, pp.301-357; Vo1.9,

[6] G.M. Show and S.B. Zdonik (1990)

pp.43-80.

Query Algebra for Object-Oriented Databases, I E E E International Conference on Data Engineering, pp. 154-162.

1349

Authorized licensed use limited to: Jaypee Institute of Technology. Downloaded on September 8, 2009 at 19:10 from IEEE Xplore. Restrictions apply.

Potrebbero piacerti anche