Re: SHACL constraint on set of URI (sub)patterns

Hi Felix,

could you clarify one thing please: how do you define "subject" in these 
graphs. Does the rule apply to all subjects in the whole data graph, 
including for example owl:Ontology resources or classes, or is there a 
relation that you only want to apply to sh:targetSubjectsOf <p> ?

Holger


On 18/06/2019 3:31 pm, Felix Sasaki wrote:
> Hi all,
>
> I have a dataset with URIs in the subject position of triples as follows:
>
> <http://example.com/mydata/1> p o
> <http://example.com/mydata/2> p o
> <http://example.com/mydata/3> p o
> ...
>
> I would like to express the following constraints on all subject URIs:
>
> 1) The value of the URI pattern after "<http://example.com/mydata/" 
> must always be an integer (in the example 1, 2 or 3
> 2) The integer must be more than zero and less than the number of the 
> subject URIs. That is, the third triple from the below would be invald:
> <http://example.com/mydata/1> p o
> <http://example.com/mydata/2> p o
> <http://example.com/mydata/4> p o # this should  have been 3
>
> I tried to express this via  SPARQL constraint, but did not succeed. 
> Any hints on how to  express via SHACL would be nice - thanks.
>
> As some background for the use case: I am generating the URIs in an 
> automated fashion and want to assure that the generation always 
> follows the above constraints, to assure that after the generation no 
> existing URI is "lost" and to assure that new URis follow the pattern 
> described above.
>
> Regards,
>
> Felix

Received on Tuesday, 18 June 2019 05:55:51 UTC