In-Depth
XQuery Standard Inches Closer to Reality
ERP vendor uses XQuery to expose customer data
The XML Query standard inched closer to reality this month as the two World Wide Web Consortium (W3C) working groups charged with its development introduced new drafts of key XQuery specifications.
At least two important XQuery-related draft specifications will soon be elevated to Last Call status, fueling speculation that the XQuery standard itself could be finalized by late this year.
It’s been a long time coming. First proposed in 1998, XQuery—which defines a unified query standard for access to both structured and unstructured data (http://www.tdwi.org/research/display.asp?id=6608)—has since been through six W3C working drafts, the first of which appeared in June 2001. The W3C’s XML Query and eXtensible Stylesheet Language (XSL) working groups are together collaborating on the XQuery draft specifications.
For some users, such as James Somers, a developer with Pro-Concept S.A., an ERP vendor based in Switzerland, a finalized XQuery standard can’t get here fast enough. “We use both XQuery and SQL/X [a language developed by Oracle to query unstructured data] to produce, transform, and consume XML documents representing complex and hierarchical data as ‘Customers,’ ‘Items,’ ‘Bill of Materials,’ and others. Those documents can come either from our own ERP or from other software.”
The reality is that XQuery proponents have gotten their hopes up in the past—only to have them dashed. In this respect, however, news that two of the specifications—“XQuery 1.0 and XPath 2.0 Data Model” and “XQuery 1.0 and XPath 2.0 Functions and Operators”—have been elevated to W3C “Last Call” status is welcome indeed. In the past, this has typically been the last step before proposed specifications are published for public review.
After the public review period ends on June 30th, changes to the specifications based on public recommendations will be made. At that point, they’ll both be eligible for Candidate Recommendation. From there, sources familiar with the process speculate, XQuery could be approved by the end of 2003, or by sometime in early 2004.
Productizing Xquery
This week, IBM Corp. was expected to ship its long-awaited DB2 Information Integrator product, which will eventually be available in two flavors, Information Integrator v8.1 (intended primarily for use with relational data sources) and Information Integrator v8.1 for Content, which facilitates the management of unstructured content.
At press time, it wasn’t clear which component of its Information Integrator tool stack IBM plans to deliver this week—at press time, company representatives were not immediately available for comment—but Jeff Jones, Big Blue’s director of strategy for data management, has promised that his company will introduce XQuery support in its DB2 database and Information Integrator products “when [the standard] is finalized.”
In conjunction with Microsoft Corp., IBM last month delivered an XQuery test suite to the W3C. The test suite, which is currently being evaluated by the standards body, validates whether a given implementation conforms to the XQuery specification. Meanwhile, on its AlphaWorks Web site, Big Blue provides a test version of an XQuery implementation—called XML for Tables (http://www.alphaworks.ibm.com/tech/xtable)—that lets users query relational databases as if they were XML documents.
IBM has also announced plans to collaborate with Oracle Corp. to develop a Java API for XQuery, similar to the JDBC API, which lets Java programs query SQL data sources.
Oracle, for its part, provides a downloadable XQuery prototype (http://otn.oracle.com/sample_code/tech/xml/xmldb/xmldb_xquerydownload.html) on its Oracle Technology Network (OTN) Web site. Sandeepan Banerjee, head of Oracle’s XML database technologies division, has said that his company will fully support XQuery—when the standard is finalized: “It’s not productized [in Oracle 9i Release 2] because XQuery’s standard is not frozen.”
In the interim, Banerjee points out, Oracle’s database uses SQL/X and XPath to get at unstructured data. “The reality today is that XQuery is still probably a good year away from the standard. The use cases are probably hypothetical use standards today,” he suggested in early March.
For Pro-Concept’s Somers, XQuery usage scenarios are anything but hypothetical. Because of this, he admits to being concerned about the absence of productized support for XQuery standard from major vendors such as IBM, Microsoft and Oracle. “I'm just wondering … if really the big companies … want to come out with a product,” he says. “On the last version of the Oracle prototype I encountered a problem. My mails to Oracle had no answer. So I had to roll back to the preceding version.”
Although Somers says that he’s worked with Oracle’s XQuery implementation, he mostly uses Quip (http://developer.softwareag.com/tamino/quip/default.htm), an XQuery implementation from Software AG, which markets the Tamino XML platform. “If we used Oracle it is because they implemented the concept of ‘Bid variable’ that allows us to push value in the XQuery at execution time and allows us to work on XML data very similarly to way we work on relational data.”
In addition to Software AG’s Quip, which Somers says is well supported and closely follows the XQuery drafts, Enosys Software markets an XQuery implementation that is OEM-ed by BEA Systems Inc.
Better than XSLT
As a standard for querying unstructured data, XQuery is often compared to eXtensible Stylesheets Language Transformations (XSLT), an XML-based language that can be used to translate data from one format into another.
In practice, XSLT is often used to translate XML into HTML, but can also be used—with XPath—to translate data stored in a relational context into an XML context. As a result, some critics have suggested that XQuery is a superfluous standard, largely because it reduplicates many features that could also be accomplished using XSLT.
Stephen Tahmosh, an independent consultant who specializes in RDBMS development and administration, says that he has worked in the past with XQuery and believes that it’s a worthwhile alternative to XSLT. “I think XQuery has the potential to revolutionize access to structured and semi-structured data. It removes some of the constraints of a non-procedural tool such as XSLT. XQuery is like XSLT in that it uses XPath, but it is much more than XSLT in that it provides procedural control which is not available in XSLT.”
During his work with XQuery, Tahmosh also used Quip—in spite of the fact that he works extensively in Oracle RDBMS environments. Tahmosh says that he has also used Oracle’s XMLType feature—which makes it possible to create, extract, and index XML data stored in the 9i database—but hasn’t worked with Oracle’s XQuery implementation. “I believe the true power will be when you can query RDBMS data and XML documents transparently,” he concludes.
Pro-Concept’s Somers reports that his company is using XQuery to do precisely that. “With XQuery we can have the flexibility we need to adapt external data to our own requirements with "external" queries [--] without changing the code. We already have a productive site where we use our XQuery-SQL/X tandem to create automatically items and bill of material from an external CAD system.”
Is he worried about the XQuery specification changing drastically between now and the time when it’s approved as a standard? “I think that even if the standard is not yet adopted, the drafts and the use cases won't change a lot. They may enlarge the standard, … [but they will not change] the base structure of XQuery.”
Besides, Somers allows, the XQuery module that his company has developed isn’t for all customers: “[The module] won't be deployed to a lot of companies, as they need to be mature enough to be ready to exchange data between processes and to coordinate them.”
About the Author
Stephen Swoyer is a Nashville, TN-based freelance journalist who writes about technology.