Ipedo Ipedo Blogs
My Photo

« December 2006 | Main | February 2007 »

Using Ipedo XQuery Views

Ipedo’s XIP includes an XQuery engine that is one of the most mature implementations in the market. This XQuery engine has been deployed by a number of large enterprises for more than three years. It is also unique in its ability to query not only collections of XML documents, which is the best known use of XQuery, but also relational databases, web services, common data formats like CSV and fixed length formats. In addition, the Ipedo XQuery engine also allows users to create custom data sources and make them available to XQuery developers. All this extends the power of the XQuery engine well beyond basic XML query.

 

The XIP XQuery engine implements a large built-in function library and also allows users to develop library modules. Library modules are collections of user defined functions that can be reused across queries. This helps in modular development.

 
Additionally, the XIP XQuery engine supports the concept of a view. Once a view is created, it can be accessed using the view()function. Here is an example of how it can be invoked.

 
(: Show all customers in Brazil :)

<Brazil> {

  for $c in view("sqlserver/customers")/table/row

  where $c/Country = 'Brazil'

  return   

    <customer>{

           $c/CompanyName, $c/Address, $c/City

     }</customer>

}</Brazil>

 

The view named “sqlserver/customers” is a view created over the customers table in a sqlserver database. Once the view is created, this table is accessible to XQuery developers. In this query, for instance, the developer is retrieving all the customers in the table whose Country attribute holds the value “Brazil”. The XQuery engine does intelligent optimizations to execute the most efficient query possible against the sqlserver instance, retrieving the smallest data set possible. Sophisticated queries with complex join conditions can be executed against the multiple backend data sources. Views can also be defined over web services, XML sources accessible over HTTP, CSV files, Fixed length format files, and any custom data sources for which the user can program access.

 
These capabilities make the XIP XQuery engine a unique offering in the Enterprise Information Integration space. In combination with the distributed SQL query engine, also offered in XIP, this set of capabilities represent one of the most powerful ways of querying and integrating distributed data.