Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a CLI #90

Open
tpluscode opened this issue Feb 25, 2022 · 4 comments
Open

Provide a CLI #90

tpluscode opened this issue Feb 25, 2022 · 4 comments

Comments

@tpluscode
Copy link
Collaborator

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/*
@tpluscode
Copy link
Collaborator Author

Given additional dependencies might go for a separate package? rdf-validate-shacl-cli is a big long but logical?

@martinmaillard
Copy link
Contributor

An option is to revive and improve https://github.com/zazuko/rdf-validate-cli to incorporate SHACL

@tpluscode
Copy link
Collaborator Author

Thank you for that. I like this idea

@tpluscode
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants