rudof node
rudof can be used to obtain information about nodes in an RDF graph.
For example, it is possible to show information about an RDF node in a graph. Given the following RDF graph:
prefix : <http://example.org/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
:a :name "Alice" ;
:birthdate "1990-05-02"^^xsd:date ;
:enrolledIn :cs101 .
:b :name "Bob", "Robert" .
:cs101 :name "Computer Science" .
You can directly download the file with:
curl -o simple.ttl https://raw.githubusercontent.com/rudof-project/rudof/refs/heads/master/examples/simple.ttl
We can obtain information about the node :a (or any other node) by running the following command:
rudof node --node "<http://example.org/a>" simple.ttl
You can write the previous command in a shorter form: -n instead of --node, and the prefixed name :a instead of the full IRI:
rudof node -n :a simple.ttl
Obtaining information from URLs
Most of the commands that require a filename can also be used with dereferentiable URLs. In case the filename starts by http:// or https://, rudof will try to get the contents of those URLs and process them.
So you can also run the previous example as:
rudof node -n :a https://raw.githubusercontent.com/rudof-project/rudof/refs/heads/master/examples/simple.ttl
Obtaining information from stdin
It is also possible to get the information directly from stdin by replacing the filename by a hyphen (‘-’) .
For example, if you type:
rudof node -n :a -
You can type the contents of an RDF file, followed by CTRL-D and rudof will process that as the input.
IRI normalization modes
The --node value is parsed as a ShapeMap node selector, which normally requires IRIs to be enclosed in angle brackets (<http://example.org/a>). For convenience, rudof supports two modes that control how plain strings are treated.
Lax mode (default)
In lax mode any string that contains :// and is not already wrapped in <> is automatically wrapped before parsing. This means the following two commands are equivalent:
rudof node -n "http://example.org/a" simple.ttl
rudof node -n "<http://example.org/a>" simple.ttl
Limitations. The :// heuristic is intentionally simple and will fail in some cases:
- URNs (
urn:isbn:0451450523),mailto:, anddata:URIs do not contain://and will not be auto-wrapped, causing a parse error. Use angle brackets explicitly for these schemes. - A prefixed name that contains
://(for exampleex:path//resource) is treated as a full IRI by mistake.
See IRI normalization internals for details and planned improvements.
Strict mode
Use --strict-iris to turn off normalization. Then angle brackets are always required, and a bare IRI gives a clear parse error. Use it in production pipelines, or if IRIs with schemes other than http appear.
rudof node -n "<http://example.org/a>" simple.ttl --strict-iris
Options
$ rudof node --help
Show information about a node in an RDF Graph
Usage: rudof node [OPTIONS] --node <Node> [DATA]...
Arguments:
[DATA]...
Options:
-n, --node <Node>
Node to show information (can be a URI or prefixed name)
-t, --data-format <FORMAT>
RDF Data format
[default: turtle]
[possible values: turtle, ntriples, rdfxml, trig, n3, nquads, jsonld, pg, html]
-b, --base <IRI>
Base IRI
--reader-mode <MODE>
RDF Reader mode
[default: strict]
[possible values: lax, strict]
-m, --show-node-mode <MODE>
Mode used to show the node information
[default: outgoing]
[possible values: outgoing, incoming, both]
--show-hyperlinks <SHOW_HYPERLINKS>
Show hyperlinks in the output
[possible values: true, false]
-p, --predicates <PREDICATES>
List of predicates to show (comma-separated, or repeat -p)
-d, --depth <NUMBER>
outgoing number of levels, default = 1
[default: 1]
--strict-iris
Require <> brackets around IRIs (strict mode). By default bare http://… IRIs are accepted (lax mode).
-c, --config-file <FILE>
Config file name
-o, --output-file <FILE>
Output file name, default = terminal
--force-overwrite
Force overwrite to output file if it already exists
--backend <BACKEND>
Choose which backend to load the input into.
- `memory` (default): parse into an in-process oxrdf::Graph. - `qlever`: launch a local QLever Docker container and index the input on disk. Requires the binary to be built with the `qlever` feature. - `lbug`: the connected LadybugDB property graph database (see `rudof connect`). Accepted here but not yet functional: rudof can derive a property graph from RDF (`load`/`ddl`) but cannot yet read one back out as RDF triples. - `endpoint=<URL_OR_NAME>`: query an external SPARQL endpoint by URL or by the name of an endpoint registered in the TOML config. See also the `--endpoint` / `-e` shortcut.
-e, --endpoint <URL_OR_NAME>
Shortcut for `--backend endpoint=<URL_OR_NAME>`.
Accepts either a full SPARQL endpoint URL or the name of an endpoint registered in the TOML config. Mutually exclusive with `--backend`.
--min-request-interval <MS>
Minimum milliseconds between two requests to the SPARQL endpoint (-e/--endpoint only); default: the endpoint's configured value, else 1100 for remote hosts and 0 for localhost
--max-concurrent-requests <N>
Maximum requests in flight at once to the SPARQL endpoint (-e/--endpoint only); default 1
--max-nodes-per-query <N>
Maximum nodes fetched per SPARQL query when prefetching a shapemap's nodes (-e/--endpoint only); 1 disables batching; default 20
--qlever-index-dir <DIR>
Directory for the QLever on-disk index, overriding `[rdf.qlever] index_dir` from the TOML config.
Only meaningful with `--backend qlever`. Naming a directory explicitly is how you find out (and share) where an index lives: pass the same directory again — from this machine or another rudof session pointed at the same path (e.g. a shared/mounted volume) — and the idempotent build step is skipped, going straight to serving. When unset, rudof resolves a per-input fingerprinted path under the platform cache dir and logs it at startup.
--html-extract <MODE>
RDF to read from HTML data: microdata, rdfa, jsonld or any (default: the config, else any)
[possible values: microdata, rdfa, jsonld, any]
-h, --help
Print help (see a summary with '-h')
See also
- RDF backends: where the data is (memory, QLever or a SPARQL endpoint).