XQuare Bridge: extending relational databases with XQuery and XML-relational mapping


The new generation of Enterprise Application Integration tools, B-to-B e-commerce platforms, Web Services, Workflow Messaging Systems and document management tools all generate and exchange information in XML format. Establishing data exchange between these platforms and an existing relational database is difficult due to the differences in the structure and type of the data involved. Projects quickly become bogged down in extensive conversion work between the relational world and the XML world. XQuare Bridge eases the transformation between XML documents and existing relational databases by supporting: XQuery-based extraction of relational data, their transformation into XML format and the insertion (or loading) of the XML data into relational database tables while respecting the existing schema.

This functionality is provided by the component with a maximum of flexibility and openness to incremental improvements. The tool, optimized for “extract – transform – load” applications, permits the developer to concentrate on the essential issue: the semantic relationship between the existing system’s data model and the structure of XML documents that must be produced or integrated. Once this relationship is defined using the tool’s mapping and query languages, the transformation of specific data instances is performed automatically.

Thus, the unique properties of this tool are:

  • Drastically reduced development time. The programmer simply defines the queries or mappings and all generation of identifiers, parsing of documents and generation of complex SQL statements are done automatically.
  • Increased ease of maintainence. Translations between XML and SQL are no longer cast in the "stone" of programs. The translations are clearly laid out in a single location providing a clear description of data movement in both directions.
  • Increased performance. XQuare Bridge is highly optimized to perform these translations. Instead of "one-off" optimizations used in an ad-hoc translation, all optimization techniques are gathered in one place and can be applied to all uses of the product.

XQuare Bridge uses two independent modules to implement its functionality:

  • Extractor, which extracts data stored in relational database into XML format via XQuery, and
  • Mapper, which map XML documents and load them into an existing relational database.


For each type of XML document to be produced, the developer forms the XQuery requests that permit the extraction of data to be linked to the XML document. The Extractor module itself is in charge of the connection to the relational database, the execution of the XQuery requests, and the reconstruction of the XML documents in the specified format. The Extractor provides a wide flexibility for:

  • Defining generic requests containing parameters that are instantiated at run-time,
  • Defining a nested set of requests to construct deeply structured XML documents from a flat relational schema,
  • Choosing the format of the XML document to be generated.


For each type of XML document to be inserted, the developer forms a set of storage rules to be applied to the elements of the document. These rules are specified with the aide of the a simple mapping language. The Mapper utilizes these rules to decide where data elements are stored. Restrictions on data storage (such as foreign keys) are automatically handled during data storage.

The essential functionality provided is:

  • Control of the structure of the documents accepted,
  • Management of data integrity constraints,
  • Conditional insertion and updates on the database,
  • Integration of function calls and SQL requests during insertion,
  • Automatic generation of identifiers and keys, and
  • User defined generation of identifiers and keys
Odonata logoBuilt with Apache Forrest logoObjectWeb logo