Presentation is loading. Please wait.

Presentation is loading. Please wait.

Maziar Sanaii Ashtiani – 105405 SCT – EMU, Fall 2011/12.

Similar presentations


Presentation on theme: "Maziar Sanaii Ashtiani – 105405 SCT – EMU, Fall 2011/12."— Presentation transcript:

1 Maziar Sanaii Ashtiani – 105405 SCT – EMU, Fall 2011/12

2  HTTP  Standard Generalized Markup Language  eXtensible Markup Language ▪ Useful as a data format to exchange between apps ▪ Markup means something not mentioned in the document ▪ Has tags enclosed n angle brackets ▪ Database Systems Concepts

3 Comp. Sci. Taylor 100000 CS-101 Intro. to Computer Science Comp. Sci 4 10101 Srinivasan Comp. Sci. 65000 10101 CS-101

4  Tags are self documenting  No rigid format  Can evolve over time  Nested structures  Widely accepted  Lots of tools XML has become THE dominant format for data exchange

5  Elements  Single root  Proper nesting .........  Text in the context of an element  May be mixed with subelements  Nesting to avoid joins (fig. 23.5, 23.6)

6  Attributes  name= value  Strings  Useful as identifiers  Namespace   Literal values  · · · ]]>

7  Databases have schemas  XML  Document Type Definition  XML Schema  Relax NG

8 <!DOCTYPE university [ ] >

9 <!DOCTYPE university-3 [ <!ATTLIST department dept_name ID #REQUIRED > <!ATTLIST course course_id ID #REQUIRED dept_name IDREF #REQUIRED instructors IDREFS #IMPLIED > dept name IDREF #REQUIRED > · · · declarations for title, credits, building,budget, name and salary · · · ] >

10  No constraints  Data verification needed  No limit over occurrence  Lack of typing for ID and IDREF

11  Result of deficiencies in DTD  Has string, integer, decimal,…  User defined types

12 <xs:element ref=“department” minOccurs=“0” maxOccurs=“unbounded”/> <xs:element ref=“course” minOccurs=“0” maxOccurs=“unbounded”/> <xs:element ref=“instructor” minOccurs=“0” maxOccurs=“unbounded”/> <xs:element ref=“teaches” minOccurs=“0” maxOccurs=“unbounded”/> 

13  PK  FK

14  Constraints  User-defined types  PK and FK  Integrated namespaces  Min and Max values  Type extension by inheritence

15  XPath  Language for path expressions  XQuery  Standard language for querying XML ▪ Modeled after SQL but different ▪ Deal with nested XML data

16  Trees and nodes  Elements and attributes  XPath 2.0  /university-3/instructor/name ▪ Srinivasan ▪ Brandt

17  Selection  /university-3/course[credits >= 4]/@course id  Functions  Count() ▪ /university-2/instructor[count(./teaches/course)> 2]  id(“foo”)  Union “|”  …

18  W3C  XQuery 1.0 ▪ For ▪ Let ▪ Where ▪ Order by ▪ Return

19 for $x in /university-3/course let $courseId := $x/@course_id where $x/credits > 3 return { $courseId } is equivalent to for $x in /university-3/course[credits > 3] return { $x/@course id }

20 for $c in /university/course, $i in /university/instructor, $t in /university/teaches where $c/course_id= $t/course id and $t/IID = $i/IID return { $c $i } which is equivalent to for $c in /university/course, $i in /university/instructor, $t in /university/teaches[ $c/course id= $t/course id and $t/IID = $i/IID] return { $c $i }

21 declare function local:dept_courses($iid as xs:string) as element(course)* { for $i in /university/instructor[IID = $iid], $c in /university/courses[dept name = $i/dept_name] return $c }

22  Document Object Model  JAVA DOM API  Simple API for XML  Event model

23  Non-relational Data Stores  Flat files (NO ACID)  XML Database ▪ DOM C++-based

24  Relational Databases  Store as string ▪ clob  Tree Representation  Map to Relations  Publishing and Shredding XML Data  Native Storage within Relational Database

25 select xmlelement (name “course”, xmlattributes (course id as course id, dept name as dept name), xmlelement (name “title”, title), xmlelement (name “credits”, credits)) from course

26  Storing Data With Complex Structure  ODF  OOXML  Standardized Data Exchange Format  B2B  Web Services – HTTP  SOAP  WSDL  Data Mediation – Wrappers


Download ppt "Maziar Sanaii Ashtiani – 105405 SCT – EMU, Fall 2011/12."

Similar presentations


Ads by Google