4s-query1
Run sparql queries on a 4store storage backend
Usage
4s-query kb-name
[-f
format]
[-O
optimisation-level]
[-I
insert-mode]
[-r]
[-s
soft-limit]
[-b
base-URI]
[-e]
[-P]
[query]
Interactive mode
If [query] is ommited then 4s-query goes into interactive mode, suitable for trying queries from the command line.
-P enables programatic interactive mode, suitable for infacing with processes via stdin and stdout. Queries are sent as UTF-8 bytes, terminated with "#EOQ" on a line of it's own, results are returned, ending with "#EOR". Interacting with 4store in this way is more efficient than using the SPARQL protocol, but non-standard.
Examples
$ 4s-query -f sparql demo 'SELECT * WHERE { ?s ?p ?s } LIMIT 10'
Return 10 random triples from the knowledgebase "demo" in the SPARQL XML result format.
$ 4s-query -P demo < query.rq
Run the query in query.rq and output the result to stdout