Presentation is loading. Please wait.

Presentation is loading. Please wait.

XQuery How to handle databases with the XML standard? Peter van Keeken Industrial trainee, Evitech 4 th period 2002.

Similar presentations


Presentation on theme: "XQuery How to handle databases with the XML standard? Peter van Keeken Industrial trainee, Evitech 4 th period 2002."— Presentation transcript:

1 XQuery How to handle databases with the XML standard? Peter van Keeken Industrial trainee, Evitech 4 th period 2002

2 What is XQuery? XQuery is a data query language for XML designed by W3C. XQuery is designed to be broadly applicable across all types of XML data sources (eg. Databases).

3 XQuery history XQuery is derived from Quilt an XML query language which borrowed features from languages like: –XPath 1.0 –XQL (XML Query Language) –XML-QL (a query language for XML) –SQL (Structured Query Language) –OQL (ODMG, Object Database Standard)

4 XQuery specifications: Able to query databases and data from (XML) documents XQuery is a data model describing how a XQuery processor should process an XML document or datasource that is available to an XQuery processor. XQuery is also based on: 1.XML Schema 2.XPath (version 2.0) a human-readable syntax and an XML-based syntax is required

5 More practical decription: Allows joins between XML documents Allows sorting and grouping Language is SQL like but works on trees rather then relational tables

6 An simple example: You have for instance the next list of recipes in an XML Document: recipes.xml recipes.xml Example XQuery: FOR $t IN document (recipes.xml) // title RETURN $t The result: The query will return all the titles of the recipes in the file.

7 Another example: A more complex query based on the same resource: recipes.xml recipes.xml Example XQuery: FOR $i IN distinct(document("recipes.xml") //ingredient/@name) RETURN { FOR $r IN document("recipes.xml")//recipe WHERE $r//ingredient[@name=$i] RETURN $r/title } The result: The query will return for each ingredient, the recipes that it is used in.

8 The Good about XQuery Can store document or data style XML Tremendous flexibility Complement RDBMS with XML mapping solutions Performance can be very good

9 The Bad about XQuery Standard is still in development Techniques are unfamiliar to people Not good at transaction processing Some expected database practices are still unsupported Interoperability between products is minimal

10 Resources: WWW: www.w3.org/TR/xquery/ people.cs.uct.ac.za/~agelderb/hons/coursXMLAarhus.pdf Book (for XML Schemas) : D. Hunter, Beginning XML, 2 nd Edition, Wrox P2P serie

11 THE END Questions?


Download ppt "XQuery How to handle databases with the XML standard? Peter van Keeken Industrial trainee, Evitech 4 th period 2002."

Similar presentations


Ads by Google