-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix issues in SHACL #526
base: main
Are you sure you want to change the base?
Fix issues in SHACL #526
Conversation
A SHACL node shape cannot be a subclass of another shape. Intention of rdfs:subClassOf is to enforce that the child should be valid against the shape of parents too. For this purpose we should use sh:node https://www.w3.org/TR/shacl/#NodeConstraintComponent
In SHACL it is not allowed to have multiple sh:pattern in a single PropertyShape. For this reason, for each regular expression pattern, we need to create a separate PropertyShape.
Solve issue as discussed in aas-core-works#519
rdf:type without declaring prefix would cause issue in some validators. Using URI wihout prefix would solve this.
shacl-schema.ttl.txt |
I can not approve the PR as the changes itself target the python code - and I have simply no clue what is going on. However, on the level of RDF and the improvements that you, @mhrimaz, propose, I am completely aligned and support these changes. |
This is highly needed, was just going to open an issue regarding the LangString errors in the shacl file but found that it has already been found here.... |
@mhrimaz @sebbader-sap @JaFeKl please apologize the radio silence; it's a lot going on. We should have pretty soon (1-4 months) dedicated maintainers for aas-core RDF and SHACL schemas. Till then, the main focus is on V3.1 and testing. Pull requests are welcome & I volunteer to mentor anybody who would like to make the necessary changes. |
@mristin great to hear that!! |
This pull request fixes some critical issues in the current SHACL #519 and also some of the mentioned issues in admin-shell-io/aas-specs#421
Regarding #519
We had:
Now we have:
Which means: previously we had to have
<https://admin-shell.io/aas/3/0/LangStringDefinitionTypeIec61360/text>
as predicate (DatatypeProperty) for instances ofaas:LangStringDefinitionTypeIec61360
. However, in the generated sample data, and also in the ontology this predicate is missing. So instead of using concrete class in the predicate we should use the abstract class name. IMO, data and ontology are fine and we don't need to change them, SHACL is actually wrong and we can fix it with less side effects (I hope).Having multiple pattern in a PropertyShape is not allowed. Two duplicate property path created. Of course this is redundant, and having generic printable regex when other patterns are much more restrictive is unnecessary. People can remove that extra PropertyShape for performance reasons.
We had:
Now we have:
Which means: previously it wasn't possible to validate the shacl against the shacl-shacl (shacl metamodel or shacl-shacl) for example using
pyshacl -m
flag throws an error when you have twosh:pattern
.We had:
Now we have:
Which means: previously
rdfs:subClassOf aas:AbstractLangStringShape ;
had no effect, since we don't have sub classing in SHACL, and rather we should usesh:node
to state that another NodeShape should hold.They are removed.
@mristin I am not aware of all aspects, feel free to modify, change, refactor the code. I haven't added the generated shacl.