The un-queried life is not worth living
Socrates (Plato, The Apology, 38a)

W3C XML Query (XQuery)

30,000 Foot View

XQuery: 30,000 foot view (CIO, CTO, Journalist)

XQuery is a standardized language for combining documents, databases, Web pages and almost anything else. It is very widely implemented. It is powerful and easy to learn.

XQuery is replacing proprietary middleware languages and Web Application development languages. XQuery is replacing complex Java or C++ programs with a few lines of code. XQuery is simpler to work with and easier to maintain than many other alternatives.

Do more with less.

Contents

Architects

XQuery for the systems analyst or architect

The W3C XML Query Working Group worked with the W3C XML Schema Working Group and the W3C XSL Working Group to make a set of specifications that all work together.

Use XQuery to take data from multiple databases, from XML files, from remote Web documents, even from CGI scripts, and to produce XML results that you can process with XSLT.

Use XQuery on the back-end of a Web server, or to generate Enterprise-wide executive reports.

Examples of XML Query In Action

The Dolley Madison Digital Edition by the University of Virginia Press.

Alberta learning Center for education in the Canadian province of Alberta; e.g. see the Search link, which does not require registration.

The New England Journal of Medicine uses XQuery, perhaps for the Search facility.

MarkMail is an XQuery-based application for searching and visualising mailing lists.

O'Reilly Labs use XQuery to power code search, image search, statistics and more.

CQ Legislative Impact is a tool to explore how pending US legislation might affect existing laws.

Oxford African American Studies Center is a site published by Oxford University Press using an XQuery system. See the Site Credits link there for more details.

fromoldbooks.org has an image search engine powered by XML Query; you can see the text of the queries (follow the About link on the Search page). This is also used by Liam Quin's Photograph search page.

Have you got a Web site that's powered by XML Query? A success story to share? Contact liam at w3.org.

Users

XQuery: choosing an implementation

There are over 40 different software packages that support XML Query in some way. Things to look for include availability of support, platforms, price, performance, all the usual issues, but you should also ask whether the software supports the final syntax from the W3C Recommendation or implements an earlier draft. Another XML Query specific feature is support for XML files, for fetching documents via HTTP, and for connecting to relational (or other) data sources: that is, whether the package lives up to the XML Query promise of unifying access to many different forms of information.

List of XQuery Implementations

Learning

There are some books listed; there are also people offering training and tutorials. If there is anything you found particular helpful, let us know!

There are also some mailing lists devoted to XML and to XML Query. You should look at the archives of each list before posting; you'll also need to subscribe to the list before you can post to it in most cases.

www-ql

This is the W3C public mailing list on query languages, including (but not limited to) discussion on the XML Query project. Do not use this to send comments on the specification, such as errata or feature requests; see the Status section in each specification for instructions on how to send comments to the Working Group.

xquery-talk

A mailing list hosted at x-query.com, especially for discussing XQuery.

xml-dev

Probably the most widely-known list for discussing XML.

Reading the Specs

W3C Specifications are aimed first and foremost at programmers writing implementations of them. We also try to make them readable for people trying to learn the language—but given a choice between making a standard precise and making it easy to read, we have to make it precise.

If you are fairly technical, you could start by reading the XML Query specification, and the XQuery Use Cases document has some examples. Many people would rather look for a book or tutorial.

Implementers

XQuery for the implementer: hard core query

Implementers: what would you most like to see here? What would have helped you the most?

The XQuery Test Suite

The XQuery Test Suite was developed primarily to help the XML Query Working Group show that the specification could be implemented in such a way that queries would work on multiple systems - that is, interoperably. We are not currently doing active work on the test suite, but implementers continue to find it useful. It is not a conformance test suite: implementers are responsible for producing their own statements of conformance, and W3C does not have the resources to test or verify those statements.

Static Typing and Formal Semantics

XPath 2 has typed values; that is, the language associates a value type with each expression, variable or function. The set of possible types is that defined by W3C XML Schema, augmented by user-defined types derived from those basic Schema types using an external schema. The way in which an XPath or XQuery system derives and checks the type of an expression is defined formally, using a mathematical notation, in the XQuery 1.0 and XPath 2.0 Formal Semantics Recommendation.

Note that both external W3C Schema support and static typing are optional features, so not all implementations support them.

Conformance Statements

You will often see things in the specifications marked as being implementation defined. You must document what your implementation does for each of these.

Documents

Specifications and Working Group Notes

The W3C XML Query Working Group has published a lot of documents. Many of these were done together with the XSL Working Group and are marked Joint.

Both of these Working Groups also met with the W3C XML Schema Working Group, to make sure our specifications all work together.

First, the main XML Query documents:

XML Query (XQuery) 1.0 Requirements (W3C Working Group Note)

XML Query 1.0 Use Cases (W3C Working Group Note)

XSLT 2.0 shares a lot of the same functionality:

XSL Transformations (XSLT) Version 2.0 (by the XSL Working Group)

XQuery 1.0 and XSLT 2.0 both use XPath 2.0:

XML Path Language (XPath) 2.0 (W3C Recommendation; Joint)

XPath in turn is built on a number of Joint specifications :

XQuery 1.0 and XPath 2.0 Data Model (W3C Recommendation; Joint)

XSLT 2.0 and XQuery 1.0 Serialization (W3C Recommendation; Joint)

XQuery 1.0 and XPath 2.0 Formal Semantics (W3C Recommendation; Joint)

The XML Query and XSL Working Groups are developing Full-Text Search for XPath 2.0; this will then be available for future versions of XQuery and XSLT:

The XML Query Working Group is developing an update facility for XQuery; this lets you write Query expressions that change documents and perhaps save the result.

The XML Query Working Group is working on the next version of XML Query, XQuery 1.1.

The XML Query Working Group is working on Scripting Extensions for XQuery. The goal is to investigate whether adding imperative (procedural) features such as variable assigment and explicit sequencing to XQuery makes the language significantly more powerful or easier to use.

News

Recently added...

Send your XQuery-related news item to liam@w3.org, with [XQuery] in the Subject.

Subscribe to the RSS feed.

XQuery Scripting Extension 1.0 First Public Working Draft Published

Fri, 28 Mar 2008

XQuery Scripting Extension 1.0 First Public Working Draft Published published as a first public working draft. The XQuery Scripting Extensions introduce some procedural exstensions to the (otherwise declarative and functional) XQuery language.

XQuery Scripting Extension 1.0 Use Cases Published

Fri, 28 Mar 2008

XQuery Scripting Extension 1.0 Use Cases published as a first public working draft.

XML Query (XQuery) 1.1 Use Cases published

Thu, 27 Mar 2008

XML Query (XQuery) 1.1 Use Cases published as a first working draft.

XQuery Update Now A W3C Candidate Recommendation

Fri, 14 Mar 2008

XQuery Update Facility 1.0 is now a W3C Candidate Recommendation; this means that the XML Query Working Group is asking for feedback, especially from implementors.

GCX XQuery implementation listed

Fri, 01 Feb 2008

GCX, a streaming in-memory open source XQuery engine with static and dynamic buffer minimzation, added to list of implementations

Qizx/db 2.0 Released

Tue, 15 Jan 2008

XMLmind has released Qizx/db 2.0, an embeddable, high-speed, Java-based native XML database engine with XQuery support, including full-text; there is a commercial product and also a free engine, limited to "small" databases of under a gigabyte.

BaseX 4.0 Released

Tue, 08 Jan 2008

BaseX 4.0 has been released. New features include indexes, (partial) Full-Text support, GUI support for XML Updates, and more user interface items.

DataDirect XQuery 3.1

Wed, 02 Jan 2008

DataDirect XQuery 3.1 has been released. New features include performance enhancements, database support for database support for DB2 v9.1 for z/OS, MySQL Enterprise and Community servers, Oracle 11g, Informix, PostgreSQ, ODF support, EDI and flat file generation support, an Eclipse plugin, and more.

XQuery Showcase: Examples

Wed, 07 Nov 2007

The list of example Web sites using XQuery has been expanded.

oXygen 9.0 released

Mon, 05 Nov 2007

oXygen Editor 9.0 now includes an outline view for XQuery, improved support for using W3C XML Schema and XSL, drag-and-drop XML editing and many other features.

W3C Java Applets updated

Wed, 17 Oct 2007

W3C Java Applets updated for the January Recommendations, also for the latest Update and Full Text drafts.

An XQuery Wikibook

Tue, 16 Oct 2007

An XQuery Wikibook by Chris Wallace, Dan Mcreary and Kurt Cagle

XQilla 1.1.0 released

Fri, 31 Aug 2007

XQilla version 1.1.0 released; this includes support for the Last Call Working Draft of XQuery Update.

XQuery Update Facility Last Call for Comments

Wed, 29 Aug 2007

The XML Query Working Group has published a Last Call Working Draft of the XQuery Update Facility 1.0. Comments are welcome through 31 October. The corresponding XQuery Update Facility 1.0 Requirements and XQuery Update Facility 1.0 Use Cases were also updated.

Conference Talk about Choosing an XQuery Implementation

Thu, 09 Aug 2007

Communicating Query by Liam Quin, with a paper at Extreme Markup.

XQilla added

Wed, 11 Jul 2007

XQilla added to the list of XQuery implementations.

BaseX XQuery test results published

Wed, 11 Jul 2007

baseX submitted test results for their large-file implementation of XML Query.

DataDirect XQuery 3.0 Released

Mon, 21 May 2007

DataDirect DataDirect XQuery 3.0. The new version includes support for the W3C XQuery Update draft, and also adds Web Services support.

W3C Recommendations!

Tue, 23 Jan 2007

W3C Recommendation Status for XQuery 1.0: An XML Query Language, XML Syntax for XQuery 1.0 (XQueryX) and XML Path Language (XPath) 2.0, as well as the supporting specifications, XQuery 1.0 and XPath 2.0 Functions and Operators, XQuery 1.0 and XPath 2.0 Data Model (XDM), XSLT 2.0 and XQuery 1.0 Serialization and of course XQuery 1.0 and XPath 2.0 Formal Semantics. In addition, XSL Transformations (XSLT) Version 2.0 by the XSL Working Group is also a W3C Recommendation.

Patent Disclosures

The XML Query Working Group operates under the Royalty Free terms of the W3C Patent policy. Patent disclosures relevant to the specifications produced by the XML Query working group can be found in the Implementation of the W3C Patent Policy (IPP) XML Query IPP status page and, for XSL and joint specifications the XSL WG IPP status page. Older disclosures are on the XML Query Working Group's patent disclosure page at http://www.w3.org/2002/08/xmlquery-IPR-statements.

Specifications that are joint work with the XSL working group have also the additional patent disclosures provided by the XSL wg at http://www.w3.org/Style/XSL/Disclosures.

Discussion/Feedback:

Implementations

XML Query Implementations

If your implementation is not here, or if you know of an implementation that is not listed, send liam@w3.org the details!

There are also products implementing XPath 2 and XPath 2 Full Text Implementations in separate lists.

  1. The W3C XPath 2.0 and XQuery 1.0 Grammar Test Page for the January 2007 Recommendation and also for the Full Text and Update grammars
  2. Abacus Systems' Relational XQuery supports both relational data (via JDBC) and other sources including XML files, and also claims XQJ (XQuery for Java API) conformance. Includes a GUI for creating and editing queries. 30 day evaluation.
  3. Altova GmbH XMLSpy 2006 includes an XQuery Debugger, a code generator for mapping between Schemas, and AltovaXML Query Processor which handles both XSLT 2 and XML Query 1.0 [30-day free trial]
  4. Anglo, an implementation for the Microsoft .NET framework by Clinical & Biomedical Computing Ltd. Anglo implements schema import, static typing and they say all other optional features.
  5. Apple's Sherlock for Mac OS X; see also their XML Query Extension functions.
  6. BEA's AquaLogic Data Services Platform [90-day free trial]. BEA is an active participant in the XML Query Working Group.
  7. Berkeley Lab's Nux, an open source Java in-memory toolkit for XML, XQuery, XPath, schema validation, fuzzy fulltext similarity search and related technologies using Saxon, XOM, Xerces and JAXB [open source under a BSD-style license]. Full-Text Support
  8. Bluestream Database Software Corp.'s XStreamDB, a native XML database server and full text support. [commercial with trial download]
  9. David Carlisle's xq2xml converts XQuery to XML, to XQueryX and to XSLT.
  10. Cerebra Inc.'s Cerebra Server supports XQuery, OWL-DL and RDF, and can connect to external databases, but their Web server no longer responds.
  11. Cognetic Systems's XQuantum implements a subset of XML Query in an XML-native data store. They have a Web page demonstrating the XQuery Use Cases, and support static typing as well as the full-text extensions. [Windows and Linux; 30-day evaluation] Full-Text Support
  12. DataDirect's DataDirect XQuery (tm), an embeddable component for XQuery that implements the XQuery for Java(tm) API (XQJ) [Java; 15-day trial download]. DataDirect participates in the XML Query Working Group.
  13. DataDirect's Stylus Studio 5.0 (XQuery, XML Schema and XSLT IDE). DataDirect participates in the XML Query Working Group.
  14. eXist has a Java-based native XML database with an XQuery interface. [Open source, GNU LGPL.] Implements the XQuery Update Facility
  15. The Albert-Ludwigs University of Freiburg's GXX, a streaming in-memory XQuery engine with static and dynamic buffer minimzation [open source]
  16. MXQuery from ETH, a research project; the sourceforge page says, The Micro XQuery Engine is a low-footprint, extensible implementation of XQuery 1.0 including extensions like the XQuery Update and XQueryP. It supports streaming execution and runs on all devices support CLDC 1.0 upwards. [Open source, BSD/Apache license]. ETH is an active participant in the XML Query Working Group. Implements the XQuery Update Facility
  17. Fatdog Software's XQEngine Java. [Open source: GPL or as negotiated]. Full-Text Support
  18. GAEL's Derby provides a Java API via their Data Request Broker. There is extensive support for data analysis, including plotting graphs and making tables.
  19. Galax. Open-source (in OCAML), with a Galatex full text search implementation. The authors of Galax include a number of active participants in the XML Query Working Group, both psat and present. Full-Text Support
  20. GNU's Qexo (Kawa-Query) by Per Bothner. Compiles XQuery on-the-fly to Java bytecodes. Based on and part of the Kawa framework. Qexo implements the optional XQuery static typing feature. [Open-source under the GPL-like Kawa License].
  21. Ipedo's XIP includes a "dual core" SQL + XML Query engine (XMLDB).
  22. IBM's xqnsta: XQuery Normalizer and Static Analyzer (XQNSTA) is a Java API and GUI for normalizing and computing the static type of XQuery expressions. IBM is an active participant in the XML Query Working Group.
  23. IBM's DB2 relatnal database supports XQuery naively in Viper.
  24. IPSI's IPSI-XQ [java; free download]
  25. Ispras Modis' Sedna. Native XML DBMS in C/C++ and Scheme; partial support for XML Query. Includes an Apache HTTP module, and APIs for .NET, Python and Chicken Scheme. [Open source under the Apache License].
  26. MarkLogic's MarkLogic Server (formerly known as Content Interaction Server). There is also a technical overview document. Commercial, with free download restricted to 100 Megaybytes of data. A limited duration trial license is also available, limited to 1G of content. Full-Text Support MarkLogic is an active participant in the XML Query Working Group.
  27. Microsoft's SQL Server 2005 Express, with XML Schema, XPath 2, and XML Query support
  28. CWI's MonetDB/XQuery is an XQuery system that also supports XQUF updates. It is based on the Pathfinder compiler developed at TU Munich, and aims at achieving high performance. Open Source (adapting the Mozilla Public License).
  29. OpenLink Software's Virtuoso Universal Server claims to support XSLT 1.2 (?! their link points to the XSLT 1.1 draft), XQuery and SQLX.
  30. Oracle Berkeley DB XML 2.0, formerly Sleepycat's, an embeddable native XML database with support for XQuery 1.0 (July 2004 draft), implemented in C++, with interfaces for Java, Python, Perl and PHP. Open source. Oracle is an active participant in the XML Query Working Group. Full-Text Support
  31. Oracle's Oracle XQuery is part of the Oracle Database 10g Release2. [multi-platform; seems to be a free binary download] Oracle is an active participant in the XML Query Working Group.
  32. Patternist, an XQuery 1.0, XSL-T 2.0 and XPath 2.0 implementation that provices a C++ API (open source under GPL, uses TrollTech's Qt library)
  33. PHP XML Classes includes XqueryLite, a PHP implementation from 2002. [open source]
  34. Politecnico di Milano's XQBE and other XQuery products
  35. QuiLogic's SQL/XML-IMDB supports a mixure of SQL statements and XQuery expressions. [Free trial requires a restart every hour]
  36. RainingData's TigerLogic XDMS XML Data Management Server for Sun Solaris and Microsoft Windows [free trial].
  37. Renmin University of China's OrientX, a native XML database system in C/C++ developed under Renmin University of China. [open source]
  38. Saarland University Database Group's FluXQuery, an extension of the XQuery language, FluX, that supports event-based query processing and the conscious handling of main memory buffers. The implementation is (was?) based on GCX
  39. Saxonica's Saxon implements both XML Query and XSLT 2.0. Available in a schema-aware version as a commercial product, and without schema support as open source.
  40. Software AG's
  41. Sonic Software's Sonic XML Server [30-day trial]
  42. The Universität Konstanz's Database and Information Systems Group's BaseX (open source/GPL) Full-Text Support
  43. The University of Texas at Arlington Computer Science Department has people working on XQP: XQuery Processing on a P2P System. [Java; open source]
  44. Worcester Polytechnic Institute's RainbowCore. [Java. available at no charge and without warranty].
  45. The Univerisity of Antwerp's blixem LiXQuery engine implements a subset of XQuery intended for teaching.
  46. X-Hive's XQuery demo
  47. XML Global's GoXML DB
  48. XMLmind's Qizx comes in three versions: (1) an open source one (Qizx/open); (2) a commercial implementation, Qizx/db, with an indexed native XML database and full-text support, and (3) Qizx/db Free Engine, a freely downloadable version of Qizx/db but that has a one-gigabyte database size limit.
  49. Xpriori's NeoCore XMS native XML database, with XPath2.0/XQuery access language support [.Net on Linux and MS Windows; free unlimited download for development purposes.]
  50. XQuare Group and Universite' de Versailles Saint-Quentin's: XQuare Fusion and XQuare Bridge, open-source, used to be called xQuark (see also the Xquare home page)
  51. XQilla, C++ implementation based on pathan and Xerces-C. Open source (BSD/Sleepycat license)
  52. Xyleme's Xyleme Server [commercial]

Unconfirmed Implementations

Please send liam@w3.org any information about these; I have tried to contact people where possible.

XPath 2 Implementations

Software that implements XPath 2.0, but not XML Query or XSLT 2

XPath 2 Full Text Implementations

Related Products and Resources

The following is a (non-comprehensive) list of announcements of products that will include some support for XQuery, or that are of related nature:

Publications

Books

I have tried to indicate where authors participated in the XML Query Working Group, sent comments on the specifications, or have written implementations themselves. This does not necessarily make them good writers, but it may help you to understand their point of view and their connection with XML Query.

Books that I have received more recently are at the top of the list.

I have not seen the following books:

Tutorials

A Google search for "XQuery tutorial"|"XML Query tutorial") produced over 150 matches (Google actually said about 30,500 but this turned out to mean exactly 153).

Other Pointers

To suggest a new pointer, send an email to member-query-feedback@w3.org.

Contacting Us

To contact the XML Query and XSL Working Groups, you can send email to public-qt-comments at w3.org

To report errors in the specification please use bugzilla, as described in the Status section at the start of each specification.

To comment on this page, send mail to liam at w3 dot org


Valid XHTML 1.0! First created by Massimo Marchiori on April 2000.
Page redesigned in 2007 by Liam; images from www.fromoldbooks.org used by permission.
Page maintained by Liam Quin.
Current: $Revision: 1.138 $ $Date: 2008/04/27 03:25:35 $

Copyright © 2000-2006W3C (MIT, ERCIM, Keio ), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.