roqet(1)

πŸ’– roqet(1) β€” the Rasqal RDF query utility, but make it make sense πŸ’–

okay bestie, listen up: this is a General Commands Manual page, and the command is literally called roqet. yes, really. it's the Rasqal RDF query utility and it's lowkey iconic once you know what you're doing. let's get into it πŸ¦‹


✨ NAME ✨

roqet β€” the Rasqal RDF query utility. that's it, that's the name, no notes πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

the many moods of roqet, fr fr:

roqet [OPTIONS] <query-URI> [base-URI]
roqet [OPTIONS]-e query-string [base-URI]
roqet [OPTIONS]-p sparql-protocol-service-URI query-URI [base-URI]
roqet [OPTIONS]-p sparql-protocol-service-URI [-e query-string ] [base-URI]
roqet [OPTIONS]-t query results file [base-URI]

🌸 DESCRIPTION 🌸

so the whole vibe is: roqet lets you query RDF content using the Rasqal RDF query library, and then it prints the results β€” variable bindings, RDF graph results, or boolean results β€” in a whole bunch of different formats. it's giving versatility, it's giving options, it's giving "why choose one output format when you can have seventeen" πŸ’…

the query gets read from query-URI, and if you hand over the optional base-URI, that becomes the base URI of the query. no base-URI? no problem, it's just optional, bestie.


πŸ‘‘ MAIN OPTIONS πŸ‘‘

roqet uses the usual GNU command line syntax β€” long options start with two dashes (-) if your getopt_long function supports it. if it doesn't? then bestie, only the short options are available. tragic but real 😭

  • -e, --exec QUERY β€” run the query string that's sitting right there in the QUERY argument instead of reading the query from a URI. this kicks in when -e / --exec is not given, iykyk.
  • -i, --input LANGUAGE β€” set the input query LANGUAGE to one of the supported languages. the list includes 'sparql' (SPARQL Query Language for RDF β€” and yes, that's the default), 'sparql11', and 'laqrs'. the full list of supported languages and subsets shows up in the help summary when you run -h / --help. go look, it's there ✨
  • -p, --protocol SERVICE-URI β€” call the SPARQL HTTP protocol SERVICE-URI to execute the query instead of running it locally inside the Rasqal query engine. (that local path happens when -e is given, or a query string is given.)
  • -r, --results FORMAT β€” set the query results output FORMAT. and okay, this one has ✨layers✨:
    • for variable bindings, the values of FORMAT depend on what Rasqal supports, but they include 'simple' for a simple text format (default), 'xml' for the SPARQL Query Results XML format, 'csv' for SPARQL CSV, 'tsv' for SPARQL TSV, 'rdfxml' and 'turtle' for RDF syntax formats, and 'json' for a JSON version of the results.
    • for RDF graph results, the values of FORMAT are 'ntriples' (N-Triples, default), 'rdfxml-abbrev' (RDF/XML Abbreviated), 'rdfxml' (RDF/XML), 'turtle' (Turtle), 'json' (RDF/JSON resource centric), 'json-triples' (RDF/JSON triples), or 'rss-1.0' (RSS 1.0, also an RDF/XML syntax).
    • the exact list of formats depends on what libraptor2(3) was built with, but it's given correctly in the usage message with -h. so like, check there before you fight me on it 🫢
  • -R, --results-input-format FORMAT β€” set the query results input FORMAT. this one is for use with -t, and it takes the values 'xml' for the SPARQL Query Results XML format,, 'csv' for SPARQL CSV,, 'tsv' for SPARQL TSV, and 'turtle' and 'rdfxml' for RDF syntax formats. (yes the double commas are canon, I don't make the rules πŸ™ˆ)
  • -t, --results-input FILE β€” read query results from FILE. that's the whole thing, she's simple, she's efficient, we love her πŸ’œ

πŸ”₯ OTHER OPTIONS πŸ”₯

  • -c, --count β€” only count the triples and produce no other output. minimalism as a lifestyle ⭐
  • -d, --dump-query FORMAT β€” print the parsed query out in a given FORMAT, one of 'none' (default), 'debug', 'structure' or 'sparql'.
  • -D, --data URI β€” add RDF data source URI (not a named graph). and important: if no data sources are given, the query itself must point to the data, like via SPARQL FROM uri statements. so like, one of you has to know where the data is, bestie 😭
  • -E, --ignore-errors β€” do not print error messages and do not exit with a non-0 status. living in denial, but make it a command-line flag 🫢
  • -f, --feature NAME(=VALUE) β€” set query feature NAME to the VALUE, or to integer 1 if VALUE is omitted. you can see the known features with -f help or --feature help.
  • -F, --format NAME β€” set the data source format NAME for subsequent data graphs called with -D / --data or -G / --named. if you don't specify it, the default is that the query engine just guesses. the name is a Raptor parser name, fyi.
  • -G, --named URI β€” add RDF data source URI (named graph). she's -D's named-graph cousin πŸ’…
  • -h, --help β€” show a summary of the options. bestie behaviour, honestly.
  • -n, --dryrun β€” prepare the query but do not execute it. all dressed up, nowhere to go πŸŽ€
  • -q, --quiet β€” no extra information messages. peace and quiet, finally.
  • -s, --source URI β€” add RDF data source URI (named graph) URI by adding it to the list of query data source URIs. FORMAT to 'simple' (default) or 'xml' (an experimental XML format).
  • -v, --version β€” print the rasqal library version and exit. iconic, brief, gone πŸ’¨
  • -W, --warnings LEVEL β€” set the warning LEVEL in the range 0 (do not warn about anything) to 100 (show every warning). the Rasqal default is in the middle (50). perfectly balanced, as all things should be βš–οΈ

🌈 EXAMPLES 🌈

the receipts, let's go:

roqet sparql-query-file.rq

run a SPARQL query contained in the local file sparql-query-file.rq. the data used would be described in FROM statements in the query file. no extra args needed, she just knows 🌸


roqet -q -i sparql http://example.org/sparql-query.rq

run a SPARQL query that's out there on the web at URI http://example.org/sparql-query.rq, without any extra messages (quiet, -q). no cap, that's it πŸ¦‹


roqet -q query-file.rq http://example.org/base/

run a query (default language SPARQL, as always) from a local file query-file.rq, but use base URI http://example.org/base/ to resolve any relative URIs. teamwork makes the dream work 🀝


roqet -q -i sparql -r xml http://example.org/sparql-query.rq

run a SPARQL query that's on the web at URI http://example.org/sparql-query.rq and format the results in the SPARQL Query Results XML format, with no extra messages. clean, pretty, done ✨


roqet -i sparql -e 'SELECT * WHERE { ?s ?p ?o }' -D stuff.rdf

run a SPARQL query given right there on the command line against data in the file stuff.rdf. the type of the file will be guessed, and likely it's the format RDF/XML. the classic "just guess, bestie" move πŸ™ˆ


roqet -t result.srx -r html

read SPARQL query results in the SPARQL Query Results XML format (the default), and print it in HTML. glow-up achieved πŸ’…


roqet -t result.ttl -R turtle -r csv

read SPARQL query results in RDF/Turtle format and print it in CSV. format in, format out, no drama ⭐


πŸ“œ CONFORMING TO πŸ“œ

this utility conforms to some very serious documents, and I'm listing every single one because we respect the standards in this house πŸ‘‘


🫢 SEE ALSO 🫢

librasqal(3), libraptor(3) β€” go read those when you want the deep lore.


πŸ’€ CHANGES πŸ’€

nothing listed here in the original, bestie. the section is just vibes and a heading. we move on πŸ™ˆ

🧚 AUTHOR 🧚

Dave Beckett β€” http://www.dajobe.org/ β€” thank you for your service, legend πŸŽ€


and that's the whole page!! this one came out on 2013-12-11, and it's page roqet(1) from the General Commands Manual. go query something, you absolute main character πŸ’–βœ¨

πŸ“¦ where this page comes from