CLI Reference¶
The reasonable binary loads one or more RDF files, runs OWL 2 RL
materialisation, and writes the result to disk.
Install¶
cargo install reasonable-cli
# or build from the workspace after cloning:
cargo build -p reasonable-cli --release
./target/release/reasonable --help
Usage¶
reasonable [OPTIONS] <INPUT_FILES>...
Arguments:
<INPUT_FILES>... One or more Turtle or N3 input files
Options:
-o, --output-file <FILE> Output file [default: output.ttl]
--error-format <FMT> Diagnostic output format: text | json | ndjson [default: text]
--fail-on <CODES> Exit with code 2 if any of these rule codes occur
--max-diagnostics <N> Limit the number of diagnostics printed
--summary-only Print only a count of diagnostics, not individual messages
-h, --help Print help
-V, --version Print version
Basic example¶
reasonable Brick.n3 building_model.n3 -o result.ttl
All input files are merged into a single graph before reasoning begins.
Diagnostics¶
The reasoner records OWL 2 RL rule violations as diagnostics rather than aborting. By default they are printed to stdout in plain text after the output file is written.
Change the format with --error-format:
# machine-readable JSON array
reasonable model.ttl --error-format json -o out.ttl
# one JSON object per line (newline-delimited)
reasonable model.ttl --error-format ndjson -o out.ttl
Each diagnostic has four fields: code, rule, severity, and
message.
Failing on specific violations¶
Use --fail-on to exit with code 2 when a particular rule
violation is detected. Pass rule codes as a comma-separated list or
repeat the flag:
reasonable model.ttl --fail-on cax-dw,prp-pdw -o out.ttl
# codes are case-insensitive; OWLRL.* prefix is also accepted
reasonable model.ttl --fail-on OWLRL.CAX_DW -o out.ttl
Common diagnostic codes¶
Code |
Meaning |
|---|---|
|
Individual typed as two disjoint classes |
|
Pair of individuals violates |
|
Asymmetric property asserted in both directions |
|
Irreflexive property used with the same subject and object |
|
Individual typed as |
Limiting output¶
# print at most 10 diagnostics
reasonable model.ttl --max-diagnostics 10 -o out.ttl
# print only the total count, not individual messages
reasonable model.ttl --summary-only -o out.ttl
Environment¶
Set RUST_LOG to control log verbosity:
RUST_LOG=debug reasonable model.ttl -o out.ttl
The default level is info, which logs file load times and the total
reasoning duration.