120 likes | 222 Vues
Explore the world of XML query languages including XQuery, XML-QL, Lorel, XML-GL, XSL, and XQL. Learn about key features, comparisons, and expectations from these languages. Discover how XML Schema integration impacts query capabilities. Delve into querying XML data and assessing average salaries.
E N D
Survey of XML Query Languages Josh Spiegel
What is an XML Query Language? Roughly like SQL but for XML instead of relational data. <employees> <employee id=“1”> <name>John Coltrane</name> <salary>152156</salary> </employee> <employee id=“2”> <name>Maceo Parker</name> <salary>82654</salary> </employee> <employee id=“3”> <name>Josh Spiegel</name> <salary>35250</salary> </employee> </employees> I want all the employees that make more than $50,000.
The Languages Chances are, if you ever end up using an XML query language, you will use XQuery. XML-QL The High Bit XQuery Lorel Quilt SQL/XML • Almost a W3C recommendation • Already the “de facto” standard • There are many implementations (ANSI/ISO) XPath CXQuery XML-GL XSL XQL Active XQuery
Comparative Analysis Comparative Analysis of Five XML Query Languagesby Angela Bonifati and Stefano CeriSIGMOD Record 2000 • 27 Features an XML Query Language should have • Uses the features to compare 5 languages • Lorel • XML-QL • XML-GL • XSL • XQL • ADDED: XQuery
Expectations We expect XQuery to do better than the other 5 languages. The other languages are roughly grandparents of XQuery. XQuery is the “de facto” standard. XQuery will soon be a W3C recommendation.
XQuery could have done better • Where it did well • Integration of XML Schema • Where it needs improvement • Insert, update, delete • Full support for XPointer and XLink • XQuery working group indicates these features will be added in the future. • Implementations support features not in the language specification.
Integration of XML Schema • XML Schema / DTDdefine the structure, content and semantics of XML documents e.g. xsd:integer • XQuery will never require a XML Schema • When a schema is available, more static checks are possible
Integration of XML Schema <employees> <employee id=“1”> <name>John Coltrane</name> <salary>152156</salary> </employee> <employee id=“2”> <name>Maceo Parker</name> <salary>82654</salary> </employee> <employee id=“3”> <name>Josh Spiegel</name> <salary>peanuts</salary> </employee> </employees> Query: What is the average salary?
Integration of XML Schema <employees> <employee id=“1”> <name>John Coltrane</name> <salary>152156</salary> </employee> <employee id=“2”> <name>Maceo Parker</name> <salary>82654</salary> </employee> <employee id=“3”> <name>Josh Spiegel</name> <salary>peanuts</salary> </employee> </employees> Query: What is the average salary?