-
Notifications
You must be signed in to change notification settings - Fork 65
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
Validation does not work for classes that are also node shapes #38
Comments
@mgberg
If you're using a version of PySHACL older than v0.11.1, please upgrade to v0.11.1 or newer (preferrably always use the latest version). If there is a good reason you're deliberately using an older version, let me know and I might be able to backport the |
My computer thought v0.10 was the most up-to-date version. I upgraded and it works. Thanks! |
Hello again. If I run the following code:
no validation errors are reported. PySHACL is not inferring that the property shape applied to I have upgraded PySHACL to version 0.11.4. Thanks! |
Hi @mgberg You're not seeing those RDFS subclasses being applied to the data because the class relationships are declared in the SHACL Shapes file. When you enable inferencing, the process applies only to the data graph. The class relationships declared in the SHACL file don't affect it. This is why the "extra ontology graph" feature exists in pySHACL. You can give a third graph to the validator, this other graph can contain your extra ontological class relationships. It is mixed in with the data graph before inferencing occurs, so the RDFS inferencer has all of the required class information needed to expand the data graph. One easy fix for your code for now is to simply feed your SHACL Shapes graph to the ont_graph argument, like this:
|
I see, that does work. Thanks! |
@mgberg Heres an example of splitting them out into a separate graph:
|
If I run the following code:
no validation errors are reported. In order to force the error to be recognized, I have to explicitly declare
ex:Person sh:targetClass ex:Person
in the shapes graph which shouldn't be necessary.This is how TopQuadrant products represent classes and node shapes by default, so it would be great if pyshacl could support this.
The text was updated successfully, but these errors were encountered: