Making Object-Oriented Databases More Knowledgeable (From ADAM to ABEL)
Total Page:16
File Type:pdf, Size:1020Kb
Making object-oriented databases more knowledgeable (From ADAM to ABEL) A thesis presented for the degree of Doctor of Philosophy at the University of Aberdeen Oscar Diaz Garcia Licenciado en Informatica (Basque Country University) 1992 Declaration This thesis has been composed by myself, it has not been accepted in any previous ap plication for a degree, the work of which it is a record has been done by myself and all quotations have been distinguished by quotations marks and the sources of information specially acknowledged. Oscar Dfaz Garcia 28 October 1991 Department of Computing Science University of Aberdeen Kings College Aberdeen, Scotland Acknowledgements I would like to thank my supervisors Prof. Peter Gray at the University of Aberdeen and Dr. Arantza Illarramendi at the Basque Country University for their advice and guidance during the past three years. The work described in this thesis has benefited from many discussions with colleagues in Aberdeen and San Sebastian. This is the part of the thesis where I would have most liked to use my mother tongue to thank in a more friendly and warm way all of the people which help me during these years. But, do not worry, reader, you will not have to put up with a sentimental and trying piece of Spanish prose! First of all, I am greatly indebted with Norman Paton, the author of ADAM, whose encouragement, patience and generosity has been invaluable throughout. I would like also to thank Jose Miguel Blanco, for his friendship and lively discussions, hardly about Computer Science but about much more interesting subjects. Particular thanks have also to be given to Suzanne Embury for her patience in correcting my clumsy English and for her help in implementing some parts of ABEL. I have also had useful discussions with Graham Kemp and Zhuoan Jiao with whom I kept up a friendly and enlightening rivalry between P/FDM and ADAM. My gratitude to Javier Torrealdea whose encouragement and help in coping with administrative tasks made it possible for me to stay in Aberdeen. I would like also to thank Ian Kirby for his help with LaTeX, and Jorg Forster and Ines Arana for arranging things for me when I was away. I would like to thank the computer officers Chris Cotton, Steve Trythall, Andrew Mellanby and Nick Murray in Aberdeen and Blanca Martinez and Liborio Revilla in San Sebastian. Finally, I would like to thank Ana for not letting me work most of the week-ends, and my parents for their support throughout. This work was supported by a F.P.I grant from the Spanish Government. Summ ary The salient points of this thesis are as follows: • Object-Oriented Databases can help in solving the impedance mismatch problem by introducing methods. However, methods have sometimes been overused in the sense that the code encapsulated refers not only to how the operation is imple mented but also to other kinds of knowledge that are implicit in the code. The disadvantages of this approach for modelling integrity constraints, user-defined re lationships and active behaviour are pointed out. • The ADAM Object-Oriented Database has been extended to allow the designer to specify integrity constraints declaratively. A constraint equation approach is implemented that supports the inheritance of constraints. • A need for semantic-rich user-defined relationships has been identified. In this the sis, relationships are represented as objects. An approach to enhance the semantics of relationships in both its structural and behavioural aspects is presented. The most novel idea of the approach presented is the support of the inferred properties and the operational semantics of relationships. • Active Databases have recently become an important area of research. This thesis shows how to extend an Object-Oriented Database with active capabilities. The principal contribution lies in representing as ‘first-class’ objects not only the active rules but also the rule manager itself. Hence, besides handling active rules as any other object in the system, future requirements can be supported just by specialising the current rule manager. • Active rules have been proposed for several purposes. Several examples, are given of the direct use of rules. However, higher level tools can be provided of which rules ACKNOWLEDGEMENTS iv are simple a vehicle for implementation. This is shown by generating rules from the declarative specification of integrity constraints and it has also been applied to generate rules for enforcing the operational semantics of relationships. • Metaclasses are a valuable mechanism for enhancing the uniformity, accessibility and extensibility of the system. This is demonstrated by showing how ADAM has been extended with integrity constraints, semantic-rich user-defined relationships and active behaviour. Contents 1 Introduction 1 1.1 Purpose of the thesis: Motivations and Contributions .................................... 1 1.2 Context: From Data Bases to Knowledge Bases .............................................. 2 1.3 Meta-knowledge .................................................................................................. 5 1.4 Integrity C onstraints ............................................................................................. 6 1.5 User-defined relationships .................................................................................. 8 1.6 Active b eh a v io u r .................................................................................................. 9 1.7 Overview of the th e s is ......................................................................................... 10 2 The Object Oriented Paradigm 12 2.1 Introduction ..................................................................................... 12 2.2 Class-based s y s te m s ............................................................................................ 14 2.3 Semantic Data M odels ......................................................................................... 18 2.4 Frame-based system s ............................................................................................ 22 2.5 Terminological system s ......................................................................................... 26 2.6 Actor-based sy s te m s ............................................................................................ 32 2.7 C onclusions ............................................................................................................ 34 3 Object Oriented Databases 37 3.1 Introduction ............................................................................................................ 37 3.2 Object orientation in databases ......................................................................... 39 v CONTENTS vi 3.3 ADAM: an object-oriented database in Prolog .................................. 46 3.4 C onclusions ........................................................................................................... 52 4 Making metadata explicit 54 4.1 Introduction ............................................................................................................ 54 4.2 Metaclasses in Object Oriented Programming Languages ......................... 56 4.2.1 SMALLTALK............................................................................................ 56 4.2.2 L O O P S ...................................................................................................... 58 4.2.3 ObjVlisp ................................................................................................... 59 4.3 Metaclasses in A D A M ........................................................................................ 61 4.4 Achieving extensibility using metaclasses ........................................................ 64 4.5 Achieving accessibility using m etaclasses ........................................................ 67 4.6 Some drawbacks with metaclasses ..................................................................... 70 4.7 Conclusions ........................................................................................................... 72 5 Making integrity constraints explicit 73 5.1 Introduction ........................................................................................................... 73 5.2 Related w o r k ........................................................................................................ 75 5.3 Constraint eq u atio n s ............................................................................................ 80 5.4 Horn rule representation for constraint e q u atio n s ......................................... 82 5.5 Inheritance of c o n s tra in ts .................................................................................. 86 5.6 Extending ADAM to support constraint definition ...................................... 87 5.7 C onclusions ............................................................................................................ 90 6 Making userrdefined relationships explicit 92 6.1 Introduction ............................................................................................................ 92 6.2 Relationships in SDM’s, 0 0 systems and AI ................................................. 94 6.3 Semantic-rich User-defined Relationships ......................................................... 97 6.3.1 Operational Semantics for relatio n sh ip s ................................................100 CONTENTS vii 6.4 A description language for relationships