What is XQuery?
- XQuery is a query and functional programming language that is designed to query collections of XML data.
Reference: http://en.wikipedia.org/wiki/XQuery
In other words, XQuery is a query language for XML data representations which can be used similar to how SQL is used for relational databases...
It was developed primary to extract and manipulate data from the WWW. Consider the fact that XML is:
1. A textual data representation
2. Very popular, especially in web applications
3. Platform independent
As a result ,there is a sea of information out there, but to organize it any degree is not easy, but can open the door to a plethora of possibilities.
But, think about the possibilities... Any XML data representation can be queried by XQuery... This means:
1. HTML pages (there are a few of those out there!)
2. XML databases
3. Relational databases with XML representations
4. Office documents (they have an XML underlying format!)
5. Even this Blog is stored in XML!!
How XQuery Works:
XQuery can use XPath expressions to query and/or retrieve certain parts of an XML document... But that's no big deal.
The power of XQuery lies in FLWOR Power!
FLWOR is an XQuery syntax with a similarity to SQL's "SELECT" statement.
F --> For Clause: Defines a range of variables
L --> Let: Declare a variable
W --> Where: Filters the selected output
O --> Order By: Orders the result set
R --> Return: Returns the fields we desire from the query
Best of all, the output of a FLWOR query in XML form!! That means it can:
1. Create a new, valid XML document
2. Inserted into an existing, valid XML document
3. Can be used in an XSLT stylesheet
XQuery Applications :
Of course, if there is no need for the technology, then it really isn't of much value. However, there are many applications currently using XQuery, including:
1. Log File Mining
2. Dashboards -- Easily combine disparate data sources!
3. Automated Stock Ticker Analysis
4. Supply Chain Management
5. Etc., Etc., Etc.
Many DBMS systems are coming with XQuery capabilities now... They not only can represent their data in XML format, but you can directly use XQueries against it (http://msdn.microsoft.com/en-us/library/ms170809(SQL.90).aspx).
For a detailed list of current, working XQuery implementations, see the W3C web site: http://www.w3.org/XML/Query/#implementations
XQuery Limitations:
Despite the successes of XQuery, there are some limits to its usefulness as well. These include things like:
1. No mechanism for dynamic binding or polymorphism (http://en.wikipedia.org/wiki/XQuery)
2. XQuery is a Query Language: That is , it cannot compete with the features of a DBMS for a complete data management solution.
XQuery Applications :
Of course, if there is no need for the technology, then it really isn't of much value. However, there are many applications currently using XQuery, including:
1. Log File Mining
2. Dashboards -- Easily combine disparate data sources!
3. Automated Stock Ticker Analysis
4. Supply Chain Management
5. Etc., Etc., Etc.
Many DBMS systems are coming with XQuery capabilities now... They not only can represent their data in XML format, but you can directly use XQueries against it (http://msdn.microsoft.com/en-us/library/ms170809(SQL.90).aspx).
For a detailed list of current, working XQuery implementations, see the W3C web site: http://www.w3.org/XML/Query/#implementations
XQuery Limitations:
Despite the successes of XQuery, there are some limits to its usefulness as well. These include things like:
1. No mechanism for dynamic binding or polymorphism (http://en.wikipedia.org/wiki/XQuery)
2. XQuery is a Query Language: That is , it cannot compete with the features of a DBMS for a complete data management solution.
XQuery Resources:
Below are links to some excellent XQuery resources:
XQuery Tutorials:
Using Saxon and XQuery:
General XQuery Information: