psychoinformatics-de / shacl-vue

https://psychoinformatics-de.github.io/shacl-vue/
MIT License
0 stars 0 forks source link

Figure out hierarchical grouping of property shapes using `sh:group` #11

Closed jsheunis closed 2 days ago

jsheunis commented 1 month ago

The idea here is to render properties by category in a form, i.e. all properties that belong to the same topical grouping should be grouped together physically in the form.

On the face of it, this seems straightforward with the use of the sh:group attribute on a property shape that points to a sh:PropertyGroup class instance. E.g.:

dlco:BasicPropertyGroup a sh:PropertyGroup ;
    rdfs:label "Basic" ;
    sh:order "0"^^xsd:decimal ;
        rdfs:comment "" .

and

dldist:Distribution a sh:NodeShape ;
    sh:closed true ;
    sh:description "A specific representation of data, which may come in the form of a single file, or an archive or directory of many files, may be standalone or part of a dataset." ;
    sh:ignoredProperties ( rdf:type ) ;
    sh:property [ sh:datatype xsd:string ;
            sh:description "Name of a thing." ;
            sh:maxCount 1 ;
            sh:order 0 ;
            sh:path dlthing:name ;
            sh:name "Name" ;
            sh:group dlco:BasicPropertyGroup ],
...

But there are some intricacies to deal with in real data:

jsheunis commented 2 days ago
  • sh:PropertyGroups aren't linked concretely to specific node shapes => their use depends on where they are defined in properties by means of the sh:group attribute, which is a property shape characteristic. Practically, this means one can't just use all available sh:PropertyGroup instances in a graph and assume that together they define how a form is to be rendered. One has to take it from the context of the focus node, i.e. which node shape is used to render the root of the form (e.g. Data Distribution), and which property shapes does it have that include the sh:group attribute. These would make up the list of sh:PropertyGroup instances that should be used to render the form.
  • What to do with properties that do not have an sh:group attribute? IDEA: implement a default property group, where all such properties are superficially linked to. These should probably still be rendered in order based on sh:order.

These have both been addressed in the current implementation, exactly as described by these bullets.