Bring shacl annotations closer to root classes in datalad-concepts #11
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
orinoco/tools#11
Loading…
Add table
Add a link
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?
Original issue: https://github.com/psychoinformatics-de/shacl-vue/issues/24
"Moved" here since this involves the integration between
dlcoandshacl-vue, and since the code for generating SHACL from UI-annotated schemas is now in this repo.The first order of business is to start annotating
Thingand other recently updated base classes, run the pipeline to generate annotated shacl schemas, and then see how the forms look.Update: ui annotations work fine on base classes.
The challenge is dealing sensibly with inheritance and the context within which the annotations of arbitrary classes/mixins will be used. This is not generally an issue for annotations like
titleor annotations that influence component rendering type, but more so for annotations that specify which group of slots a particular slot should belong to, and in which order a slot should appear in said group. If annotations should be self-contained per class/mixin, then one would e.g. say forThingMixinthattypeshould havesh:order: 0andschema_typeshould havesh:order: 1, while onThingclass itself one could say thatidshould havesh:order: 0. However, there will be a clash of positions because theThingMixinslots inherit their annotations into whichever context they are mixed into (or subclassed into for classes). So the question is then in which context annotations should be overwritten.Some background
A
sh:PropertyShape(derived from a slot) can have ash:order(via slot annotation), which will be interpreted within the context of thesh:PropertyGroup(defined globally) that the particular slot is assigned to usingsh:group(via slot annotation). Thesh:orderandsh:groupwill be inherited into new contexts when subclassing/mixing, unless the subclass overwrites these annotations usingslot_usage. Additionally,sh:PropertyGroupcan also havesh:orderto e.g. define in which order the groups should appear in their parent context, e.g. the order of groups of slots in a form.This means there is no problem whenever groups are unique to classes. Concretely, the
ThingMixincan haveThingMixinGroupand nothing else has that, and all is good. Importantly: each leaf class that is aThing(which also hasThingMixin) will also have theThingMixinGroup. So if users don't want that to be displayed in their form rendering, they will need to overwrite these annotations on their leaf class slots.