XQuery 1.0 is a query language for XML, defined by the World-Wide Web Consortium (W3C), under the XML activity. XQuery is a powerful language, which supports XPath 2.0 as a subset and includes expressions to construct new XML documents, SQL-like expressions to perform selection, joins, and sorting over collections of XML values, operations on namespaces, and expressions over XML Schema types. XQuery is a functional language, which comes with an extensive library of built-in functions, and allows user to define their own functions. More information about XQuery can be found of the XML Query Working Group Web page1.
Galax is an implementation of XQuery 1.0 designed with the following goals in mind: completeness, conformance, performance, and extensibility. Galax is open-source, and has been used on a large variety of real-life XML applications. Galax relies on a formally specified and open architecture which is particularly well suited for users interested in teaching XQuery, or in experimenting with extensions of the language or optimizations.
Here is a list of the main Galax features.
Pass | Fail | Total | Percent | |
Minimal Conformance | 14553 | 71 | 14637 | (99.4%) |
Optional Features | ||||
Static Typing Feature | 46 | 0 | 46 | (100%) |
Full Axis Feature | 130 | 0 | 130 | (100%) |
Module Feature | 32 | 0 | 32 | (100%) |
The following features are experimental.
See Chapter 4 for details on Galax’s alignment with the XQuery and XPath working drafts.
The following lists the main changes included with this version (1.0).
Changes from older versions can be found in Chapter 8.
The official distribution can be downloaded from the main Galax Web site4. Detailed installation instructions are provided in Chapter 2.
The Galax processor offers the following user interfaces:
A number of stand-alone command-line tools are provided with the Galax
distribution. Assuming the Galax distribution is intalled in
$GALAXHOME
, and that Galax executables are reachable from your
$PATH
environment variable, The following examples show how to
use the main command-line tools.
% echo "<two>{ 1+1 }</two>" > test.xq % galax-run test.xq <two>2</two>evaluates the query
<two>{ 1+1 }</two>
and prints the XML
result <two>2</two>
.% galax-parse -validate -xmlschema $GALAXHOME/examples/docs/hispo.xsd \ $GALAXHOME/examples/docs/hispo.xml
For instance, this command will print out the XQuery type representation of the schema in hispo.xsd:
% galax-mapschema $GALAXHOME/examples/docs/hispo.xsd
Chapter 5 describes the command-line tools in detail.
The Web interface is a simple and convenient way to get acquainted with Galax. It allows users to submit a query, and view the result of compilation and execution for that query.
An on-line version is available on-line at: http://www.galaxquery.org/demo/galax_demo.html
You can also re-compile the demo from the Galax source and install it on your own system. You will need an HTTP server (Apache is recommended), and follow the compilation instructions in Section 2.4.
Galax supports APIs for OCaml, C, and Java. See Chapter 6 for how to use the APIs.
If you have installed the binary distribution of Galax, all three APIs are available.
If you have intalled the source distribution of Galax, you will need to select the language(s) for which you need API support at configuration time. See Chapter 2 for details on compiling Galax from source.
Examples of how to use Galax’s APIs can be found in the following
directories:
$GALAXHOME/examples/caml_api/
$GALAXHOME/examples/c_api/
$GALAXHOME/examples/java_api/.