SolidLabResearch / FormGenerator

A form generator app with Solid - Google Forms but the Solid way
https://solidlabresearch.github.io/FormGenerator/
MIT License
11 stars 0 forks source link

Documentation of SHACL functionality/interpretation as a form #9

Open josephguillaume opened 3 months ago

josephguillaume commented 3 months ago

Hi,

I'm commenting to help document the SHACL format used (as I understand it). I hope that's ok and apologies if it is already somewhere.

SHACL is used by hard coding fields used for different sh:dataType and sh:nodeKind. This contrasts with e.g. https://datashapes.org/forms.html which annotates a SHACL shape with editors and viewers.

https://github.com/SolidLabResearch/FormGenerator/blob/d83b7d1b9c5fa9d288a25ecc6cec9aaf3d310c8d/app/routes/index.js#L338-L356

https://github.com/SolidLabResearch/FormGenerator/blob/d83b7d1b9c5fa9d288a25ecc6cec9aaf3d310c8d/app/routes/index.js#L539-L548

This approach means that what is generated is a SHACL shape, not just a form.

It also means that any extensions to the form generator will be limited by SHACL's expressivity - I think SHACL would need to be used in non-standard ways to allow for e.g. how RDF-form handles image selection, file upload or even differentiating plain text vs rich text editing?

smessie commented 3 months ago

Thanks for your comment @josephguillaume. This FormGenerator can generate form descriptions in multiple ontologies. One of those implemented ontologies is SHACL, which outputs a SHACL shape. However, 2 additional ontologies are implemented: the UI ontology and RDF-Form. And in fact, DASH could perfectly be another one, but at this time, it isn't though. (Which does not mean it wouldn't be a good idea.) I consider DASH to be a separate ontology as it extends SHACL, it should not replace SHACL, and I am convinced that being able to output a form description as a SHACL shape can still be beneficial, eg. when your renderer (or any other application) expects a SHACL shape.

This approach means that what is generated is a SHACL shape, not just a form.

When you select SHACL as output ontology, a SHACL shape will be outputted. However, this shape will also contain non-validating properties that, according to the SHACL spec, can be used for eg. form building.

It also means that any extensions to the form generator will be limited by SHACL's expressivity

Only if you select SHACL as output ontology. If you want to build a more expressive form, you should consider to choose for a different output ontology (at the top right), and that's exactly why I made the decision to support multiple ontologies.