Wenyue Du, Mong Li Lee, Tok Wang Ling Department of Computer Science School of Computing National University of Singapore {duwenyue, leeml,

Slides:



Advertisements
Similar presentations
The Entity-Relationship Model
Advertisements

Text-Book Chapters (7 and 8) Entity-Relationship Model
1 Resolving Structural Conflicts in the Integration of XML Schemas: A Semantic Approach Xia Yang Mong Li Lee Tok Wang Ling National University of Singapore.
System Analysis - Data Modeling
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
TU/e eindhoven university of technology / faculty of mathematics and informatics Exporting Databases in XML DTD A Conceptual and Generic Approach Philippe.
The Entity-Relationship (ER) Model CS541 Computer Science Department Rutgers University.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
Murali Mani The Entity- Relationship Model. Murali Mani Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
1 The ORA-SS Approach for Designing Semistructured Databases Xiaoying Wu, Tok Wang Ling, Mong Li Lee National University of Singapore Gillian Dobbie University.
Tok Wang Ling1 Mong Li Lee1 Gillian Dobbie2
Entity Relationship Model Chapter 6. Basic Elements of E-R Model Entity Object of the real world that stores data. Eg. Customer, State, Project, Supplier,
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.
the Entity-Relationship Model
XML-to-Relational Schema Mapping Algorithm ODTDMap Speaker: Artem Chebotko* Wayne State University Joint work with Mustafa Atay,
1 Designing Valid XML Views Ya Bing Chen, Tok Wang Ling, Mong Li Lee Department of Computer Science National University of Singapore.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
1 Maintaining Semantics in the Design of Valid and Reversible SemiStructured Views Yabing Chen, Tok Wang Ling, Mong Li Lee Department of Computer Science.
A Z Approach in Validating ORA-SS Data Models Scott Uk-Jin Lee Jing Sun Gillian Dobbie Yuan Fang Li.
ICS 321 Spring 2011 High Level Database Models Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 2/7/20111Lipyeow.
Christoph F. Eick: Designing E/R Diagrams 1 The Entity-Relationship Model Chapter 3+4.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
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.
Computing & Information Sciences Kansas State University Wednesday, 24 Sep 2008CIS 560: Database System Concepts Lecture 12 of 42 Wednesday, 24 September.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Mapping RDB Schema to.
Computing & Information Sciences Kansas State University Friday, 26 Sep 2008CIS 560: Database System Concepts Lecture 13 of 42 Friday, 26 September 2008.
1 Resolving Schematic Discrepancy in the Integration of Entity-Relationship Schemas Qi He Tok Wang Ling Dept. of Computer Science School of Computing National.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Chapter 4 Extended Entity-Relationship (EER)Model Incorporates Set-subset Relationships Incorporates Generalization Hierarchies Constraints: Coverage Constraints:
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Modeling Your Data Chapter 2 cs5421. Part II Discussion of the Model: Good Design/ Bad Design? cs5422.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
1 Storing and Maintaining Semistructured Data Efficiently in an Object- Relational Database Mo Yuanying and Ling Tok Wang.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
1 CS122A: Introduction to Data Management Lecture #5 (E-R  Relational, Cont.) Instructor: Chen Li.
1 Efficient Processing of Partially Specified Twig Queries Junfeng Zhou Renmin University of China.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Conceptual Modeling for XML Data
Entity Relationship (E-R) Model
Data Modeling Using the Entity- Relationship (ER) Model
COP Introduction to Database Structures
Contents Design Process Modeling Constraints E-R Diagram Design Issues
Business System Development
Relational Database Design by ER- and EER-to- Relational Mapping
Entity-Relationship Model
Chapter 2: Entity-Relationship Model
Chapter 7: Entity-Relationship Model
Chapter 7 Entity-Relationship Model
Relational Database Design by ER- and EERR-to-Relational Mapping
Outline of the ER Model By S.Saha
Chapter (9) ER and EER-to-Relational Mapping, and other Relational Languages Objectives How a relational database schema can be created from a conceptual.
بسم الله الرحمن الرحيم.
Conceptual data modeling
Overview of Entity‐Relationship Model
Module 8 – Database Design Using the E-R Model
The Entity-Relationship Model
Entity Relationship Diagrams
Session 2 Welcome: The seventh learning sequence
The Entity-Relationship Model
Faloutsos - Pavlo C. Faloutsos - A. Pavlo Lecture#2: E-R diagrams
Review of Week 1 Database DBMS File systems vs. database systems
Relational Database Design by ER- and EER-to-Relational Mapping
Relational Database Design by ER- and EER-to- Relational Mapping
Chapter 7: Entity-Relationship Model
Chapter (7) ER-to-Relational Mapping, and other Relational Languages
CS4222 Principles of Database System
Presentation transcript:

Wenyue Du, Mong Li Lee, Tok Wang Ling Department of Computer Science School of Computing National University of Singapore {duwenyue, leeml, XML Structures for Relational Data

2 Contents 1. Introduction –Motivation –Related Works –Our Approach 2. Background –XML –XML DTD –Semantic Enrichment 3. Proposed Relational to XML Translation 4. Comparison 5. Conclusion

3 1. Introduction Outline –Motivation –Related Works –Our Approach

4 Motivation XML is emerging as a standard for information publishing on the World Wide Web. However, the underlying data is often stored in traditional relational databases. Some mechanism is needed to translate the relational data into XML data. Introduction

5 Motivation (cont.) Generates XML structures that are able to describe the semantics and structures in underlying relational databases. Obtains properly structured XML data without unnecessary redundancies and proliferation of disconnected XML elements.Introduction

6 Related Works [1, 5, 6] basically focus on single relation translation. In order to handle a set of related relations, the relations are first denormalized to one single relation. –The flat XML structure does not provide a good way to show the structure of data. –It causes a lot of redundancies.Introduction Relations: Dept(D#, Dname) Employee (E#, Ename, JoinDate, D#) Maps to <!ATTLIST Employee E# CDATA #REQUIRED Ename CDATA #IMPLIED JoinDate CDATA #IMPLIED D# CDATA #REQUIRED DNAME CDATA #IMPLIED >

7 Relations: Dept (D#, Dname) Employee (E#, Ename, JoinDate, D#) Related Works (cont.) [7] developed a method to generate a hierarchical DTD for XML data from a relational schema. –It lacks of semantic enrichment. So it cannot handle more complex situations. Introduction Is it an attribute of object or relationship? <!ATTLIST Employee E# ID #REQUIRED Ename CDATA #IMPLIED JoinDate CDATA #IMPLIED> Maps to

8 Our Approach XML structures for relational data can be obtained by the following steps:Introduction

9 2. Background Outline –XML –XML Schema –Semantic Enrichment

10 XML Basic constructs of XML: –Element –Attribute –Reference (link) : a relationship between resources (e.g. elements). It is specified by attaching specific attributes or sub-elements. Background / XML

11 XML DTD Background / XML DTD XML documentCorresponding DTD J. Tan 36 … <!ELEMENT CUSTOMER (CNAME, AGE)> <!ATTLIST CUSTOMER CID ID #REQUIRED> A Document Type Definition (DTD) describes structure on an XML document.

12 Semantic Enrichment Semantic enrichment is a process that upgrades the semantics of databases, in order to explicitly express semantics that is implicit in the data. Background / Semantic Enrichment Such as various relationship types, cardinality constraints, etc.

13 Extra information needed: Functional Dependencies (FDs) and keys Inclusion dependencies (INDs) e.g. STUDENT (S#, SNAME) HOBBIES(S#, HOBBY) HOBBIES[S#]  STUDENT[S#] Semantic dependencies (SDs) (T.W. Ling & M.L. Lee, 1995) Background / Semantic Enrichment

14 Semantic Dependencies Background / Semantic Enrichment EMPLOYEE(E#, ENAME, JOINDATE, D#) -JOINDATE is functionally dependent on only E# -Assuming JOINDATE refers to the date on which an employee assumes duty with the department. We say that JOINDATE is semantically dependent on {E#, D#}

15 Semantic Enrichment using SD together with FD and IND Background / Semantic Enrichment To obtain: Object relations and object attributes that represent regular and weak entity types, and their properties. Relationship relations and relationship attributes that represent various relationship types such as binary, n-ary, recursive and ISA (inheritance), and their properties. Mix-type relations: We need to split them into object relations and relationship relations Fragments of object relations or relationship relations that represent multi-valued attributes of entity types or relationship types. Cardinality constraints

16 An Original Relational Schema Background / Semantic Enrichment COURSE (CODE, TITLE) DEPT (D#, DNAME) STUDENT (S#, SNAME) TUTORIAL (T#, TUTORIALTITLE) HOBBIES(S#, HOBBY) STUDENTDEPT (S#, D#) C_S (CODE, S#, GRADE) ATTEND (CODE, T#, S#) COURSEMEETING (CODE, S#,MEETINGHISTORY)

17 The Semantically Enriched Schema Background / Semantic Enrichment Object Relations: COURSE (CODE, TITLE) DEPT (D#, DNAME) STUDENT (S#, SNAME) TUTORIAL (T#, TUTORIALTITLE) Fragment of Object Relations HOBBIES(S#, HOBBY) Relationship Relations: STUDENTDEPT (S#, D#) C_S (CODE, S#, GRADE ) ATTEND (CODE, T#, S#) Fragment of Relationship Relations COURSEMEETING (CODE, S#, MEETINGHISTORY ) fragment of C_S

18 3. Proposed Relational to XML Translation Outline –ORA-SS Model –Relational Schema to ORA-SS Translation –ORA-SS to XML Schema Translation

19 ORA-SS Model ORA-SS (Object-Relationship-Attribute model for Semi-Structured data) G. Dobbie, X.Y. Wu, T.W. Ling, M.L. Lee, “ORA-SS: An Object- Relationship-Attribute Model for Semi-structured Data”, TR 21/00, National Univ. of Singapore, 2001 Proposed Relational to XML Translation / ORA-SS

20 Concepts of ORA-SS (cont.) Proposed Relational to XML Translation / ORA-SS Object class Ternary relationship Binary relationship Identifier Reference Relationship attribute

21 Enriched Relational Schema to ORA-SS Schema Translation Objectives: Identify object classes and their attributes from object relations Identify relationship types and their attributes from relationship relations Identify hierarchical structure Generate ORA-SS schema Enriched Relational Schema to ORA-SS Schema Translation

22 Overview of Translation Rules 1. Object relation rules: to translate object relations 2. Relationship relation rules: to translate relationship relations 3. Combination rule: to be applied to the result obtained from the application of object and relationship relation rules, and generate the final ORA-SS schema. Enriched Relational Schema to ORA-SS Schema Translation

23 Rule O1: Mapping object relations Enriched Relational Schema to ORA-SS Schema Translation /Object Relation Translation Rules STUDENT(S#, SNAME) Single-valued attribute Maps to

24 Rule O2: Mapping fragment of object relations STUDENT(S#, SNAME) HOBBIES(S#, HOBBY) Multivalued attribute Maps to Enriched Relational Schema to ORA-SS Schema Translation /Object Relation Translation Rules

25 Rule R1: Mapping 1-m/1-1 relationship relation Objectives: Reduce disconnected elements Use parent-child structure Avoid unnecessary redundancies Use references Example: ADVISOR(STAFF#, POSITION) // object relation STUDENT(S#, SNAME) // object relation STU_ADV(S#, STAFF#) //1-m relationship relation Enriched Relational Schema to ORA-SS Schema Translation /Relationship Relation Translation Rules

26 Rule R1: Mapping 1-m/1-1 relationship relation (cont.) Case 1: All the objects (instances) of STUDENT participate in the relationship type STU_ADV ADVISOR STUDENT STU_ADV Maps to STU_ADV 2,0:n,1:1 Use parent-child structure Enriched Relational Schema to ORA-SS Schema Translation /Relationship Relation Translation Rules

27 Case 2: 1. Not all the objects of STUDENT participate in STU_ADV. 2. STUDENT is already as a child object and all the objects of ADVISOR participate in STU_ADV. Use parent-child structure STUDENT ADVISOR STU_ADV Maps to STU_ADV 2,0:1,1:n Rule R1: Mapping 1-m/1-1 relationship relation (cont.) or Enriched Relational Schema to ORA-SS Schema Translation /Relationship Relation Translation Rules

28 Case 3: There exist objects of STUDENT and ADVISOR do not participate in STU_ADV Rule R1: Mapping 1-m/1-1 relationship relation (cont.) STUDENT ADVISOR1 STU_ADV or Maps to STU_ADV 2,*,? Use reference ADVISOR STUDENT1 STU_ADV 2,*,? STUDENT A_RefS_Ref Enriched Relational Schema to ORA-SS Schema Translation /Relationship Relation Translation Rules

29 Rule R2: Mapping m-n binary relationship relation COURSE(CODE, TITLE) C_S(S#, CODE, GRADE) STUDENT (S#, SNAME) Preferred Mapping Enriched Relational Schema to ORA-SS Schema Translation /Relationship Relation Translation Rules Three ways to map:

30 Other relationship relation rules Fragment of relationship relation is translated similarly to the translation of the fragment of object relation. N-ary relationship relation is translated using reference structures. The level of each referencing object may be determined by the aggregations. If B ISA A, then B is mapped to a child object class (O B ) of O A. Enriched Relational Schema to ORA-SS Schema Translation /Relationship Relation Translation Rules

31 Combination Rule: Example: PERSON(SSNO, RACE) //object relation STUDENT(S#, SSNO, MAJOR) //object relation DEPT(D#, DNAME) //object relation STU_DEPT(S#, D#) //relationship relation Enriched Relational Schema to ORA-SS Schema Translation /Combination Rule STUDENT ISA PERSON and one DEPT has many STUDENT. In this case, STUDENT potentially has multiple parents (i.e., DEPT and PERSON). to be applied to the result obtained from the application of object and relationship relation rules, and generate the final ORA-SS schema.

32 Combination Rule: Current solution: Use references (K. Williams, et al. January 2001) -- It causes too many disconnected elements. <!ELEMENT Results (PERSON*, STUDENTS* DEPT*)> <!ATTLIST PERSON SSNO ID #REQUIRED RACE CDATA #IMPLIED STU_REF1 IDREF #REQUIRED> <!ATTLIST STUDENT S# ID #REQUIRED MAJOR CDATA #IMPLIED > <!ATTLIST DEPT D# ID #REQUIRED DNAME CDATA #IMPLIED STU_REF2 IDREFS #REQUIRED> Enriched Relational Schema to ORA-SS Schema Translation /Combination Rule

33 Combination Rule: (cont.) The priorities of translations (in descending order) 1. ISA, etc. semantic relationship relations and their fragments // high semantic cohesion among these participating object classes and 1-m relationship relation and their fragments // potentially represented as hierarchy (p-c) structure 3. m-1 relationship relations and their fragments // potentially represented as hierarchy structure; preferably view as 1-m 4. m-n, n-ary relationship relations and their fragments This rule is used to avoid or reduce potential multiple parents. Enriched Relational Schema to ORA-SS Schema Translation /Combination Rule Our approach: Translations are produced sequentially according to their priorities. The translation with the lowest priority will be carried out last.

34 Combination Rule: (cont.) S# ID #REQUIRED MAJOR CDATA #IMPLIED > <!ATTLIST DEPT D# ID #REQUIRED DNAME CDATA #IMPLIED D_S_REF IDREFS #REQUIRED> Enriched Relational Schema to ORA-SS Schema Translation /Combination Rule <!ATTLIST PERSON SSNO ID #REQUIRED RACE CDATA #IMPLIED > <!ATTLIST STUDENT We map STUDENT to the child object class of PERSON first. Then map DEPT according to 1-m relationship relation rule. Thus, we may get the following result.

35 A possible ORA-SS Schema diagram derived from university database Enriched Relational Schema to ORA-SS Schema Translation Object Relations: COURSE (CODE, TITLE) DEPT (D#, DNAME) STUDENT (S#, SNAME) TUTORIAL (T#, TUTORIALTITLE) Fragment of Object Relations HOBBIES(S#, HOBBY) Relationship Relations: STUDENTDEPT (S#, D#) C_S (CODE, S#, GRADE) ATTEND (CODE, T#, S#) Fragment of Relationship Relations COURSEMEETING (CODE, S#,MEETINGHISTORY) fragment of C_S

36 Input: an ORA-SS schema diagram SD Output: an XML DTD Begin Start from the top of SD and proceed downward, for each object class O encountered do: Step 1. Sub-object classes of O Step 2. For each attribute A of O Case (1) A is a single valued simple attribute Case (2) A is a single valued composite attribute, replace A with its components and add to Case (3) A is a multivalued simple attribute Case (4) A is a multivalued composite attribute A’s components Step 3. For each relationship attribute A under O, add A to subelementsList in. Case (1) A is a simple attribute. Case (2) A is a composite attribute, A’s components Algorithm: Mapping ORA-SS Schema Diagram to XML DTD

37 Algorithm: Mapping ORA-SS Schema Diagram to XML DTD <!ATTLIST TUTORIAL T# ID #REQUIRED TUTORIAL_TITLE CDATA #IMPLIED> The obtained XML structures (DTD)

4. Comparison Rich structured and represents the real world accurately Yes ( )[7], This paper Partially[3] No[1, 5, 6] The representation of various relationship types and their attributes Yes ( )This paper Partially[7] No[1, 3, 5, 6] Number of disconnected elementsFew ( )[7], This paper ManyNaïve approaches Unnecessary redundanciesAvoidable ( )This paper Partially[3, 7] Many[1, 5, 6]

39 5 Conclusion Method proposed in this paper achieves Generation of semantically sound XML structures for relational data possible Generation of properly structured XML data without unnecessary redundancies and proliferation of disconnected XML elements possible

References [1] S. Banerjee, et al “Oracle 8i – The XML Enabled Data Management System”, Proc. 16th Int’l Conf. on Data Engineering, 2000 [2] G. Dobbie, X.Y. Wu, T.W. Ling, M.L. Lee, “ORA-SS: An Object- Relationship- ttribute Model for Semi-structured Data”, TR 21/00, NUS, 2001 [3] D.W. Lee, M. Mani, F. Chiu, W.W Chu, “Nesting-based Relational-to-XML Schema Translation”, Proc, 4 th Int’l Workshop on Web and Databases, 2001 [4] T.W. Ling, M.L. Lee, “Relational to Entity-Relationship Schema Translation Using Semantic and Inclusion Dependencies”, In Journal of Integrated Computer-Aided Engineering, pages , 1995 [5] SYBASE, “Using XML with the Sybase Adaptive Server SQL Databases, A Technical Whitepaper”, [6] V. Turau, “Making Legacy Data Accessible for XML Applications”, [7] K. Williams, et al., “XML Structures for Existing Databases”, ibm.com/developerworks/library/x-struct/ January 2001 [8] W.Y. Du, M.L. Lee, T.W. Ling, “XML Structures for Relational Data”, Proc. 2nd Int’l Conf. on Web Information Systems Engineering (WISE), IEEE Computer Society, 2001