-
Notifications
You must be signed in to change notification settings - Fork 89
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
gen-SHACL "target class" vs "Shape name" #2084
Comments
You can pass the https://linkml.io/linkml/generators/shacl.html#cmdoption-gen-shacl-s @linkml/developers - this issue should not be closed until either a FAQ entry and/or the shaclgen docs make this behavior a bit less hidden. |
Thanks, @cmungall for the advice, but I am sorry to say that this is not the fix I was hoping for. Command line options like --suffix, --close a.s.o. force a behavior on all linkML classes which should not be the intended solution. In SHACL I might want to have one class It would restrict using LinkML's gen:shacl converter in some instances. For example, if I want to create a new shape in my domain, let's call it I hope there is a fix for this possible because I hope to use linkML in some data pipelines where we want to validate metadata in json as well as rdfs/SHACL formats, and therefore LinkML would be a perfect tool and thanks again for the help. |
apologies, should have read more closely. Would this be acceptable: classes:
dcat_dataset:
class_uri: dcat:Dataset
annotations:
shape: dcat:DatasetShape leading to: dcat:DatasetShape a sh:NodeShape ;
sh:closed true ;
sh:ignoredProperties ( rdf:type ) ;
sh:targetClass dcat:Dataset . I think we should keep |
Yes, this should fix the current problems and also not disturb the I just have the remark that the annotation |
Describe the bug
When trying to create a SHACL shape with the LinkML generator the LinkML template currently does not differentiate between the target class and the SHACL shape name. However, SHACL neither requires nor intends to always have a SHACL shape which also is its own shape. Therefore a "target class" should be added similar to the "class_uri" attribute ( sorry if this is not the right LinkML nomenclature...) .
To reproduce
Steps to reproduce the behavior:
LinkML_issue_HB.yaml
to
LinkML_Issue_HB.shacl.ttl
dcat:Dataset a sh:NodeShape ;
...sh:targetClass dcat:Dataset
'Expected behavior
While it is acceptable to create classes in a SHACL file (a sh: class a.s.o.), a shape typically is not equivalent to its target class. A SHACL shape most often validates the axioms of a target class but is not required to fully depict all axioms of a target class. Accordingly, a SHACL shape can check for only a part of the axioms of a target class, for example, to ensure computational efficiency or extensibility.
LinkML should therefore either have an additional attribute similar to the
class_uir:
which then might be calledtarget_uri
or should use the LinkML class name as the shape name. Please look at the examples below:1st recommendation (would be more feasible since the Shape could carry a prefix):
should lead to:
2nd possibility (not recommended as this limits the SHACL shape to having just the default prefix as a prefix):
should lead to:
About your computer (if applicable, please complete the following information):
The text was updated successfully, but these errors were encountered: