NAME

toquet - command-line RDF query tool

SYNOPSIS

  trapper [options] QUERY-URI [QUERY-BASE-URI]
  trapper [options] -e QUERY-STRING [QUERY-BASE-URI]
  
  Options:
    --exec Q, -e Q        Provide query as a string
    --input L, -i L       Set query language to L
    --results F, -O F     Set result format to F
    --endpoint U, -E U    SPARQL Protocol endpoint
    --data U, -D U        Data to query
    --named U, -G U       Named graph to query
    --dump-query F, -d F  Dump query in format F
    --count, -c           Count results only
    --quiet, -q           No extra information messages
    --help, -h            Show this help
    --version, -v         Show module versions
  
  Query languages: sparql, rdql.
  
  Graph output formats: rdfxml, turtle, ntriples,
                        rdfjson, canonical.
  Binding output formats: xml, json, text.
  Boolean output formats: xml, json, text.
  
  Dump formats: sparql, sse, parsed, pattern.

OPTIONS

--exec, -e

Provides the string to use as a query. May be in SPARQL or RDQL. (RDQL is even supported on remote endpoints which only speak SPARQL!)

If omitted, a query URI must be provided instead. This URI will be dereferenced (fetched) and a query is expected to be found inside (the HTTP Content-Type header is ignored).

The query base URI may be provided to allow the resolution of any relative URI references in the query.

--results, -r, --output, -o

Specifies the output format. The synopsis of this manual page shows a list of input formats.

Defaults are 'ntriples' (for graphs) and 'text' (for bindings and booleans).

--endpoint, -E

A SPARQL Protocol 1.0 endpoint to query.

--data, -D

Adds data from a URL to the default (unnamed) graph to be queried.

This option can be used multiple times, but cannot be used in conjunction with --endpoint.

--named, -G, --source, -s

Adds data from a URL to a named graph to be queried.

This option can be used multiple times, but cannot be used in conjunction with --endpoint.

--dump-query, -d

Dump the query itself (not the results).

Queries can be dumped as a SPARQL string (useful for interpolating relative URIs, or converting from RDQL), or as SSE. The parsed query (or just the graph pattern within it) can be dumped in YAML.

--count, -c

Suppresses the output of the data, and just shows a count of triples/bindings instead.

Boolean results (i.e. ASK queries) always return a count of 1.

--quiet, -q

Hides useless debugging messages.

--help, -h

Shows a short help message.

--version, -v

Shows the version of various Perl modules used by toquet. toquet itself doesn't have a version number, but is distributed along with RDF::TrineShortcuts, so could be considered to have the same version number as that.

NOTE

When possible, toquet attempts to use the same command-line options as the 'roqet' tool that is distributed with librasqal. However, full compatibility with roqet is not a goal, and is certainly not guaranteed.

AUTHOR

Toby Inkster, <tobyink@cpan.org>

COPYRIGHT AND LICENCE

Copyright (C) 2010 by Toby Inkster

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8 or, at your option, any later version of Perl 5 you may have available.