sparna-git / shacl-play

SHACL validation UI, SHACL documentation generator, SHACL generator from RDF.
http://shacl-play.sparna.fr
GNU Lesser General Public License v3.0
24 stars 15 forks source link

sh:ignoredProperties should be a list #142

Open nchauvat opened 1 month ago

nchauvat commented 1 month ago

Hi Thomas,

Here is a description of what I would think is a bug in the generation of shacl shapes from OWL.

To reproduce:

java -jar shacl-play-app-0.7.0-onejar.jar owl2shacl -i skos.owl -o skos_closed_schacl.ttl -s CLOSED

Running this shacl on SKOS data will generate violations for triples "my:thesaurus_term rdf:type skos:Concept".

If you change skos_closed_shacl.ttl to replace

sh:ignoredProperties rdf:type ;

with

sh:ignoredProperties ( rdf:type  ) ;

and run the validation again, the above violation disappears.

What do you tihnk ?

nchauvat commented 1 month ago

According to https://www.w3.org/TR/shacl/#ClosedConstraintComponent the value of sh:ignoredProperties has to be a SHACL List.

tfrancart commented 1 month ago

I think you are absolutely right. Lists are complicated to generate in SPARQL (can't remember the details). There is some code to post process the result of the SPARQL query : https://github.com/sparna-git/shacl-play/blob/master/shacl-play/src/main/java/fr/sparna/rdf/shacl/shaclplay/convert/ConvertController.java#L257