apache / jena

Apache Jena
https://jena.apache.org/
Apache License 2.0
1.08k stars 643 forks source link

shacl validate exit code #1790

Open namedgraph opened 1 year ago

namedgraph commented 1 year ago

Version

4.7.0

Feature

shacl validate currently returns 0 exit code even when there are violations. Can this be changed to 1?

Are you interested in contributing a solution yourself?

Perhaps?

afs commented 1 year ago

/me Hoping for a PR to appear.

namedgraph commented 1 year ago

@afs so you agree it's a good idea? Afaik riot returns non-zero on failure, so this would be an alignment.

Is it around here it should happen? https://github.com/apache/jena/blob/main/jena-cmds/src/main/java/shacl/shacl_validate.java#L60

afs commented 1 year ago

Something like that. Not sure exactly where - it's been a long time since I looked at the cmd code.

(note some commands have the capbaility of not exiting so a java program can string them together. Not sure if shacl_validate is one of them.)