1 / 11

XQuery How to handle databases with the XML standard?

XQuery How to handle databases with the XML standard?. Peter van Keeken Industrial trainee, Evitech 4 th period 2002. 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

blake-greer
Download Presentation

XQuery How to handle databases with the XML standard?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XQueryHow to handle databases with the XML standard? Peter van Keeken Industrial trainee, Evitech 4th 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: • XML Schema • 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 • 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 • Example XQuery: FOR $i IN distinct(document("recipes.xml") //ingredient/@name) RETURN <ingredient name={$i}> { FOR $r IN document("recipes.xml")//recipe WHERE $r//ingredient[@name=$i] RETURN $r/title } </ingredient> • 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, 2nd Edition, Wrox P2P serie

  11. THE END Questions?

More Related