An Extension of the Relational Data Model to Incorporate Ordered Domains
Total Page:16
File Type:pdf, Size:1020Kb
An Extension of the Relational Data Model to Incorporate Ordered Domains Wilfred Siu Hung Ng A dissertation submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy o f th e University of London Department of Computer Science University College London 1, July 1997 ProQuest Number: 10055432 All rights reserved INFORMATION TO ALL USERS The quality of this reproduction is dependent upon the quality of the copy submitted. In the unlikely event that the author did not send a complete manuscript and there are missing pages, these will be noted. Also, if material had to be removed, a note will indicate the deletion. uest. ProQuest 10055432 Published by ProQuest LLC(2016). Copyright of the Dissertation is held by the Author. All rights reserved. This work is protected against unauthorized copying under Title 17, United States Code. Microform Edition © ProQuest LLC. ProQuest LLC 789 East Eisenhower Parkway P.O. Box 1346 Ann Arbor, Ml 48106-1346 Abstract In this thesis, we extend the relational data model to incorporate partial orderings into data domains and present a comprehensive formalisation of the extended model. The main contributions of the thesis are that we show how and why such an extension can considerably improve the capabilities of capturing semantics in a wide spectrum of advanced applications such as tree-structured information, temporal information, in complete information, fuzzy information and spatial information, whilst preserving the elegance of the theoretical basis of the model. Within the extended model, we extend the relational algebra to the Partially Or dered Relational Algebra (FORA) and the relational calculus to the Partially Ordered Relational Calculus (PORC), respectively. These two languages are shown to be equiv alent. We then apply a generalized form of Paredaens’ and Bancilhon’s Theorem to justify our claim that the PORA is adequately expressive, i.e., non-uniformly complete. We also show that there is a one-to-one correspondence between three hierarchies of: computable queries, ordered domains and PORAs, according to the inherent structures of the underlying domains. Moreover, we formally define Ordered Functional Dependencies (OFDs) and Ordered INclusion Dependencies (OINDs) for the extended model. We then present a sound and complete axiom system for OFDs and OINDs in the case of pointwise linear orderings. In addition, we establish a set of sound and complete chase rules for OFDs in the case of lexicographical linear orderings. We extend SQL to OSQL as a query language for ordered databases. OSQL provides users with the capability to define partial orderings over data domains. In order to demonstrate the feasibility of OSQL, we have carried out an experimental implementation of the new language using the Oracle DBMS for low level data management. We have evaluated the implementation by conducting a user survey. From the results of the survey, we confirm that the essential features of OSQL which we have designed are easy to learn, understand and apply, and are useful in formulating queries involving order. Furthermore, we demonstrate that a wide range of queries in many advanced applications can be formualted in a unified manner by introducing the notion of an OSQL package. Acknowledgements Thanks to God. He allows me to possess the good health and the sound mind to complete this piece of demanding work. Thanks to my supervisor, Mark Levene. He has given me the full attention and support since I started my Ph.D. programme three years ago. With his valuable advice and guidance on my work, I could carry out my research persistently even in the most difficult time. Also, I wish to express my gratitude to my second supervisor, Graham Roberts. He has given me many useful feedback at different stages. Thanks to a number of people who have provided many helpful comments on individ ual chapters of this thesis. I would like to show my appreciation of their help by stating their names as follows, Ethan Collopy, Janet Mcdonnell, Nadav Zin, Tina Yu, Jonathan Poole, Alberto Souza and Adam Fagin. Thanks to my wife, Marianne. She has never made any complaints with my anti social working style during my thesis writing-up period. Furthermore, she contributed her best possible support and provided encouragement when giving up seems to be the best thing to do. Thanks to the Department of Computer Science and the Graduate School at UCL. They have provided me with financial assistance to attend various workshops/ conferences for presenting my papers. Contents 1 Introduction 11 1.1 Background and Motivation ................................................................................. 11 1.2 Main Goals of the Research and the Thesis Contribution ............................ 16 1.3 Outline of the Thesis .............................................................................................. 17 2 The Ordered Relational Model 25 2.1 The Notion of O rder .............................................................................................. 26 2.1.1 Formal Definition of Partial O rd erin g s .................................................. 26 2.1.2 Extension of Orderings ............................................................................... 27 2.2 Orderings in Databases ....................................................................................... 31 2.3 Orderings and Data Independence .................................................................... 33 2.4 Relationship to the Conventional M odel .......................................................... 36 2.5 Other Related W o r k .............................................................................................. 38 2.5.1 Partial Order D atab ases ............................................................................ 38 2.5.2 Multi-Resolution Data M odel .................................................................. 39 2.5.3 List or Sequenced D a t a ............................................................................ 40 2.5.4 Other Unified M o d e ls ................................................................................ 41 3 Query Languages for the Ordered Relational Model 43 3.1 Query Languages: the PORA and the PO R C ................................................. 45 3.1.1 The PORA: an Algebraic Query Language ........................................ 45 3.1.2 The PORC: a Calculus Query Language ............................................... 52 3.2 Equivalence between the PORA and the PORC ............................................. 56 3.3 Non-Uniform Completeness of the P O R A ....................................................... 62 3.3.1 Order-Preserving Database Automorphisms ........................................ 62 3.3.2 A Generalisation of Paredaens’ and Bancilhon’s T heorem .............. 63 4 3.4 Hierarchy of Computable Queries with Ordered Domains ......................... 66 3.5 Updating Ordered D a ta b a s e s ............................................................................. 71 3.6 D iscussion ................................................................................................................. 76 4 Data Dependencies and Database Design Issues for the Ordered Rela tional Model 78 4.1 Functional Dependencies (FDs) in Ordered D atabases ................................ 81 4.2 Ordered Functional Dependencies (OFDs) ....................................................... 85 4.2.1 OFDs Arising from Pointwise-Orderings ............................................... 86 4.2.2 OFDs Arising from Lexicographical Orderings ..................................... 89 4.3 Ordered Inclusion Dependencies (O IN D s) .......................................................... 100 4.3.1 OINDs Arising from Pointwise-Orderings ...............................................103 4.3.2 OINDs Arising from Lexicographical Orderings ..................................... 104 4.3.3 Interactions between OFDs and O IN D s .................................................. 106 4.4 Database Design Issues with respect to OFDs and OIN D s .............................. 108 4.5 D iscussion ..................................................................................................................... 112 5 An Extension of SQL to the Ordered Relational Model 114 5.1 Comparing OSQL with the SQL Standard .......................................................... 115 5.2 OSQL Specification ....................................................................................................... 118 5.2.1 Data Manipulation L an g u ag e ......................................................................118 5.2.2 Data Definition Language ............................................................................ 120 5.3 Implementation of OSQL ........................................................................................122 5.3.1 The System Architecture ............................................................................ 122 5.3.2 The Implementation M ethod ......................................................................125 5.4 Application Examples of OSQL ..............................................................................127 5.4.1 Tree-Structured Inform ation ......................................................................... 128 5.4.2 Incomplete Information ................................................................................129 5.4.3 Fuzzy Information ..........................................................................................131