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:
To build XSPARQL by yourself you will need at least the following software packages:
The central Apache Maven repository contains almost all dependencies of XSPARQL. Because of licensing issues the following dependencies have to be downloaded manually and installed to your local maven repository:
Install the jar file in your local maven repository (replace path-to-jar-file
with the absolute path to the Saxon JAR file):
$ mvn install:install-file -DgroupId=net.sf.saxon -DartifactId=saxon -Dversion=9.3 -Dpackaging=jar -Dfile=path-to-jar-file
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/lang-0.2-jar-with-dependencies.jar query.xs
To get an overview of the possible parameters of xsparql execute
$ java -jar lang/target/lang-0.2-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/lang-0.2-jar-with-dependencies.jar query.xs graph="<file:///home/user/graph.rdf>"