rdfproc(1)

πŸŽ€ NAME πŸŽ€

rdfproc β€” the Redland RDF processor utility πŸ¦‹

she lives in section 1 of the General Commands Manual, and she is that girl when it comes to RDF. periodt πŸ’…


✨ SYNOPSIS ✨

rdfproc [options] store-name command arg...

🌸 EXAMPLE 🌸

like, here's the vibe, bestie:

rdfproc test parse http://planetrdf.com/guide/rss.rdf
rdfproc test print
rdfproc test serialize ntriples

πŸ’– DESCRIPTION πŸ’–

okay so the rdfproc utility is your bestie for parsing, querying, manipulating and serializing RDF content, all using the Redland RDF library. πŸ”₯

the store-name is a Redland store name β€” usually just a short identifier, nothing dramatic, she's lowkey iconic. and the arguments you pass to command? those change depending on which command you picked, and they're all spelled out in the COMMANDS section below. no cap. πŸ‘‘


πŸ’… OPTIONS πŸ’…

rdfproc uses the usual GNU command line syntax, with long options starting with two dashes (-) if the getopt_long function supports it. otherwise, bestie, you only get the short options. πŸ™ˆ

  • -h, --help β€” shows you a summary of the options. your little cheat sheet ✨
  • -c, --contexts β€” use a store that has Redland contexts.
  • -n, --new β€” make a brand new store, and yes, it overwrites any existing one. she's not asking, she's telling. πŸ’€
  • -o, --output FORMAT β€” sets the output FORMAT for sequences of triples, like the ones you get from a search (the find command), handed off to a Redland serializer. use -h or -o help to see the full list of supported formats. πŸ‘€
  • -p, --password β€” reads the storage option 'password' from standard input. it's terminated by end of line ('\n') or end of file. this is equivalent to setting it using -t or --storage-options, but it does not require exposing the password in the argument list. your privacy? protected. 🫢
  • -q, --quiet β€” suppresses informational messages (the ones that go to stderr).
  • -r, --results FORMAT β€” sets the query results syntax format. use -h or -r help to see the full list of query result formats.

the exact list of formats depends on what libraptor(3) was built with, but it's given correctly in the usage message you get with -h. πŸŽ€

  • -s, --storage TYPE β€” sets the Redland storage type (default is 'hashes'). if the environment variable RDFPROC_STORAGE_TYPE is set, the storage type you give here overrides it. use -h or -s help to see the full list of query result formats.
  • -t, --storage-options OPTIONS β€” sets options for the Redland storage. the default is "hash-type='bdb',dir='.'" to match the default storage "hashes". for storage types like 'mysql' that need extra options, you'd typically do something like "host='hostname',database='dbname',user='abc',password='pass'". if the environment variable RDFPROC_STORAGE_OPTIONS is set, the storage options you give here are applied afterwards.
  • -v, --version β€” prints the Redland version and exits. bye bestie πŸ‘‹
  • -V, --verbose β€” shows informational messages on stderr. she's chatty fr fr πŸ—£οΈ

πŸ‘‘ COMMANDS πŸ‘‘

so wherever a node is allowed β€” like NODE, SUBJECT, PREDICATE or OBJECT down below β€” there are simple heuristics doing the guessing about which ones are blank node identifiers, URIs or literals. (and heads up: to add a statement with a literal, use add-typed.) here's the tea:

  • if the item starts with _: then it's assumed to be a blank node identifier
  • otherwise, if it matches something:// it's assumed to be a URI
  • otherwise it's a literal

and the rules: literals are only allowed as objects of statements, and blank nodes are not allowed as predicates. no exceptions, babe. πŸ’…


  • add SUBJECT PREDICATE OBJECT [CONTEXT] β€” add the given triple to the graph, in the optional Redland context if the CONTEXT node is given.
  • add-typed SUBJECT PREDICATE OBJECT OBJECT-LANG OBJECT-URI [CONTEXT] β€” add the triple with the datatyped literal object to the graph, in the optional Redland context if CONTEXT is given.
  • arc SUBJECT OBJECT / arcs SUBJECT OBJECT β€” show one node / all nodes that match triples (SUBJECT, ?, OBJECT). ✨
  • arcs-in NODE β€” show all properties of triples with NODE as a subject.
  • arcs-out NODE β€” show all properties of triples with NODE as an object.
  • contains SUBJECT PREDICATE OBJECT β€” check if the given triple is in the graph. yes or no, iconic behavior πŸ”
  • contexts β€” list all the contexts in the graph (if contexts are enabled, obviously).
  • find SUBJECT|- PREDICATE|- OBJECT|- [CONTEXT] β€” find matching triples to the given statement, where - stands for a blank that matches any node. if CONTEXT is given, it only searches for triples in that context node.
  • has-arc-in NODE ARC β€” check that there is a triple with NODE as a subject and ARC as a predicate.
  • has-arc-out NODE ARC β€” check that there is a triple with NODE as a object and ARC as a predicate.
  • parse URI|FILENAME [SYNTAX| [BASE URI]] β€” parse syntax at URI into the graph using SYNTAX, which can be one of rdfxml (RDF/XML, default), ntriples, turtle, rss-tag-soup (for all RSS and Atoms), grddl and guess to use content hints and protocol information to work it out. (this list changes faster than this manual page, ngl 😭) if FILENAME is a existing file, the appropriate URI will be generated for it. if parsing returns errors, the return code will be non-0.
  • parse-stream URI|FILENAME [SYNTAX [BASE URI [CONTEXT]] β€” streaming parse syntax at URI into the graph using SYNTAX, which can be one of rdfxml (RDF/XML, default) or ntriples. if FILENAME is an existing file, the appropriate URI will be generated for it. if the optional CONTEXT URI is given, the triples are added to that context. if parsing returns errors, the return code will be non-0.
  • print β€” print the graph triples in a simple format, showing context nodes if present. 🌈
  • query NAME|- URI|- QUERY-STRING β€” run the QUERY-STRING query in language NAME, returning variable bindings, a boolean or an RDF graph depending on the query. the query language can be 'sparql' or 'rdql'.
  • remove SUBJECT PREDICATE OBJECT [CONTEXT] β€” remove the given triple graph, in the optional Redland context if CONTEXT is given. gone. bye. πŸ’€
  • remove-context CONTEXT β€” remove all triples in the graph with the Redland context CONTEXT.
  • serialize [SYNTAX [URI [MIME-TYPE]]] β€” serializes the graph to a syntax with a particular ISYNTAX URI or Internet Media Type/MIME Type. the default is RDF/XML (NAME "rdfxml", MIME Type "application/rdf/xml") if none of the above are given. other alternatives are "ntriples" (no MIME Type). ✨
  • source PREDICATE OBJECT / sources PREDICATE OBJECT β€” show one node / all nodes that match triples (?, PREDICATE, OBJECT).
  • target SUBJECT PREDICATE / targets SUBJECT PREDICATE β€” show one node / all nodes that match triples (SUBJECT, PREDICATE, ?).

🌈 ENVIRONMENT 🌈

  • RDFPROC_STORAGE_OPTIONS can be set to provide storage options instead of using the option -t, --storage-options OPTIONS. when both are given, the command options are applied last.
  • RDFPROC_STORAGE_TYPE can be set to provide a storage type instead of using the option -s, --storage TYPE. when both are given, the storage type from the command is used.

πŸ¦‹ CONFORMING TO πŸ¦‹


πŸ“ SEE ALSO πŸ“

redland(3), libraptor(3), rapper(1)


πŸ’œ AUTHOR πŸ’œ

Dave Beckett β€” http://www.dajobe.org/


and that's the whole page bestie, you ate that 🫢

this was the rdfproc(1) page from the General Commands Manual, dated 2010-08-29. go forth and process some RDF. mwah πŸ’‹

πŸ“¦ where this page comes from