Semi-Structured data (XML Data MODEL)

Slides:



Advertisements
Similar presentations
XML e X tensible M arkup L anguage (XML) By: Albert Beng Kiat Tan Ayzer Mungan Edwin Hendriadi.
Advertisements

XML: Extensible Markup Language
XML, XML Schema, Xpath and XQuery Slides collated from various sources, many from Dan Suciu at Univ. of Washington.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 311 Database Systems I The Semistructured Data Model.
Database Management Systems, R. Ramakrishnan1 Introduction to Semistructured Data and XML Chapter 27, Part D Based on slides by Dan Suciu University of.
Agenda from now on Done: SQL, views, transactions, conceptual modeling, E/R, relational algebra. Starting: XML To do: the database engine: –Storage –Query.
1 Lecture 10 XML Wednesday, October 18, XML Outline XML (4.6, 4.7) –Syntax –Semistructured data –DTDs.
1 Lecture 10: Database Design XML Wednesday, October 20, 2004.
1 COS 425: Database and Information Management Systems XML and information exchange.
1 New Ways of Querying the Web by Eliahu Brodsky and Alina Blizhovsky.
Semi-structured Data. Facts about the Web Growing fast Popular Semi-structured data –Data is presented for ‘human’-processing –Data is often ‘self-describing’
1 Introduction to XML Yanlei Diao UMass Amherst April 19, 2007 Slides Courtesy of Ramakrishnan & Gehrke, Dan Suciu, Zack Ives and Gerome Miklau.
XML Introduction What is XML –XML is the eXtensible Markup Language –Became a W3C Recommendation in 1998 –Tag-based syntax, like HTML –You get to make.
XML and Databases 198:541. XML Motivation  Huge amounts of unstructured data on the web: HTML documents  No structure information  Only format instructions.
XML(EXtensible Markup Language). XML XML stands for EXtensible Markup Language. XML is a markup language much like HTML. XML was designed to describe.
End of SQL XML April 22 th, Null Values If x=Null then 4*(3-x)/7 is still NULL If x=Null then x=“Joe” is UNKNOWN Three boolean values: –FALSE =
XML, XML Schema, XPath and XQuery Query Languages CS561 Slides collated from several sources, including D. Suciu at Univ. of Washington.
1 Lecture 08: XML and Semistructured Data. 2 Outline XML (Section 17) –XML syntax, semistructured data –Document Type Definitions (DTDs) XPath.
Managing XML and Semistructured Data Lecture 2: XML Prof. Dan Suciu Spring 2001.
1 Lecture 08: XML and Semistructured Data. 2 Outline XML (Section 17) –XML syntax, semistructured data –Document Type Definitions (DTDs) XPath.
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.
4/20/2017.
XML: Extensible Markup Language FST-UMAC Gong Zhiguo.
IS432: Semi-Structured Data Dr. Azeddine Chikh. 1. Semi Structured Data Object Exchange Model.
XML and XPath. Web Services: XML+XPath2 EXtensible Markup Language (XML) a W3C standard to complement HTML A markup language much like HTML origins: structured.
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
Another PillowTalk Presentation  2004 Dynamic Systems, Inc. Introduction to XML for SOA Lee H. Burstein,
An Introduction to XML Presented by Scott Nemec at the UniForum Chicago meeting on 7/25/2006.
XML Schema and Stylus Studio. Introduction to XML Schema XML Schema defines building blocks of a XML document XML Schemas are alternative to DTD Why XML.
 XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
Lecture 5: XML Tuesday, January 16, Outline XML, DTDs (Data on the Web, 3.1) Semistructured data in XML (3.2) Exporting Relational Data in XML (8.3.1)
1 XML eXtensible Markup Language. 2 XML vs. HTML HTML is a HyperText Markup language HTML is a HyperText Markup language Designed for a specific application,
XML Introduction. Markup Language A markup language must specify What markup is allowed What markup is required How markup is to be distinguished from.
1 Introduction to Semistructured Data and XML. 2 How the Web is Today  HTML documents often generated by applications consumed by humans only easy access:
More XML: semantics, DTDs, XPATH February 18, 2004.
The Semistructured-Data Model Programming Languages for XML Spring 2011 Instructor: Hassan Khosravi.
CS 157B: Database Management Systems II February 11 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
XML e X tensible M arkup L anguage (XML) By: Albert Beng Kiat Tan Ayzer Mungan Edwin Hendriadi.
Information Design Trends Unit 4: Sources and Standards Lecture 3: A Brief Introduction to XML.
Structured Documents - XML and FrameMaker 7 Asit Pant.
Working with XML. Markup Languages Text-based languages based on SGML Text-based languages based on SGML SGML = Standard Generalized Markup Language SGML.
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.
XML – Basic Concepts (modified version from Dr. Praveen Madiraju) 2015, Fall Pusan National University Ki-Joune 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.
XML Databases Presented By: Pardeep MT15042 Anurag Goel MT15006.
Lecture 14: Relational Algebra Projects XML?
XML: Extensible Markup Language
XML QUESTIONS AND ANSWERS
Management of XML and Semistructured Data
XML: Extensible Markup Language
Management of XML and Semistructured Data
XML Data Introduction, Well-formed XML.
XML Data DTDs, IDs & IDREFs.
Lecture 11 XML Wednesday, Oct. 24, 2001.
eXtensible Markup Language (XML)
Lecture 12: XML, XPath, XQuery
What is XML?.
Lecture 9: XML Monday, October 17, 2005.
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.
CSE 544: Lecture 5 XML 4/15/2002.
Lecture 8: XML Data Wednesday, October
CSE591: Data Mining by H. Liu
Allyson Falkner Spokane County ISD
Introduction to Database Systems CSE 444 Lecture 10 XML
Lecture 15: Querying XML Friday, October 27, 2000.
Semi-Structured data (XML)
Lecture 11: XML and Semistructured Data
Presentation transcript:

Semi-Structured data (XML Data MODEL) WPI, Mohamed eltabakh

What we covered so far… All about Relational Model and Relational DBs

Other data models Relational is not the only model to describe your data

XML Data Model

Semi-Structured Data ER, Relational data models are all based on schema Structure of data is rigid and known is advance Efficient implementation and various storage and processing optimizations Semi-structured data is schemaless Flexible in representing data Different objects may have different structure and properties Self-describing (data is describing itself) Harder to optimize and efficiently implement

Relational model for Movie DB Collection of records (tuples) Movie Star Stars-in Relationship

Semi-Structured model Collection of nodes Leaf nodes contain data Internal nodes represent either objects or attributes Each link is either an attribute link or relationship link

XML XML: Extensible Markup Language XML is a tag-based notation (language) to describe data XML document Self-describing because its value has its own tag In relational model, you know the meaning from the table schema 0553212419, ‘Sherlock …’, ‘Sir Arthur ..’

XML XML: Extensible Markup Language XML is a tag-based notation (language) to describe data XML document XML has two modes Well-formed XML ---No Schema at all Valid XML --- governed by DTD (Document Type Definition) Allows validation and more optimizations and pre-processing

HTML Tags vs. XML tags HTML tags describe structure/presentation <h1> Bibliography </h1> <p> <i> Foundations of Databases </i> Abiteboul, Hull, Vianu <br> Addison Wesley, 1995 <p> <i> Data on the Web </i> Abiteboul, Buneman, Suciu <br> Morgan Kaufmann, 1999

HTML Tags vs. XML tags (Cont’d) XML tags describe content (have semantics) <bibliography> <book> <title> Foundations… </title> <author> Abiteboul </author> <author> Hull </author> <author> Vianu </author> <publisher> Addison Wesley </publisher> <year> 1995 </year> </book> … </bibliography>

XML Terminology Well-formed XML document: if it has matching tags tags: book, title, author, … start tag: <book>, end tag: </book> elements: <book>…</book>,<author>…</author> elements are nested empty element: <red></red> abbrv. <red/> an XML document: single root element Well-formed XML document: if it has matching tags CS561 - Spring 2007.

XML: Attributes Attributes are alternative ways to represent data Inside the start tag <book price = “55” currency = “USD”> <title> Foundations of Databases </title> <author> Abiteboul </author> … <year> 1995 </year> </book> Attributes are alternative ways to represent data CS561 - Spring 2007.

Semantic tags Instructional tag (the doc. Is XML) Standalone means it does not follow a schema (well-formed) Root element Sub elements Attributes

Attributes vs. Sub-elements Two alternative ways to describe the attributes of an object Attributes are also used to define IDs and references

Attributes vs. Sub-elements

XML Schema

Document Type Definition DTD XML Schema An XML document is usually (but not always) validated by an XML Schema The XML Schema provides the information on whether the XML document “followed the rules” set up in the XML Schema An XML Schema is an agreement between the sender and the receiver of a document as to the structure of that document Document Type Definition DTD XML Schema Two mechanisms

XML Schema Schema can define: -Elements -Attributes -Data types -Required or optional -Min and Max occurrences

Example

Data Types in XML Schema

Simple data types in XML Schema

Example: Simple Types

Complex types in XML Schema

Example: Complex data types

Keys in XML Schema

Keys in xml schema Elements in XML can have keys (unique identifiers) Keys can be attributes or subelements A key can be a single field or multiple fields Key fields (attributes or subelements) cannot be missing Keys are defined in XML schema using special syntax Attributes do not have keys

Keys in xml schema Key: give a name to the key Selector: following the selector xpath starting from the root, it will return a list of objects Field: in the returned objects, the xpath defined in ‘field’ has to be unique @ symbol refers to attributes

Keys in xml schema In general, the key syntax is: <key name=“someDummyNameHere"> <selector xpath=“p"/> <field xpath=“p1"/> <field xpath=“p2"/> . . . <field xpath=“pk"/> </key> All these fields together form the key

Foreign Keys in XML Schema Foreign key syntax: Foreign key name Refers to which primary key <keyref name="personRef" refer="fullName"> <selector xpath=".//personPointer"/> <field xpath="@first"/> <field xpath="@last"/> </keyref> Location of Foreign key

Example: Stars schema Primary key defined in the Movie Schema

XML Model vs. Relational Model

Comparison RDBMS XML Relationships among items is explicitly defined General-purpose storage and processing systems Good for general-purpose queries asking for different objects Easy to optimize for storage and querying Straightforward to export to XML XML Relationships among items inferred by position Used for data exchange and with XSLT for web visualization Good for partitioned data and for retrieving objects with their all sub-components Harder to optimize for storage and querying Usually not straightforward