Semantic Modeling of Object Oriented Databases
Total Page:16
File Type:pdf, Size:1020Kb
Semantic Modeling of Object Oriented Databases Mokrane Bouzeghoub, Elisabeth Mttais Laboratoire MAX, Universite P. et M. Curie - CNRS, Centre de Versailles 45, avenue des Etats-Unis 78000 Versailles, France Email: [email protected] Abstract: can easily be specified. Class hierarchies and inheritance are generally defined in the same way. The dynamic aspect can be This paper describes a design methodology for fulfilled by introducing the concept of behavior in the an object oriented database, based on a semantic semantic data models. In some sense, this was already done in network. This approach is based on the the AI domain by the concept of script which has been assumption that Yemantic data models are more developped ‘to enhance the expressive power of semantic powerful and more easy to use than current networks and frames. We follow the same approach and proposed object oriented data models. They are describe the behavior of a semantic data model by means of especially more poweful in representing production rules. This kind of a declarative language permits integrity constraints and various relationships, to avoid the complexily of procedural languages which arc Object oriented data models are generally based gcncrally used in objccl oriented data models. The behavior of only on class hierarchies and inheritance, plus each object in the semantic data model will be described by one or several rules expressing either integrity constraints or their ability to represent the behavior of objects, any management rules concerning objects. But this latter capability is generally provided through an algorithmic language which cannot This paper highlights on one hand the object-oriented be considered as a conceptual language. This databasedesign methodology we have developped, and on the paper describes a design procedure which olher hand the design tool which supports this methodology. generates an object oriented database schema This methodology is baseci on two design levels: a Semantic (both the structural aspect and the dynamic qbicct oriented level and an eperatio&lect oriented 1e el (Figure 1). The process of interactive acquisiG& aspect) from an abstract specification giveri in a completeness and consistency checkings of the behavioural high level language. This specification language rules is particularly emphasized in the first level. At the is built upon a semantic network and allows to second level, we use as an operational object oriented data define integrity constraints and behavior rules. model, called 02 model, which was developed by Alta’ir This approach is presented through a CASE project [ Bancilhon 871. Then a mapping process between the tool environment. two models is proposed. Besides the data structure mappings, the transformation of a semantic object oriented schema into 1. Introduction an operational object oriented schema consists, among others, in the generation of procedural methods (C written) from a Like relational databases, the design of an object oriented declarative language specification (production rules). database is a complex art which needs many expertise in the domain. The simultaneous modeling of the structural aspect 1 CONCEPTUAL LEVEL! and the behaviouralaspect of objectsincreases the complexity of the design. The current object oriented data models are mainly defmed by a few basic constructors (like the tuple constructor and the set constructor) and a taxonomy of objects + productlon rules (i.e. hierarchy of classes and inheritance). The power of object oriented data models is highlighted by their ability to describe the dynamic behavior of the objects (methods). However, as generally proposed in the object oriented database systems, this dynamic description is made in a procedural language; this fact makes the specification of the methods too difficult at the conceptual level. Another weakness of current object oriented data models is that, except through methods, they do not easily permit to specify integrity constraints on the objects. Except for the dynamic aspect, the expressive power of semantic data models is stronger than that of object-oriented data models. Various relationships and integrity constraints 0 level v Barcelona, September, 1991 Proceedings df the 17th International 3 Conference on Very Large Data Bases The second section of this paper will give an overview of o(Y,X), i(Y,X), s(Y,X)). To simplify the graphical the two data models used. Section 3 describes the general representation, we use only one specification which mapping process from the semantic network to the object subsumes the other (for example p, o, c and g) except if oriented model 02. This mapping process is only concerned constraint specification is needed for each specific arc. with the structural aspect and with some static integrity constraints. Section 4 describes the mapping of general integrity constraints (Fist order formulas) and behavioural rules (production rules) to the operational level expressed in C language. Roblems of method definition and attachment are also addressed in this section. Section 5 gives a general flavour of the modelling prototype which was designed. Section 6 concludes on the obtained results and the remaining problems to solve. 2. The Hierarchy of Data Models Used This section gives a general overview of the two data models considered in the methodology. The first one is a generic semantic network called Morse. The second one is an object oriented data model called 02. 2.1. The Semantic Network Model Whght A semantic network is an oriented diagram where the nodes represent real world objects and the arcs represent semantic The inheritance is one of the interesting properties of relationships between these objects. In addition, constraints generalization hierarchies; each atomic or molecular can be defined over these nodes and arcs. In the following, component of an object X can be transfered by inheritance to such a semantic network data model is designated by the name objects X1 . ..Xn. if these latters are sub-classes of X. Morse [Bouzeghoub 841. This model is formalized in such a Inversely, each instance of a sub-class is an instance of its way it can represent the most important concepts used in super-classes. We say that components of objects propagate semantic data models. The objective of this formal definition toward the leaves of the hierarchy whereas the instances is to provide a general framework whithin which a CASE tool propagate toward the root(s) of the hierarchy. could be specified and programmed. The external vision of the model could be any desired diagram (e.g. Entity-Relationship) Different integrity constraints can be specified in a Morse or abstract syntaxe. semantic network to enhance its capability to capture more meaning from the real world. Among these constraints, we An object is a generic term to designate the different real can mention domains, cardinalities, functional dependencies, world individuals refered to in Morse schemas.We distinguish keys, intersection and disjunction of classes, etc. In the four categories of objects: in one hand instances of atomic semantic network, some of these constraints are defined over objects (IA) and instances of molecular objects (IM), in the nodes, others are defined over arcs. The constraints are other hand classes of atomic objects (NA) and classes of specified either as a complementary information of binary arcs molecular objects (NM). Then, in the following, we use the or as new predicates. For example, cardinal@ constraints are term object in a generic way, and whenever necessary, we use expressed as complementary information over a/p arcs and r/o the more specific term. arcs, while other constraints like functional dependencies are The distinction between atomic objects and molecular representedby a new fd arc: objects permits to highlight their structural links for a better specification of the corresponding constraints. Atomic objects a(Number,VEHICLE, [l,l] ), have values taken from basic domain such as: integer, real, p(VEHICLE,Number, [l,ll), boolean and string. The set of all atomic values in all domains are refered to by the name VA. Molecular objects a(Type,VEHICLE, [l,N]), have molecular values which are composed from the p(VEHICLE, Type, [I,11 ), corresponding atomic objects which constitute the molecular object. Both atomic objects and molecular objects have unique a(Power,VEHICLE, [O,N]), identifiers which are independant of their values. p(VEHICLE,Power, [l,l]), Semantic links are basic binary relationships between the r(VEHICLE,CONTRACT,[l,l)), different categories of objects mentioned above. These binary o(CONTRACT,VEHICLE,[l,N]), relationships formalize the well-known concepts of aggregation and generalization [Smith 771. Specific r(PERSON,CONTRACT,[l,N]), refinements of these concepts are introduced to take into o(CONTRACT,PERSON,[l,l]). account the distinction between atomic objects and molecular objects. The aggregation concept is refined as aromic fd(VEHICLE,lhs(Type),rhs(Power)) aggregation (arc a(X,Y)) and molecular aggregation (arc r(X,Y)). Generalization is refiied as instance generalisation Graphically, a given semantic network can be represented as (arc c(X,Y)) and class generalizafion (arc g(X,l’)). Each portrayed in figure 2. binary relationship has its reverse link (respectively p(Y,X), Proceedings of the 17th International 4 Barcelona, September, 1991 Conference on Very Large Data Bases 2.2. The ObJect Orlented Data Model type tuple(name:string,age:integer, address:string,children:set(Person)) The 02 data model belongs to the category of the so-called add cla88 Agent inharite Person object oriented data models [Lecluse 871. Then, its basic type tupl*(code:string,salary:integer) concepts are objects and types, type constructors and type hierarchies. The data manipulation language could be the C /* method declaration */ language with embedded 02 expressions (called C02) [Haux method category: 8tring i8 public 881 or an SQL like declarative query language (called LOOQ). body category:string in cla88 PgentC02 In the 02 data model, an object is composed of an /* method procedure */ identifier (the name of the object) and a value.