rdf-validate-shacl
rdf-validate-shacl copied to clipboard
Provide a CLI
Would it be nice to have a simple CLI provided by this package. I would propose a simple interface which would load data+shapes to memory and offer at least two output "modes"
Standard mode
Writes the validation report to standard output, optionally using type specified in --format
npx rdf-validate-shacl \
--shapes Person.shape.ttl \
--data people.nq \
--format application/ld+json
Without --format it would send n-quads so that the report can be piped easily to other tools
npx rdf-validate-shacl | other-cli-tool
Quiet mode
This would print nothing just return an exit code != 0 when validation failed
npx rdf-validate-shacl \
--shapes Person.shape.ttl \
--data people.nq \
--quiet
Globs for loading the graphs
npx rdf-validate-shacl --shapes shapes/*.ttl --data input/*
Given additional dependencies might go for a separate package? rdf-validate-shacl-cli is a big long but logical?
An option is to revive and improve https://github.com/zazuko/rdf-validate-cli to incorporate SHACL
Thank you for that. I like this idea
Another idea: add --data-graph and --shapes-graph options. This would allow loading a trig/n-quads file and selecting graph(s) for validating portion of the data
All those options should be allowed multiple times. For example
npx rdf-validate-shacl \
--shapes Person.shapes.ttl \
--shapes Company.shapes.ttl \
--data people.nq \
--data-graph https://example.com/person/Sheldon
--data-graph https://example.com/person/Amy
--quiet