Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

4s-query(1j) [debian man page]

4S-QUERY(1J)							      4store							      4S-QUERY(1J)

NAME
4s-query -- Run SPARQL queries on a 4store storage backend SYNOPSIS
4s-query kb-name [-f format] [-O optimisation-level] [-I insert-mode] [-r] [-s soft-limit] [-b base-URI] [-e] [-P] [query] -f Set the format to output results it, options are "sparql", "text", "json", and "testcase" -O, --opt-level Set the optimisation level of the query engine, in the range 0-3. -I, --insert Treat CONSTRUCT statements as INSERT statements. This feature is highly experimental and largly untested. -r, --restricted Enable query complexity restriction mode -s, --soft-limit Override default soft limit on search breadth -d, --default-graph Enable SPARQL default graph support -b, --base Set base URI for queries -e, --explain Return an explanation of the query planner's descisions -P Enable programatic IO mode 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, termi- nated 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. SEE ALSO
4s-import(1), 4s-httpd(1), 4s-backend(1), 4s-delete-model(1) STANDARDS
4s-query implements the SPARQL Query Language specification (aka. SPARQL/Query 1.0) and the SPARQL Result Format specification (aka. SPARQL/Results 1.0). Default graph support is no normally enabled, the --default-graph turns it on, as does speicfying FROM <default:> in the query. Data loaded with $ 4s-import kb --add -m default: uri/filename will be added to the default graph. 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 4store May 31, 2019 4store

Check Out this Related Man Page

TOQUET(1p)						User Contributed Perl Documentation						TOQUET(1p)

NAME
toquet - command-line RDF query tool SYNOPSIS
toquet [options] QUERY-URI [QUERY-BASE-URI] toquet [options] -e QUERY-STRING [QUERY-BASE-URI] toquet [options] --describe URI Options: --exec Q, -e Q Provide query as a string --describe U Describe URI <U> --input L, -i L Set query language to L --output 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, sparql11 (default), rdql. Graph output formats: rdfxml, n3, turtle, ntriples, rdfa, nquads, rdfjson, canonical. Binding output formats: xml, json, text, csv, excel, ods, html, xhtml, ssw-xml, ssw-json. 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. --describe Request a description of a particular URI. This overrides --exec. Multiple URIs can be provided. --input Query language. Default is 'sparql11' (SPARQL 1.1). Others are 'sparql' (SPARQL 1.0) and 'rdql'. --results, -r, --output, -o Specifies the output format. The synopsis of this manual page shows a list of input formats. Some output formats require Spreadsheet::Wright and additional modules to be installed. 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. SHEBANG!! toquet can be used as a shebang line of a SPARQL query file. e.g.: #!/usr/local/bin/toquet OPTS: -E http://dbpedia.org/sparql -o json PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?person ?name WHERE { ?person a foaf:Person ; foaf:name ?name . } Note that you need the "OPTS:" bit to pass command-line options. This is a workaround for a limitation in Linux's shebang handling. 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. A toquet is a small bonnet-like hat. 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. perl v5.10.1 2010-10-04 TOQUET(1p)
Man Page