AW: Re: shapes-ISSUE-83 (multiple sh:qualifiedValueShapes): How should multiple definitions of sh:qualifiedValueShape of a property constraint be treated? [SHACL Spec]

    
I know.. But it should raise an error because qualifiedvalueshape was defined twice ;)
simon

-------- Ursprüngliche Nachricht --------
Von: Axel Polleres <axel.polleres@wu.ac.at> 
Datum: 21.08.2015  13:29  (GMT+01:00) 
An: Simon Steyskal <simon.steyskal@wu.ac.at> 
Cc: Holger Knublauch <holger@topquadrant.com>, public-data-shapes-wg@w3.org 
Betreff: Re: shapes-ISSUE-83 (multiple sh:qualifiedValueShapes): How should   multiple definitions of sh:qualifiedValueShape of a property constraint be   treated? [SHACL Spec] 

Hi Simon,

It's not surprising that this doesn't raise an error, since just repeating 

> sh:qualifiedMinCount 1 ;

is the same as writing it once... or twice, or 10 times... this is RDF, i.e. *sets* of triples :-)

i.e. the problem is the modeling of having sh:qualifiedMinCount at the same level as sh:qualifiedValueShape ... this can't work as soon as you have several
sh:qualifiedValueShape, you need to nest sh:qualified...Count needs to be a property of the sh:qualifiedValueShape, and not of the overall shape.

best,
Axel
--
Prof. Dr. Axel Polleres
Institute for Information Business, WU Vienna
url: http://www.polleres.net/  twitter: @AxelPolleres

> On 21 Aug 2015, at 12:47, Simon Steyskal <simon.steyskal@wu.ac.at> wrote:
> 
> Hi!
> 
> I've tried it with TopBraid & your API but both don't complain when evaluating the following:
> 
>    ex:QualifiedValueShapeExampleShape
>        a sh:ShapeClass ;
>        sh:property [
>            sh:predicate ex:parent ;
>            sh:minCount 3 ;
>            sh:maxCount 3 ;
>            sh:qualifiedValueShape [
>                sh:property [
>                    sh:predicate ex:gender ;
>                    sh:hasValue ex:female ;
>                ]
>            ] ;
>            sh:qualifiedMinCount 1 ;
>            sh:qualifiedValueShape [
>                sh:property [
>                    sh:predicate ex:gender ;
>                    sh:hasValue ex:male;
>                ]
>            ] ;
>            sh:qualifiedMinCount 1 ;
>        ] .
> 
>      ex:test a ex:QualifiedValueShapeExampleShape ;
>       ex:parent [ ex:gender ex:female ] ;
>       ex:parent [ ex:gender ex:female ] ;
>  ex:parent [ ex:gender ex:female ] .
> 
> (They do however raise an error, if minCount/maxCount are violated.)
> 
> simon
> 
> ---
> DDipl.-Ing. Simon Steyskal
> Institute for Information Business, WU Vienna
> 
> www: http://www.steyskal.info/  twitter: @simonsteys
> 
> Am 2015-08-21 12:26, schrieb Holger Knublauch:
>> On 8/21/2015 17:13, RDF Data Shapes Working Group Issue Tracker wrote:
>>> shapes-ISSUE-83 (multiple sh:qualifiedValueShapes): How should multiple definitions of sh:qualifiedValueShape of a property constraint be treated? [SHACL Spec]
>>> http://www.w3.org/2014/data-shapes/track/issues/83
>>> Raised by: Simon Steyskal
>>> On product: SHACL Spec
>>> Hi!
>>> The current specification does not specify how multiple sh:qualifiedValueShapes should be treated when they are used within a single property constraint.
>>> For example, if I want to specify that there must exist exactly 3 values for ex:parent where at least 1 of them must be ex:female (and ex:male respectively), the current specification does not prohibit me from writing something like this:
>>> ex:QualifiedValueShapeExampleShape
>>>  a sh:Shape ;
>>>  sh:property [
>>>   sh:predicate ex:parent ;
>>>   sh:minCount 3 ;
>>>   sh:maxCount 3 ;
>>>   sh:qualifiedValueShape [
>>>    sh:property [
>>>     sh:predicate ex:gender ;
>>>     sh:hasValue ex:female ;
>>>    ]
>>>   ] ;
>>>   sh:qualifiedMinCount 1 ;
>>>   sh:qualifiedValueShape [
>>>    sh:property [
>>>     sh:predicate ex:gender ;
>>>     sh:hasValue ex:male;
>>>    ]
>>>   ] ;
>>>   sh:qualifiedMinCount 1 ;
>>>  ] .
>> This is syntactically invalid, although I believe this was not
>> explicitly stated in the text document of the spec. The Turtle file
>> has sh:AbstractArgumentMaxCountConstraint with the corresponding test.
>> Since it's already beer-o-clock here, could you double-check that you
>> get a constraint violation when you validate the snippet above? It
>> should flag the duplicate value for sh:qualifiedValueShape.
>> Meanwhile I have added a sentence to make clear that template
>> instances can at most have one value per argument predicate.
>> To express what you want, use two different sh:property blocks
>> ex:QualifiedValueShapeExampleShape
>>  a sh:Shape ;
>>  sh:property [
>>   sh:predicate ex:parent ;
>>   sh:minCount 3 ;
>>   sh:maxCount 3 ;
>>   sh:qualifiedValueShape [
>>    sh:property [
>>     sh:predicate ex:gender ;
>>     sh:hasValue ex:female ;
>>    ]
>>   ] ;
>>   sh:qualifiedMinCount 1 ;
>>  ] ;
>>  sh:property [
>>    sh:qualifiedValueShape [
>>    sh:property [
>>     sh:predicate ex:gender ;
>>     sh:hasValue ex:male;
>>    ]
>>   ] ;
>>   sh:qualifiedMinCount 1 ;
>>  ] .
>>> Of course, one way to approach that would be to use sh:AndConstraint for >1 qualifiedValueShapes, but that's not explicitly mentioned in the draft.
>>> btw. there is a typo in the code example of the draft ->
>>> sh:predicate [
>>>  sh:predicate ex:gender ;
>> Thanks, both fixed on my current branch:
>> https://github.com/w3c/data-shapes/commit/da1819e33f24b3a26f140bac412fe36385e6f963
>> Holger
> 

Received on Friday, 21 August 2015 11:40:41 UTC