-
Notifications
You must be signed in to change notification settings - Fork 13
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
Inheritance of property classes through rdfs:subClassOf #144
Comments
Hello @vincentkelleher. Thank you for using the library and you kind words (credit for clownface goes to @bergos) Regarding inheritance, unfortunately the implementation is according to spec. This has been discussed multiple times. Also here, a mere month ago: #142. Please also refer to w3c/data-shapes#185 Since this is a recurring problem, maybe we should consider actually allowing some optional change in behavior, such as merging shapes graph with the data graph. @giacomociti |
merging shapes graph and data graph may be useful, we may add an opt-in configuration switch |
Hi @tpluscode & @giacomociti Thank you for the very quick response with some reading material for me this morning 😄 sh:subClassOf must be in the data graphI wasn't aware that the specification was so clear about this and after reading chapter 2.1.3.2 Class-based Targets (sh:targetClass), which I mentioned above, I noticed the highlighted sentence:
Which confirms that the SHACL processors can also merge graphsI also had a look at the chapter which states that the SHACL processor must not modify the input graphs but it can build its own custom graph for validation purposes (if my understanding is correct.
This would mean that implementing a shapes and data graph merging opt-in configuration switch (as @giacomociti suggested) would be possible 💡 |
Since I got your feedback, I have updated our project to load the ontology into a dataset that is then filtered to only keep Everything seems to work fine and your implementation is flawless 👌 Thank you for your help, I'm closing this to avoid filling your issues tab with open issues 😇 |
Hi 👋
We've been using your library at Gaia-X for some time now and it has been very convenient, Clownface is also awesome 👍
Our case
I've found a case that doesn't seem to be managed by the library when properties have an
sh:class
that is a parent of the actual property class value.Example
To make sure I wasn't creating an issue for nothing I cloned your repository and wrote a specific test case to simulate our case:
Expected behavior
In this test case I'm expecting the validation report to be conformant as
MainClass
expectsex:bottom
to be of typeex:TopClass
and thatex:bottomInstance
is a child ofex:TopClass
.This behavior is specified in the 2.1.3.2 Class-based Targets (sh:targetClass) chapter of the SHACL specification.
What I saw
I noticed that the
validateClass(..)
method callsisInstanceOf(..)
with nodes coming from the$data
graph.In our case, this won't work as the
rdfs:subClassOf
information is available in the$shapes
graph.Maybe using the shapes graph in addition to the data graph to build a class hierarchy could be a solution to this ?
The text was updated successfully, but these errors were encountered: