Up Next

Chapter 1  Getting Started

1.1  What is XQuery 1.0?

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, operations to construct new documents, SQL-like operations to do selection, joins, and sorting, operations on namespaces, and operations on XML Schema types. XQuery is a functional language, which comes with an extensive library of built-in functions, and has support for user-defined functions. More information about XQuery can be found of the XML Query Working Group Web page at: http://www.w3c.org/TR/xquery.

1.2  What is Galax?

Alpha features:
Limitations:
See Chapter 10 for details on Galax's alignment with the XQuery and XPath working drafts.

1.2.1  Specifications

Galax implements the October 2004 XQuery 1.0 and XPath 2.0 Working Drafts, the XML 1.0 Recommendation, the Namespaces in XML Recommendation, XML Schema Recommendation (Parts 1 & 2).

See Chapter 10 for detailed description of Galax's alignment with October 2004 working drafts.

See Chapter 9 for changes made in version 0.5.0.

1.3  Downloading and installing Galax

Galax 0.5.0 distribution can be downloaded from http://www.galaxquery.org/distrib.html.

Detailed installation instructions are in Chapter 2.

1.4  How you can use Galax

The Galax query engine can be run from:

1.4.1  Command-line tools

Galax supports the following stand-alone command-line tools:
galax-run
The main Galax XQuery interpreter. The simplest way to use Galax is by calling the galax-run interpreter from the command line.

For instance, the following commands from the Galax home directory:
%  echo "<two>  1+1  </two>" > test.xq
%  $(GALAXHOME)/bin/galax-run test.xq
<two>2</two>
evaluates the simple query <two> { 1+1 } </two> and prints the XML value <two>2</two>.

galax-parse
A stand-alone XML document parser and XML Schema validator. This tool is useful for checking whether an input document validates against an XML Schema.

For instance, this command will validate the document in hispo.xml against the schema in hispo.xsd:
%   $(GALAXHOME)/bin/galax-parse -validate -xmlschema $(GALAXHOME)/examples/docs/hispo.xsd $(GALAXHOME)/examples/docs/hispo.xml 


galax-mapschema
A stand-alone tool that maps XML Schema documents into the XQuery type system. This tools is useful for checking whether Galax recognizes all the constructs in your XML Schema. It also eliminates a lot of the ``noise'' in XML Schema's XML syntax.

For instance, this command will print out the XQuery type representation of the schema in hispo.xsd:
%   $(GALAXHOME)/bin/galax-mapschema $(GALAXHOME)/examples/docs/hispo.xsd 
Chapter 5 describes the command-line tools in detail.

1.4.2  Web interface

The Web interface is a simple and convenient way to play with Galax. It 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). Follow the compilation instructions in Section 2.5.

1.4.3  Language API's

Galax supports APIs for O'Caml, C, and Java. See Chapter 6 for how to use the APIs.

If you have installed the binary distribution of Galax, all three API 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 from those API's are in the directories $(GALAXHOME)/examples/caml_api/, $(GALAXHOME)/examples/c_api/, and $(GALAXHOME)/examples/java_api/.




Up Next