I am currently trying to build a constraint validation shape for an incoming object of the type rdf:Seq
. The shacl
shapes I have used, use the path to identify triple and then add additional constraint validations on datatype, length and count. But, with the case of rdf:Seq
the predicate is a variable, it can be rdf:_1, rdf:_2,.... . How can I build an effective shape where I would not know how many elements would be present in the incoming rdf:Seq
object?
Or is there a way I can check that if the predicate is of the type rdfs:ContainerMembershipProperty
I can validate the datatype
of the data, otherwise ignore it?
Appreciate any help. Thanks!
Let's say for a given incoming data
...
<incoming node> schema:colors _:blankNode1 .
_:blankNode1 rdf:type rdf:Seq .
_:blankNode1 rdf:_1 "Red" .
_:blankNode1 rdf:_2 "Blue" .
_:blankNode1 rdf:_3 "Yello" .
...
What could the shape be? I was trying the following
...
sh: property [
sh:path schema:colors ;
sh:class rdf:Seq ;
sh:property [
sh:path <ideally would like a regex here> ;
# or a way to identify the path to data tripe
sh:in ("Red" "Blue" "Green" ) ;
] ;
] ;
...