ARQ - Command Line Applications
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
bin/ (Linux, Unix, Cygwin) and
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.
arq.queryis the main query driver. It can be called for SPARQL, ARQ or RDQL queries and there are wrapper commands for each language:
arq.qparse: parse and print a query.
arq.update: execute SPARQL/Update requests.
arq.remote: execute a query by HTTP on a remote SPARQL endpoint.
arq.rset: transform result sets.
arq.qtest: run a test set.
arq.qexpr: evaluate and print an expression.
All commands have a
--help command for a summary of the
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 (extensions to SPARQL) and if it ends .rdql, it is assumed to be an RDQL query. You can specify the syntax explicitly.
jena.rset are equivalent and just call to these commands.
This is the main command for executing queries on data. The wrappers just set the query language.
arq.sparql: wrapper for SPARQL queries
arq.arq: wrapper for ARQ queries
arq.query --helpprints the usage message. The main
--query FILE: The file with the query to execute
--data FILE: The data to query. It will be included in the default graph.
--namedgraph FILE: The data to query. It will be included as a named graph.
--desc/--dataset: Jena Assembler description of the dataset to be queried, augmented with vocabulary for datasets, not just graphs. See
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.
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
arq.qparse --print=op --file <i>queryFile</i>will
print the SPARQL algebra for the query in
Execute SPARQL Update requests.
--desc: Jena Assembler description of the dataset or graph store to be updated. See
Read and write result sets.
java -cp ... arq.rset --in xml --out text
will translate a SPARQL XML Result Set into a tabular text form.
Read and print an expression (something that can go in a
clause). Indicates whether an evaluation exception occured.
-v argument prints the parsed expression.
Execute a request on a remote SPARQL endpoint using HTTP.
--service URL: The endpoint.
--data FILE: Dataset description (default graph) added to the request.
--namedgraph FILE: Dataset description (named graph) added to the request.
--results FORMAT: Write results in specified format. Does not change the request to the server which is always for an XML form.