SHACL constraints on Turtle Input #59
Labels
enhancement
New feature or request
help wanted
Extra attention is needed
question
Further information is requested
Currently there is no validation done on turtle input except to check if it is valid rdf. SHACL would enable us to precisely define what is valid input and what not.
This would be a big undertaking since we would need to first define what constitutes valid input for the different cases we have and then also implement the shacl validation.
Luckily rdf4j provides us with an API to validate graphs. So we only need to supply the shacl rules.
These are all the instances where we have some turtle input where we would need to define validity:
Defining valid input
In the current version of yggdrasil, when creating a workspace / artifact through turtle, some signifiers are automatically added to the representation. These need to be accounted for when defining the valid input. Further during the process of creating the entity, the RdfStoreVerticle will parse through the rdf string and replace all empty "<>" IRIs with the IRI of the resource.
Workspace example
I left out the other signifiers for brevity, but when using yggdrasil with the hmas ontology and creating a workspace / artifact (slightly different but same functionality) with turtle, this skeleton representation will be created and then will be merged with the representation provided. A very simple but valid turtle request body could look like this:
This would result in a workspace much like the base one above with the one additional triple added to the resourceIri.
Validity
This list is not exhaustive and just a collection of possible constraints we could implement:
The text was updated successfully, but these errors were encountered: