15-xml-notes

15-xml-notes - 1 XML-Relational Mapping CPS 116...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 XML-Relational Mapping CPS 116 Introduction to Database Systems 2 Announcements (Tue. Nov. 1) ¡ Homework #3 deadline extended to next Tuesday ¡ Project milestone #2 due in 1½ weeks 3 Approaches to XML processing ¡ Text files (!) ¡ Specialized XML DBMS ¢ Lore (Stanford), Strudel (AT&T), Timber (Michigan), MonetDB/XQuery (CWI, Netherlands), Tamino (Software AG), BaseX, eXist, Sedna, … ¢ Still some way to go ¡ Object-oriented DBMS ¢ ObjectStore, ozone, … ¢ Not as mature as relational DBMS ¡ Relational (and object-relational) DBMS ¢ Middleware and/or extensions ¢ IBM DB2’s pureXML, PostgreSQL’s XML type/functions… 2 4 Mapping XML to relational ¡ Store XML in a CLOB (Character Large OBject) column ¢ Simple, compact ¢ Full-text indexing can help (often provided by DBMS vendors as object-relational “extensions”) ¡ Alternatives? ¢ Schema-oblivious mapping: well-formed XML ! generic relational schema • Node/edge-based mapping for graphs • Interval-based mapping for trees • Path-based mapping for trees ¢ Schema-aware mapping: valid XML ! special relational schema based on DTD 5 Node/edge-based: schema ¡ Element ( eid , tag ) ¡ Attribute ( eid , attrName , attrValue ) ¢ Attribute order does not matter ¡ ElementChild ( eid , pos , child ) ¢ pos specifies the ordering of children ¢ child references either Element ( eid ) or Text ( tid ) ¡ Text ( tid , value ) ¢ tid cannot be the same as any eid ) Need to “invent” lots of id ’s ) Need indexes for efficiency, e.g., Element ( tag ), Text ( value ) Key: Keys: 6 Node/edge-based: example <bibliography> <book ISBN=”ISBN-10” price=”80.00”> <title>Foundations of Databases</title> <author>Abiteboul</author> <author>Hull</author> <author>Vianu</author> <publisher>Addison Wesley</publisher> <year>1995</year> </book>… </bibliography> Element ElementChild Attribute Text eid pos child e0 1 e1 e1 1 e2 e1 2 e3 e1 3 e4 e1 4 e5 e1 5 e6 e1 6 e7 e2 1 t0 e3 1 t1 e4 1 t2 e5 1 t3 e6 1 t4 e7 1 t5 eid tag e0 bibliography e1 book e2 title e3 author e4 author e5 author e6 publisher e7 year tid value t0 Foundations of Databases t1 Abiteboul t2 Hull t3 Vianu t4 Addison Wesley t5 1995 eid attrName attrValue e1 ISBN ISBN-10 e1 price 80 3 7 Node/edge-based: simple paths ¡ //title ¢ SELECT eid FROM Element WHERE tag = ‘title’; ¡ //section/title ¢ SELECT e2.eid FROM Element e1, ElementChild c, Element e2 WHERE e1.tag = ‘section’ AND e2.tag = ‘title’AND e2....
View Full Document

This document was uploaded on 01/17/2012.

Page1 / 9

15-xml-notes - 1 XML-Relational Mapping CPS 116...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online