Data Modeling using XML Schemas Murali Mani Extreme 2002.

Slides:



Advertisements
Similar presentations
ER to Relational Mapping. Logical DB Design: ER to Relational Entity sets to tables. CREATE TABLE Employees (ssn CHAR (11), name CHAR (20), lot INTEGER,
Advertisements

Logical DB Design: ER to Relational Entity sets to tables. Employees ssn name lot CREATE TABLE Employees (ssn CHAR (11), name CHAR (20), lot INTEGER, PRIMARY.
Conceptual Design using the Entity-Relationship Model
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
The Entity-Relationship Model
1 541: Database Systems S. Muthu Muthukrishnan. 2 Overview of Database Design  Conceptual design: (ER Model is used at this stage.)  What are the entities.
The Entity-Relationship (ER) Model
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
The Entity-Relationship Model
SQL Lecture 10 Inst: Haya Sammaneh. Example Instance of Students Relation  Cardinality = 3, degree = 5, all rows distinct.
Comp3300/fall021 The Entity-Relationship Model Chapter 2 What are the steps in designing a database ? Why is the ER model used to create an initial design?
The Entity-Relationship Model Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY courtesy of Joe Hellerstein for some slides.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
1 The Entity-Relationship Model Chapter 2. 2 Overview of Database Design  Conceptual design: (ER Model is used at this stage.) –What are the entities.
CS34311 Translating ER Schema to Relational Model.
Murali Mani The Relational Model. Murali Mani Why Relational Model? Currently the most widely used Vendors: Oracle, Microsoft, IBM Older models still.
SPRING 2004CENG 3521 The Relational Model Chapter 3.
Modeling Your Data Chapter 2. Overview of Database Design Conceptual design: –What are the entities and relationships in the enterprise? – What information.
Conceptual Design Using the Entity-Relationship (ER) Model
The Entity-Relationship (ER) Model CS541 Computer Science Department Rutgers University.
SLIDE 1IS Fall 2002 Database Management: Discussion Session University of California, Berkeley School of Information Management and.
CS34311 The Entity- Relationship Model. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design Conceptual.
CS34311 The Entity- Relationship Model Part II.. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
ER continued, and ER to Relational Mappings R&G Chapters 2, 3 Lecture 22.
Modeling Your Data Chapter 2. Part II Discussion of the Model: Good Design/ Bad Design?
Murali Mani The Entity- Relationship Model. Murali Mani Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
1 The Entity-Relationship Model Chapter 2. 2 Database Design Process  Requirement collection and analysis  DB requirements and functional requirements.
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
The Entity-Relationship Model. 421B: Database Systems - ER Model 2 Overview of Database Design q Conceptual Design -- A first model of the real world.
1 The Entity-Relationship Model Chapter 2. 2 Overview of Database Design  Conceptual design : (ER Model is used at this stage.)  What are the entities.
ER to Relational Mapping. Logical DB Design: ER to Relational Entity sets to tables. CREATE TABLE Employees (ssn CHAR (11), name CHAR (20), lot INTEGER,
XML-to-Relational Schema Mapping Algorithm ODTDMap Speaker: Artem Chebotko* Wayne State University Joint work with Mustafa Atay,
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Concepts and Terminology Introduction to Database.
ICS 321 Spring 2011 High Level Database Models Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 2/7/20111Lipyeow.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Identity Constraints.
Christoph F. Eick: Designing E/R Diagrams 1 The Entity-Relationship Model Chapter 3+4.
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
LECTURE 1: Entity Relationship MODEL. Think before doing it! Like most of the software projects, you need to think before you do something. Before developing.
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.
Part4 Methodology of Database Design Chapter 07- Overview of Conceptual Database Design Lu Wei College of Software and Microelectronics Northwestern Polytechnical.
09/03/2009Lipyeow Lim -- University of Hawaii at Manoa 1 ICS 321 Fall 2009 Introduction to Database Design Asst. Prof. Lipyeow Lim Information & Computer.
1 Conceptual Design using the Entity- Relationship Model.
Management of XML and Semistructured Data Lecture 10: Schemas Monday, April 30, 2001.
CS34311 Translating ER Schema to Relational Model.
Lecture 3 Book Chapter 3 (part 2 ) From ER to Relational.
1 The Entity- Relationship Model Instructor: Mohamed Eltabakh
The Entity-Relationship (ER) Model. Overview of db design Requirement analysis – Data to be stored – Applications to be built – Operations (most frequent)
CSC 411/511: DBMS Design 1 1 Dr. Nan WangCSC411_L2_ER Model 1 The Entity-Relationship Model (Chapter 2)
CS34311 The Entity- Relationship Model Part III..
Working with XML. Markup Languages Text-based languages based on SGML Text-based languages based on SGML SGML = Standard Generalized Markup Language SGML.
ER & Relational: Digging Deeper R &G - Chapters 2 & 3.
Modeling Your Data Chapter 2 cs5421. Part II Discussion of the Model: Good Design/ Bad Design? cs5422.
LECTURE 1: Entity Relationship MODEL. Think before doing it! Like most of the software projects, you need to think before you do something. Before developing.
Presented by Kyumars Sheykh Esmaili Description Logics for Data Bases (DLHB,Chapter 16) Semantic Web Seminar.
SEMI-STRUCTURED DATA (XML) 1. SEMI-STRUCTURED DATA ER, Relational, ODL data models are all based on schema Structure of data is rigid and known is advance.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
1 CS122A: Introduction to Data Management Lecture #5 (E-R  Relational, Cont.) Instructor: Chen Li.
Modified Slides from Dr.Peter Buneman 1 XML Constraints Constraints are a fundamental part of the semantics of the data; XML may not come with a DTD/type.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
COP Introduction to Database Structures
The Enhanced Entity- Relationship (EER) Model
The Entity-Relationship Model
The Entity-Relationship Model
XML Constraints Constraints are a fundamental part of the semantics of the data; XML may not come with a DTD/type – thus constraints are often the only.
The Entity-Relationship Model
Presentation transcript:

Data Modeling using XML Schemas Murali Mani Extreme 2002

What this talk is not about Not about X gave a two thumbs up for the Fugitive, The We talk about data modeling from database perspective.

What is database perspective? Our world consists of Entities Relationships binary - 1:1, 1:many, many:many n-ary recursive Attributes for entities Attributes for relationships

Outline of the talk How XML can contribute to the DB community. Introduction of the ER model How ER concepts are modeled using relational model Mapping ER concepts to XML model Constraint specification for XML – what are the options? Subtyping for XML processing – do we need it, and what are the options?

How XML can contribute to DB community Standard exchange format Superior data model? Recursive relationships Union types Person (name | (lastname, firstname), age, address) Frendlier representation of relationships?

person  (person*) person  (person?) PersonAgeFather X25Y Y55null

Data Modeling What is a data model? Structural specification Specification of constraints Operations to retrieve/update the data Stages in database design Conceptual model  Logical Model  Physical model Conceptual Model and Logical Model – absolutely NO (almost no) redundancy

Database Design and Redundancy ProfAge Muntz60 studentBSProf MMCSMuntz YCEEMuntz StudentBSProfAge MMCSMuntz60 YCEEMuntz60

Database design and redundancy PersonAddressCityStatezip XA1LAXCA90066 YA2LAXCA90066

Entity Relationship (ER model) Consider students and professors in a dept, with a relationship advisor StudentProfsince MMMuntz1998 YCMuntz2000

ER Model (contd…) N-ary relationship

Relational Model Every relation has a key Relationships are represented using foreign keys Foreign key from A to B represents A (_, 1) : B (_, _) relationship SupplierPartCitylastShipment

Relational Model (contd…) SupplierPartCitylastShipment PName Muntz StudentProfessorsince MMMuntz1998 YCMuntz2000

Relationships in XML model A (1, 1) : B (_, _) can be represented using parent-child relationships as B  A* prof  student*)

Entity Relationship (ER model) Consider students and professors in a dept, with a relationship advisor StudentProfsince MMMuntz1998 YCMuntz2000

Using ID/IDREF to represent relationships A (_, 1) : B (_, _) can be represented using ID/IDREF as Define an ID attribute for B Define an IDREF attribute for A referring B prof

Using ID/IDREFS to represent relationships – not Really… ID/IDREFS can represent any binary relationship – A (_, _) : B (_, _), but cannot represent attributes for relationship A  B  student  professor 

Using foreign keys to represent relationships student  (SName, Professor, since) professor  (PName)

Summary so far… XML schemas allow us to represent relationships in a friendlier way… All foreign key constraints can be represented using parent-child or ID/IDREF – we do not really need foreign keys IDREFS not recommended for representing relationships.

Constraint specification in XML – questions to be asked Node equality vs value equality (or) Can a path field produce an element? Can a path field produce a set of elements/values? – if so, what semantics? Should a path field exist? (or) Can a path field return empty? Should path expressions traverse only down the tree? Should our constraints be based on type selectors or should they be based on path expression selectors? If we use path expression or type selectors, do we need relative keys?

Node Equality Makes it easier, but… When are two elements equal – their serialized string values ignoring the order of attributes is the same. We have used order among child nodes in defining node equality…

Can a path field produce a set of values? professor  (Pname, Age) 60 Muntz Chu If a type X has a key (X1, X2, …, Xn), then the set Y1 * Y2 * … * Yn should be unique

Should a path expression traverse only down the tree? Trade off is relative keys vs traversing up the tree.. For example, consider student, professor with a difference – a student can have multiple professors. Consider the same design Professor  (PName, Student*) Student  (Sname) Key for student can be specified as either (professor, Sname) (or) Key for student relative to professor is (Sname) But this is bad design anyways…

Three different constraint specifications UCM – WWW10 Type selectors, no relative keys, path expressions can produce set of values. Keys for XML – WWW10 Path selectors, relative keys specified through paths, path expressions cannot produce set of values. W3C XML Schema Path selectors, relative keys specified through types, path expressions cannot produce set of values.

Commonalities across the 3 specifications No concept of node equality Path expressions traverse only down the tree A path field should exist

Summary about Data Modeling Entity types map to element types. Some relationship types map to element types. Ability to define element types – RELAX NG provides the ability for us to define element types, In XML Schema, this is not so easy. Key constraints based on type selectors seem the right way to go.

XML Processing and Subtyping Subtyping is essential for static type checking function f1 : a{A}  B*,C* { for $x in a//name return ; for $x in a//name return ; } function f2 : d{(B, B)*, (C, C)* | B, (B,B)*, C, (C, C)*} { … }  Is this type-safe?  Type-inferencing vs type-checking problem.

Two techniques for subtyping Implicit – tree/hedge language inclusion A type A is a subtype of type B iff L (A) is a sublanguage of L (B) – used in XDuce Explicit – user specifies type hierarchy As in XML Schema Explicit subtyping “implicitly” solves type- inferencing vs type checking problem. Implicit subtyping poses several interesting research problems.