Download presentation

Presentation is loading. Please wait.

Published byKristofer Haney Modified over 2 years ago

1
XML Algebra By Sailaja P. KReSIT IIT Bombay

2
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 2 Algebra and the World of DB zWhy Algebra yGives semantics for a query language yFor efficient query processing zFew algebrae yRelational Algebra: For relational data yNested Relational Algebra: For nested relational model ySchema Algebra: For MultiDB interoperability

3
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 3 Why Algebra for XML zStructure of data yDeeply structured yExact structure not specific zRecursion yStructurally recursive

4
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 4 XML Algebra zSample Data Data on the Web 1999 Abiteboul Buneman XML Query 2000 Mary

5
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 5 XML Algebra type Bib = bib [ Book{0,*}] type Book = book [ title [String ], year [Integer], author[ String]{1,*} ] let bib0: Bib = bib [ book [ title [Data on the Web], year [1999], author[Abiteboul], author[Buneman] ] book[ title[XML Query],year[2000], author[Mary] ]

6
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 6 Projection Eg: project book( children (bib0) ) yAllows a more convenient notation as well (similar to Xpath notation) Eg. bib0/book/author ==> author [Abiteboul] author [Buneman] author [Mary] :author [ String ] {0,*}

7
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 7 Projection Provides for an iterator bib0/book/author yEquivalent : for b project book( children (bib0)) in project author( children (b))

8
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 8 Selection Eg: for b bib0/book in where value (b/year) <= 2000 then b ==> book [ title [ Data on the web], year [1999], author[Abiteboul], author[Buneman] ] : Book{0,*}

9
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 9 Join type Reviews = reviews [ book [ title [String], review [ String] ]{0,*} ] let review0: Reviews = reviews[ book [ title[XMLQuery], review[A fine book] ], book [ title[Data on Web], review[This is great] ]

10
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 10 Join zExpression for b bib0/book in for r review0/book in where value (b/title) = value (r/title) then book [ b/title, b/author, r/review] ==> book [ title [Data on the web], author[Abiteboul], author[Buneman] review[A fine book] ],

11
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 11 Join book[ title[XML Query], author[Mary], review[This is great] ] : book[ title[String ], author[String]{1,*}, review[String] ]{0,*}

12
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 12 Querying Order zIndex function pairs an integer index with each element in a forest Eg: index (book0/author) ==> pair[fst[1],snd[author[Abiteboul]]], pair[fst[2],snd [author[Buneman]]], pair[fst[3],snd [author[Suciu]]] : pair[fst[Integer],snd[author[String]]]{1,*}

13
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 13 Aggregation zHas five built-in aggregation functions: avg,count, max, min and sum zEg: for b bib0/book in where count(b/author) >= 2 then b/title ==> title[Data on the web] : title{0,*}

14
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 14 Additional Features zStructural Recursion yTo define documents with recursive structure, recursive types are used zSorting ysort(pairs) zGrouping yGroup(pairs)

15
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 15 Conclusions zImportant contributions yOperators are orthogonal, strongly typed yOperators do obey laws of equivalence and optimization zIssues to be resolved yQuerying over global order is not defined yEquality and relational operators on element and scalar types are not defined.

16
30/09/2000 Sailaja P., KReSIT XML Workshop, IITBombay 16 Resources zhttp://www.cs.bell-labs.com/~wadler/topics/xml.html#algebra zFor an implementation of the algebra: zhttp://www.w3.org/TR/query-datamodel zThis presentation will be put up: yhttp://www.it.iitb.ernet.in/~sailu/Algebra.html

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google