ISSUE-133: Proposals on multi-occurrence

One of the aspects of ISSUE-133 is the question of whether a constraint 
parameter (such as sh:class) can occur multiple times in the same 
constraint. The example given is

ex:MyShape
     a sh:Shape ;
     sh:property [
         sh:predicate ex:myProperty ;
         sh:class ex:class1 ;
         sh:class ex:class2 ;
     ] .

This can be (easily) added to the existing SHACL syntax. There is no 
real reason why these properties may only show up once. If they show up 
twice, then the constraint could just be executed two times.

If we wanted to allow this, the only remaining question would be how to 
handle cases of multiple parameters, e.g. sh:pattern/sh:flags.

Option a) We only allow multi-occurrence of single-parameter constraint 
types

Option b) We execute all combinations, e.g.

sh:property [
     sh:predicate ex:property ;
     sh:pattern "p1" ;
     sh:pattern "p2" ;
     sh:flags "i" ;
]

would mean that the sh:flags "i" applies to both patterns.

I see no issues with either approach. No change to the metamodel of 
Proposal 3 would be needed. No change to the syntax either.

We could add

sh:parameter [
     sh:predicate sh:minCount ;
     sh:maxCount 1 ;
]

to those that can only be used once per constraint.

Cheers,
Holger

Received on Friday, 11 March 2016 05:10:32 UTC