Joseki: Command Line Applications

The standard distribution provides two client applications for accessing published RDF on a remote server.  Both these applications are written on top of the Joseki client library.  The two command line applications are:

The protocol used in both these applications is HTTP GET. Any program that can issue HTTP GETs, such as wget or cwm, can access a Joseki server.  There is a directory of examples in the distribution.

Fetch

A remote fetch returns the recorded RDF about a resource in the model.  For example, if the resource is the URI is the subject of Dublin Core statements, an appropriately configured server will return all the statements with properties in the Dublic Core namespace with the requested resource as subject.

Usage:

java -cp ... joseki.rdffetch --model ModelURI --resource URI

The RDF is written out according to the --format argument, or N3 by default.

The exact nature of the RDF returned is determined by the server.  See the "Data Objects" page for further information.

Remote Query

Access to RDF in Joseki is in the form of an RDF graph returned as the result of a query (including fetch or issuing an RDQL query).  Executing an RDQL query on the server returns the smallest subgraph that matches the query (i.e. the subgraph that gives the same results as the query on the original graph).

Joseki comes with a command line application, very similar to the command line interface to the RDQL local query system (jena.rdfquery).

Usage:

java -cp ... joseki.rdfqueryremote [--model URI] {--query file | queryString}

In particular, you can put all the information in the query using the FROM clause of RDQL:

SELECT ?x
FROM <http://localhost:2020/testdata>
WHERE (?x, ?y, "LITERAL-2")

so the command:

java -cp ... joseki.rdfqueryremote --query SomeFile

will work for the default installation with its test data.

Specifying the "--model URL" parameter overrides the URL specified in the FROM clause of a query if any was present.