RDFLib / pySHACL

A Python validator for SHACL
Apache License 2.0
246 stars 63 forks source link

Evaluation path too deep #70

Closed rapw3k closed 3 years ago

rapw3k commented 3 years ago

Hi, I am trying to use the pyshacl to validate some data graphs against our SHACL specification. I like the options that pyshacl provides to include for example inferencing, allow imports or linking to the ontology.

However I cannot make even simple validation work.

pyshacl -s -m -i rdfs -a -j -f human

The shape is here: https://raw.githubusercontent.com/rapw3k/DEMETER/master/models/SHACL/demeterAgriProfile-SHACL.ttl The example data graph is here: https://box.psnc.pl/f/c95eb51962/?raw=1

I validated the shape in correct using https://www.itb.ec.europa.eu/shacl/shacl/upload

thanks

ashleysommer commented 3 years ago

Hi @rapw3k Thanks for the report. It looks like a change in the master shacl.ttl file published by the W3C has broken PySHACL's "MetaSHACL" feature. That is causing the "Evaluation Path Too Deep" error you are seeing. That bug will be fixed in the next version of PySHACL.

For now, you can get around this by simply removing the -m flag from your run command. That will turn off the MetaSHACL feature, and allow your validation to work normally.

However, after trying that, I am now seeing an error in your SHACL Shapes file.

pyshacl.errors.ShapeLoadError: A shape defined as a PropertyShape must be the subject of a 'sh:path' predicate.

In your Shapes file, the PropertyShape at <https://astrea.linkeddata.es/shapes#7c708841b8b6a556648a36e2070312bc> does not have a sh:path property that is causing pySHACL to throw a ShapeLoad error. https://www.w3.org/TR/shacl/#property-shapes

A property shape is a shape in the shapes graph that is the subject of a triple that has sh:path as its predicate. A shape has at most one value for sh:path. Each value of sh:path in a shape must be a well-formed SHACL property path.

ashleysommer commented 3 years ago

fixed by https://github.com/RDFLib/pySHACL/commit/4fcf5d9c9de9ec0b4f25c2e0de9f7620ae6ca820 Released as v0.14.3