A Z Approach in Validating ORA-SS Data Models Scott Uk-Jin Lee Jing Sun Gillian Dobbie Yuan Fang Li.

Slides:



Advertisements
Similar presentations
Chapter 6: Entity-Relationship Model (part I)
Advertisements

Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Systems Development Life Cycle
Text-Book Chapters (7 and 8) Entity-Relationship Model
Modeling the Data: Conceptual and Logical Data Modeling
Chapter 6 Methodology Logical Database Design for the Relational Model Transparencies © Pearson Education Limited 1995, 2005.
System Analysis - Data Modeling
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Lecture Eleven Entity-Relationship Modelling
Modeling Data The Entity Relationship Model (ER) For Database Design.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
Modeling & Designing the Database
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
Powerpoint 2006 PRESENTATION The University of Auckland New Zealand Marsden Fund A PVS Approach to Verifying ORA-SS Data Models Scott Uk-Jin Lee 1, Gillian.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Entity-Relationship modeling Transparencies
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Data Modeling Using the Entity-Relationship Model
Computer System Analysis Chapter 10 Structuring System Requirements: Conceptual Data Modeling Dr. Sana’a Wafa Al-Sayegh 1 st quadmaster University of Palestine.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Software School of Hunan University Database Systems Design Part III Section 5 Design Methodology.
Chapter 5 Entity–Relationship Modeling
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Conceptual Data Modeling. What Is a Conceptual Data Model? A detailed model that shows the overall structure of organizational data A detailed model.
Team Dosen UMN Database Design Connolly Book Chapter
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Entity-Relationship Modeling Based on Chapter 12.
7-1 © Prentice Hall, 2007 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-1 David M. Kroenke’s, 10 th ed. Chapter.
7-1 © Prentice Hall, 2007 Week 5: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
1 Chapter 11 Entity-Relationship Modeling Transparencies Last Updated: 25 April 2011 By M. Arief
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Entity-Relationship Model Using High-Level Conceptual Data Models for Database Design Entity Types, Sets, Attributes and Keys Relationship Types, Sets,
Chapter 11 & 12 Entity-Relationship (E-R) Model Characteristics of E-R Model Components of E-R Model Example of E-R Model Enhanced E-R Model.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
© D. Wong Ch. 2 Entity-Relationship Data Model (continue)  Data models  Entity-Relationship diagrams  Design Principles  Modeling of constraints.
1 Entity-Relationship Model © Pearson Education Limited 1995, 2005.
Databases Illuminated Chapter 3 The Entity Relationship Model.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
McGraw-Hill/Irwin Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Modeling the Data: Conceptual and Logical Data Modeling.
1 Storing and Maintaining Semistructured Data Efficiently in an Object- Relational Database Mo Yuanying and Ling Tok Wang.
Methodology - Logical Database Design. 2 Step 2 Build and Validate Local Logical Data Model To build a local logical data model from a local conceptual.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Data Modeling Using the Entity- Relationship (ER) Model
COP Introduction to Database Structures
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
Entity-Relationship Model
Chapter 7 Entity-Relationship Model
Entity Relationship Diagrams
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
Review of Week 1 Database DBMS File systems vs. database systems
Chapter 7: Entity-Relationship Model
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
Lecture 10 Structuring System Requirements: Conceptual Data Modeling
Presentation transcript:

A Z Approach in Validating ORA-SS Data Models Scott Uk-Jin Lee Jing Sun Gillian Dobbie Yuan Fang Li

Introduction Semistructured data  Rapid growth in its usage Through World Wide Web, Web Services, other Web-based applications. Due to the introduction of XML and its related technologies.  Requires design of good semistructured data structure Especially if the data is stored in a database.  Requires good schema definition ORA-SS can be used. ORA-SS  Provides schema definition for semistructured data.  Restricted to a diagrammatic notation and semantic written in English.  Requires formal mathematical semantics for wider utilization.

Motivation Benefits of having formal semantics for ORA-SS  Remove ambiguity that may arise from a diagrammatic representation.  Enable the use of ORA-SS in other applications and tools.  Reveal inconsistencies in a design at the schema and instance levels.  Increase quality of the software system through semantics checking.  Improve quality of the software system by providing deep semantic checking for semistructured data used.

ORA-SS Object class  similar to an entity type in an ER diagram, a class in an object- oriented diagram, or an element in an XML document. Relationship type  represents a nesting relationship among object classes.  is represented optionally with a labelled diamond and can be described by name, n, p and c. name : name of relationship type n : integer indicating the degree of relationship type p : participation constraint of parent object class in relationship type c : participation constraint of child object class in relationship type Attribute  represents properties of an object or a property of a relationship.  can be a key attribute which has a unique value. Reference  model recursive and symmetric relationships.  reduce redundancy especially for many-to-many relationships.  represent disjunction of objects and attributes. Object Relationship name object name, n, p, c object name

ORA-SS Example The diagram presents an ORA-SS schema that represents the structure of a particular semistructured data. The schema should consists of followings:  relationship between the ‘course’ object class and the ‘student’ object class with a single-valued attribute ‘mark’.  object class ‘course’ with an identifier ‘code’, a single-valued attribute ‘title’ and multi-valued attribute ‘ANY’.  object class ‘student’ with an identifier ‘ID number’ and single valued attributes ‘name’ and ‘ ’. The schema diagram is syntactically correct but there are three semantic errors  The degree of relationship ‘cs’ is 3, representing a ternary relationship where it actually is a binary relationship since object ‘course’ is not related to any other objects besides ‘students’.  Having two primary keys for the object class ‘student’. There are two attributes selected as primary key where there should only be one primary key for each object class.  the primary key ‘ID number’ is represented as an attribute of the relationship ‘cs’ where it really is an attribute of an object ‘student’. A validation process is required to pick up this kind of errors in the design process

Z & Z/EVES Z  formal specification language  developed at the Programming Research Group at Oxford University.  based on set theory and first-order predicate logic.  declarative language with number of language constructs including given type, abbreviation type, axiomatic definition, state and operation schema definitions.  widely used for providing formal semantics and verifications in various application domains. Z/EVES  an interactive system for composing, checking, and analyzing Z specifications.  supports general theorem proving of Z specifications.

Formal Semantics of ORA-SS (Basic Type & Relationship Type) Basic Types  Basic types used in the ORA-SS data modeling language has been identified and defined prior to constructing the formal representation.  The object types and attribute types defined above represent the set of object classes, object instances, attributes and attribute values respectively in the ORA-SS language. Relationship Type  Relationship Type in ORA-SS data modeling language has been defined as a function with a set of object classes as its domain and a sequence of set of object classes as its range.  The predicate of the function uses a recursive definition and describes that object classes can be related to other object classes as well as to other relationships.

Formal Semantics of ORA-SS (Relationship Type)  The definition includes two types of relationship in an ORA-SS schema diagram. a normal relationship where the child participant is a single object class. a disjunctive relationship where the child participant is a set of disjunctive object classes.  The first predicate of the function prevents cyclic definitions in the relationship structure.  The second predicate allows the represention of a binary relationship as well as a relationship of degree 3 or more.

Formal Semantics of ORA-SS (Degree of a Relationship Type) Every relationship in an ORA-SS schema diagram has its associated degree represented as a natural number. The above definition represents degree as a function where the first argument represents the relationship and the second argument represents the natural number which refers to the value of the degree of the relationship. The predicate of the function defines that the degree of any relationship is the number of object classes involved in the relationship.

Formal Semantics of ORA-SS (Instances of Object Classes & Attribute) In the ORA-SS data model, an object class has instances which are objects. The above definition defines object classes having instances as a function where the first argument represents an object class and the second argument represents a set of objects which refers to all the instances of the object class. The predicate of the function specifies that an object cannot be an instance of multiple object classes. The Instances of attribute has been defined similarly, as an object class has instances, attributes also have values.

Formal Semantics of ORA-SS (Instances of a Relationship Type) Relationship type also has its instances which represents the participation instances from their corresponding object classes in the relationship.

Formal Semantics of ORA-SS (Instances of a Relationship Type) The relationship instance definitionis defined as a function where the first argument represents a relationship and the second argument represents the instance of the relationship. An instance of the relationship is represented as an object related to a sequence of objects that conforms to the relationship definition. The first predicate of the function defines that the degree of a relationship instance should be the same as the degree of the relationship type. The second predicate defines that child object instance should be an instance of the associated selected child object classes in the relationship. This predicate also defines that only the objects of a single object class is related to a parent object or sub-relationship instance in the case of a disjunctive relationship. The third predicate consists of two cases  If the degree of the relationship is binary, the parent object instance should be an instance of the parent object class.  If the degree of the relationship is ternary or more, the second part of the predicate recursively defines that the sub-relationship instance sequence is an instance of the sub- relationship type. The last predicate defines that any two relationship types should have their own disjoint set of instances. This specifies that a relationship instance cannot be an instance of multiple relationship types.

Formal Semantics of ORA-SS (Participation Constraints on Object in a Relationship Type) Every relationship type in an ORA-SS schema diagram has its associated constraints on its participating objects which is represented by the ‘min:max’ notation. It constrains the number of child objects that a parent object can relate to and vice versa.

Formal Semantics of ORA-SS (Participation Constraints on Object in a Relationship Type) The participation constraints on object in a relationship type is defined as a function where the first argument represents a relationship and the second argument represents a cartesian product of multiplicity which refers to a ‘min:max’ pair. The predicate of the function defines that the number of relationship instances in which each object of the parent object class or each relationship instance of the sub-relationship type should be within the multiplicities defined in the relationship. It specifies that the parent constraint sets the boundaries for the number of child objects that a single parent object or sub-relationship instance can have. The child constraints of the relationship has been defined in a similar way.

Formal Semantics of ORA-SS (Candidate Key of an Object Class) An object can have an attribute or set of attributes that have a unique value for each instance of an object class called a candidate key.  a candidate key is a single attribute with unique value.  a composite candidate key is a set of attributes with a unique combined value.

Formal Semantics of ORA-SS (Candidate Key and Primary Key of an Object Class) The candidate key is defines as a relationship where object classes are related to the set of attributes which refer to all the candidate keys that belong to the object. The first predicate of the function defines that candidate keys belong to the set of attributes that the object has. The second predicate of the function defines two facts.  two objects are different when values of the candidate key for each object are different.  two objects are the same when values of the candidate key for each object are the same. The predicate also specifies that the value of candidate key for each object of an object class should uniquely identify an object instance. Primary key has been defined as a total function with the same arguments as the candidate key definition and its predicate specifies that primary key is selected from a set of a candidate key.

Formal Semantics of ORA-SS (Other definitions) Object class, attribute pair and their instances  Definition of object class and attribute pair is defined as a simple total function similar to primary key definition but with no predicates.  Definition of instance of object class and attribute pair has been defined similar to the instance of a relationship. Cardinality of attribute values associated with an object  Definition of cardinality for attribute values associated with an object is defined similar to the participation constraints in relationship type.

Validation (Schema Diagram) Guideline for validating an ORA-SS schema diagram  In a relationship type, the child object class must be either related to an other parent object class to form a binary relationship or related to another sub- relationship type to form a relationship type of degree 3 or more.  The degree of a binary relationship is 2, ternary is 3 and n-nary is n.  In a disjunctive relationship type, the child participants is a set of disjunctive object classes.  A composite attribute or disjunctive attribute has an attribute that is related to two or more sub-attributes.  A candidate key of an object class is selected from the set of attributes of the object class.  A composite key is selected from 2 or more attributes of an object class.  There can only be one primary key per object class and it can be either a candidate key or a composite candidate key.  Relationship attributes have to relate to an existing relationship.  An object class can reference one object class only, but an object class can be referenced by multiple object classes.

Validation (Schema Diagram) Most of the guidelines have been encoded into Z semantics of ORA-SS  When a schema diagram is represented in Z, it can be validated of its correctness against the ORA-SS Z semantic The validation proves that the definition of degree cs = 3 is invalid. Previous ORA-SS schema diagram example represented in Z Validating the degree of ‘cs’ relationship

Validation (XML) Guideline for validating an XML instance  Relationship instances must conform to the participation constraints.  In a disjunctive relationship, only one object class can be selected from the disjunctive object class set and associated to a particular parent instance.  For a candidate key (single or composite), its value should uniquely identify the object that this key attribute belongs to.  Each object can have one and only one primary key.  All attributes have their own cardinality and the number of attributes that belong to an object should be limited by the minimum and maximum cardinality values of the attribute.  For a set of disjunctive attributes, only one of the attribute choices can be selected and associated to an object instance. Validation of a given XML instance following the guideline can be achieved by checking its consistency of the content in the document against its ORA- SS schema definitions.

Validation (XML) Validating parent participation constraints of the relationship type cs The validation shows that ‘Course8’ and ‘Course9’ does not satisfy the parent participation constraint of a minimum of 4 students per course. Similarly, we can check the child participation constraint of the relationship `cs'. XML document conforming to the corrected ORA-SS schema example

Conclusion Contribution of this work  Definition of a formal mathematical semantics for the ORA-SS diagrammatic data modeling notation. It provides a rigorous formal foundation for the ORA-SS language. It can be adopted by many semistructured data applications which use the ORA-SS data model.  Definition of some guidelines for validating the ORA-SS data models at both the schema diagram level and the XML instance level. These can be used as a template for the applications that implement the validation algorithm of ORA-SS semistructured data.  Demonstration of some reasoning steps using the Z ORA-SS semantics in validating customized ORA-SS schema diagrams and XML instances. Proof steps are presented through a simple ORA-SS data model. More complicated proofs can also be constructed for validating large semistructured documents.

Conclusion Future Work  Extending and concentrating the work on the automatic validation of semistructured data in Z.  Developing a translation program that automatically transforms an XML instance into its corresponding Z ORA-SS instance representation for machine validation.  Extending the current Z semantics of the ORA-SS language to model the normalization problems in semistructured data design.