Investigate changes in latest shacl generation code #555
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
orinoco/concepts#555
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The latest version of a shacl schema has missing parts of a property shape, see www/pool.psychoinformatics.de-ui#29
Specifically, looking at the
pidproperty shape on any class, it looks like:sh:datatypeentry is gonesh:minCountentry is gonesh:nodeKindhas changed tosh:IRII've tested
gen-shaclwith several different recent versions of linkml locally and can currently confirm the following:linkml-1.10.0
All parts that we originally expected to be there are still there (makes sense because we previously locked on
>=1.10.0)linkml-1.11.0-rc1
Introduced the changes for
sh:nodeKindandsh:datatype; looking at linkml release history it seems like this change was introduced by https://github.com/linkml/linkml/pull/3291. I will still look at this in more depth. A quick note is that ourpidslot has arange: uriorcurieand this is not explicitly mentioned in the PR (it rather stems fromnodeidentifiertype), although it could just be that the changed code also affecturiorcurie. Assuming that PR-introduced change is indeed more SHACL-compliant, we have nothing to do indatalad-conceptsand rather need to fix the reported "unknown editor" issue inshacl-vueitself (by updating theURIEditorcomponent matching criteria)Also see part of the diff:
linkml-1.11.0-rc2: introduced the
sh:minCountchangeSpecific PR: https://github.com/linkml/linkml/pull/3348
Diff:
I am not sure yet what to make of this, needs more investigation.
I am not sure that agree with the reasoning at
github.com/linkml/linkml@e29f2970b1/packages/linkml/src/linkml/generators/shaclgen.py (L206-L209), for our context, i.e.:Why exactly should it be prevented to also have an explicit property shape for the slot that has
identifier: trueon a class? I don't know exactly what is meant by "[it] would cause spurious violations on every instance".It could be a possibility that we make the
pidslot required explicitly in our schema:I tested this locally and it brings back the
sh:minCount. But do we specifically want this. I am not sure if we excluded this by design or implicitly knew thatidentifier: truealso made it required which then mapped tosh:minCount: 1in SHACL (which is not anymore the case in linkml-v1.11.0-rc2 and later)Interrupting my own thought process here: while I was busy trying to change the shaclgen code to include/exclude the
and not s.identifierpart, in order to compare the outputs when running it locally, I saw that our shaclgen patches, or parts thereof, are rejected. Specifically, the following is rejected:This is likely because of substantial changes in the linkml source in latest vs when the patches were created. e.g. the serialize part in the source is now:
This means: need to update patches... (there will likely be some fallout because of the prefixes not being included in shacl-vue anymore)
Interrupting my own thought process AGAIN:
Exporting shacl with the latest state of linkml
mainrendered exported SHACL in the following format:For v1.11.1 it is in the format:
These are both valid TTL, but I am not sure if
shacl-tulipwill actually correctly read the former. It could be related to something that was a TODO since the beginning: orinoco/shacl-vue#7. Hopefully it just works, but better to check before the next linkml release and our subsequent dependency update.