ARQ - Command Line Applications

The arq package contains some command line applications to run queries, parse queries, process result sets and run test sets.

You will need to set the classpath, or use the helper scripts, to run these applications from the command line. The helper scripts are in bin/ (Linux, Unix, Cygwin) and bat/ (Windows) directories. There are ancillary scripts in the directories that the main commands need - you should put the relevant directory on your command path and set the ARQROOT environment variable after checking these scripts are suitable.

All commands have a --help command for a summary of the arguments.

When using a query in a file, if the query file ends .rq, it is assumed to be a SPARQL query. If it ends .arq, it is assumed to be an ARQ query and if it ends .rdql, it is assumed to be an RDQL query. You can specify the syntax explicitly.

The commands jena.query, jena.sparql, jena.qtest and jena.rset are equivalent and just call to these commands.

arq.query

This is the main command for executing queries on data. The wrappers just set the query language.

Just running arq.query with no arguments prints the usage message. The main arguments are:

The file extension is used to guess the file serialization format. If a data file ends .n3, it is assumed to be N3; if it ends .ttl is Turtle; if it is .nt is N-Triples; otherwise it is assumed to be RDF/XML. The data serialization can be explicitly specified on the command line.

arq.qparse

Parse a query and print it out. Can be used to translate between syntaxes (but not perfectly - specifically, RDQL value constraints need further conversion as complete mechanical translation is not possible).

arq.qparse will parse the query, print it out again (with line numbers by default) and then parse the serialized query again. If your query has a syntax error, a message is printed but no query is printed. If a query is printed then you get a syntax error message, then your query was syntactically correct but the ARQ serialization is broken.

arq.qtest

Execute a test set. In the ARQ directory, qtest --all runs the whole ARQ test suite.

To run a specific test suite, use qtest manifest. See the working group page DAWG Testcases for details.

arq.rset

Read and write result sets.

In particular,

java -cp ... arq.rset --in xml --out text

will translate a SPARQL XML Result Set into a tabular text form.

arq.qexpr

Read and print an expression (something that can go in a FILTER clause). Indicates whether an evaluation exception occured.

The -v argument prints the parsed expression.

ARQ Documentation Page