Open TallTed opened 5 months ago
Some thoughts: https://afs.github.io/shacl-datasets.html
Here is what we came up with for RDF4J:
[
a rsx:DataAndShapesGraphLink;
rsx:shapesGraph <http://example.com/ns#shapesGraph1>;
rsx:dataGraph ex:dataGraph, ex:dataGraph2;
]
There can be multiple shape graphs and multiple data graphs. The validator will union the shapes graph and parse those, the validate the shapes against the union of the data graphs.
A good thing about this approach is that users can split up their shapes into multiple graphs, then select some of those graphs to validate certain parts of the data. An example could be a ex:relaxedShapesGraph
and a ex:strictShapesGraph
where some data graphs will need to follow only the relaxed shapes while others need to follow both the strict and the relaxed shapes. A second example could be where there are common vocabularies in separate graphs ex:internalVocabularies
and ex:commonVocabularies
and we want to validate ex:shapesGraph1
together with the vocabulary graphs, but separate from ex:shapesGraph2
.
In RDF4J users have to specify which named graphs can contain shapes. The ShaclSail will only parse shapes from those graphs. This allows users to validate untrusted data without having to worry that the data could contain shapes that would affect the validation. We also then require that any rsx:DataAndShapesGraphLink
nodes be the shapes graphs. An rsx:DataAndShapesGraphLink
needs to fully reside in a named graph, if it is split between two named graphs then we will ignore it.
Came up in https://github.com/w3c/vc-data-model/pull/1416#issuecomment-1915680267