psychoinformatics-de / shacl-vue

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

Adds a script and schema file for property group design and graph export #16

Closed jsheunis closed 1 month ago

jsheunis commented 1 month ago

Closes https://github.com/psychoinformatics-de/shacl-vue/issues/14

We want to end up with a single file containing LinkML-exported shacl of a schema, including UI (and other) annotations, and a list of sh:PropertyGroups that are used (also via annotations) to provide structure to the UI that will be autogenerated from the SHACL schema.

This PR/commit adds to files, a script and a schema for property groups. The script's docstring gives detailed insight:

Generate a serialized graph of triples from a LinkML-turned-SHACL schema and a separately specified list of property groups.

This script takes a LinkML schema with UI annotations and a data file containing a list property groups as input arguments and then:

  • validates the data file according to the LinkML schema located in this repository at 'tools/property_group_schema.yaml'
  • validates the UI-annotated schema (TODO)
  • converts the property groups in the data file to RDF
  • exports the UI-annotated schema to SHACL
  • combines the property groups and schema exports into a single graph
  • serializes the complete graph to a 'ttl' file

This allows a user to design the categorical structure of a user interface via an easy-to-edit YAML file, and end up with a single-file graph that can be used as input to the 'shacl-vue' user interface.

The idea is that a user:

  1. Authors their own LinkML schema with UI annotations
  2. Authors their own list of property groups in YAML file (see example)
  3. Runs the script:
python tools/gen_shacl_ui.py --schema ../datalad-concepts/src/sddui/unreleased.yaml --property-groups src/assets/sddui-shacl-groups.yaml