I would like to simplify my SHACL definitions by reversing the relations between shapes, properties and groups.
A typical NodeShape
looks like this. Two properties in a group:
<>
a sh:NodeShape ;
sh:property
[
sh:name "Property 1" ;
sh:order 1 ;
sh:group <#Group> ;
] ,
[
sh:name "Property 2" ;
sh:order 2 ;
sh:group <#Group> ;
] ;
.
It becomes a little unwieldy when there are multiple groups and many properties because all of them are tangled in the sh:property
list of objects.
What I would like to achieve is to revers the relations a little using OWL rules so that I could type the RDF differently, but retain the equivalence with the above using reasoning.
<>
a sh:NodeShape ;
ex:group <#Group> ;
.
<#Property1>
sh:name "Property 1" ;
sh:order 1 ;
.
<#Property2>
sh:name "Property 2" ;
sh:order 2 ;
.
<#Group>
ex:property <#Property1>, <#Property2>
.
Is there a way to define ex:group
and ex:property
to infer the triples from first snippet?