FAIRDataPoint icon indicating copy to clipboard operation
FAIRDataPoint copied to clipboard

Add SHACL validation using SHACL-SHACL

Open MarekSuchanek opened this issue 2 years ago • 7 comments

supersedes #95

MarekSuchanek avatar Sep 19 '22 13:09 MarekSuchanek

@kburger there is some issue resulting in org.eclipse.rdf4j.sail.shacl.ast.ShaclUnsupportedException for the shacl-shacl.ttl (based on #95), any idea why that happends? 😕

MarekSuchanek avatar Sep 19 '22 13:09 MarekSuchanek

@kburger there is some issue resulting in org.eclipse.rdf4j.sail.shacl.ast.ShaclUnsupportedException for the shacl-shacl.ttl (based on #95), any idea why that happends? 😕

I'm guessing certain features in the shacl-shacl are not supported. https://rdf4j.org/documentation/programming/shacl/#supported-shacl-features states for example:

sh:path is limited to single predicate paths, e.g. ex:age or a single inverse path. Sequence paths, alternative paths and the like are not supported.

shacl-shacl contains a lot of those, so maybe that causes the exception to be thrown instead of a shacl violation report. One option is to postpone this feature until we have a library that supports it. Alternative is to slim down the shacl-shacl shapes to the supported features from rdf4j's shacl validation.

kburger avatar Sep 19 '22 14:09 kburger

shacl-shacl contains a lot of those, so maybe that causes the exception to be thrown instead of a shacl violation report. One option is to postpone this feature until we have a library that supports it. Alternative is to slim down the shacl-shacl shapes to the supported features from rdf4j's shacl validation.

Hmmm 🤔 Maybe having there an exclusion mechanism for all triples with predicates not listed in ShaclSail.getSupportedShaclPredicates() would be an actually good way to go. Even now, when someone creates a schema with unsupported predicates, the validation will always fail... What do you think?

MarekSuchanek avatar Sep 19 '22 15:09 MarekSuchanek

shacl-shacl contains a lot of those, so maybe that causes the exception to be thrown instead of a shacl violation report. One option is to postpone this feature until we have a library that supports it. Alternative is to slim down the shacl-shacl shapes to the supported features from rdf4j's shacl validation.

Hmmm 🤔 Maybe having there an exclusion mechanism for all triples with predicates not listed in ShaclSail.getSupportedShaclPredicates() would be an actually good way to go. Even now, when someone creates a schema with unsupported predicates, the validation will always fail... What do you think?

Worth a try. Would we then warn about unsupported triples and reject the shape? Or silently ignore them? (sounds like the worst option of the two).

kburger avatar Sep 20 '22 08:09 kburger

Worth a try. Would we then warn about unsupported triples and reject the shape? Or silently ignore them? (sounds like the worst option of the two).

That would require some validation reporting back what will be ignored... and some unsupported things are also a bit more complicated than just a predicate not in a list (as you indicated the one with sh:path or nested sh:property).

MarekSuchanek avatar Sep 20 '22 08:09 MarekSuchanek

@kburger It seems that after rebasing to the newest develop (with new version of RDF4J) this passes all tests. Question is whether we want to still improve something here...

MarekSuchanek avatar Aug 04 '23 07:08 MarekSuchanek

Next step: check error messages and possibly improve what is displayed in the client

MarekSuchanek avatar Aug 07 '23 11:08 MarekSuchanek