XSPARQL is a prototype implementation of the XSPARQL language. This rewriter translates an XSPARQL query into an XQuery as described in the XSPARQL Language Specification.
You can download XSPARQLer in two different ways: as precompiled package or as source via the sourceforge subversion repository.
The packaged XSPARQL is available for download on the Sourceforge project page
You can get the current svn version of XSPARQL by running the following command:
$ svn co https://xsparql.svn.sourceforge.net/svnroot/xsparql xsparql
If you use Maven you can add XSPARQL as a dependency, for example for XSPARQL version 0.5:
To build XSPARQL by yourself you will need at least the following software packages:
- Java JDK (at least Java 5): http://java.sun.com/javase/downloads/
- Apache Maven 2: http://maven.apache.org/
In the main xsparql directory (where you probably found this README) run maven with the install goal:
$ mvn install
Calling maven the first time will take a long time since it will not only download the project dependencies of XSPARQL but also a lot of "dependencies" of maven itself.
If you want to use Graphviz to visualize a syntax tree download it from http://www.graphviz.org/ or from a repository if available for your platform.
Don't forget to set the path accordingly if not already done by the installation procedure.
You will also need a directory called
./tfd for the dot files and the generated files.
You can run xsparql from the the created (or downloaded) jar file:
$ java -jar lang/target/cli-0.5-jar-with-dependencies.jar query.xs
To get an overview of the possible parameters of xsparql execute
$ java -jar lang/target/cli-0.5-jar-with-dependencies.jar -h
You can also assign values to variables declared as external using an equals sign ($graph in this example):
$ java -jar lang/target/cli-0.5-jar-with-dependencies.jar query.xs graph="<file:///home/user/graph.rdf>"