Re: example for disjoint qualified value shapes

I had not included another sh:maxCount 5 constraint because I felt it 
may add more confusion than benefits, yet if you insist I have now added 
such a constraint.

Holger


On 18/03/2017 1:52, Peter F. Patel-Schneider wrote:
> There is more wrong with the example, as I tried to indicate in my
> initial message.  If anything, the change made for more problems.
>
> An example that uses meaningful words should be plausible with respect to
> these words.  This example uses "hand", "digit", "thumb", and "finger" so
> it should abide by some plausible meaning for these words.
>
> The only reasonable plausible meaning for hand in the example is normal
> human hand.  So ex:HandShape should both state and enforce conditions
> that are true for normal human hands.  Neither of these are the case for
> either version of the example.
>
> A normal human hand has 5 digits.  Of these digits one is a thumb and
> four are fingers.  None of the digits can be both a thumb and a finger.
> Changing the text of the example to allow more than five digits is the
> wrong way to go.  Instead the shape should be changed to enforce the
> correct conditions or a different example chosen.
>
> A SHACL shape that enforces the conditions for normal human hand locally
> on instances of ex:Hand is
>
> ex:HandShape1 a sh:NodeShape ;
>    sh:targetClass ex:Hand ;
>    sh:property [ sh:path ex:digit ;
>      sh:maxCount 5 ] ;
>    sh:property [ sh:path ex:digit ;
>      sh:qualifiedValueShape [ sh:and ( [ sh:class ex:Thumb ]
>                     [ sh:class ex:Finger ] ) ] ;
>      sh:qualifiedMaxCount 0 ] ;
>    sh:property [ sh:path ex:digit ;
>      sh:qualifiedValueShape [ sh:class ex:Thumb ] ;
>      sh:qualifiedMinCount 1 ; sh:qualifiedMaxCount 1 ] ;
>    sh:property [ sh:path ex:digit ;
>      sh:qualifiedValueShape [ sh:class ex:Finger ] ;
>      sh:qualifiedMinCount 4 ; sh:qualifiedMaxCount 4 ] .
>
> There are several other SHACL shapes that express the same conditions
> without using sh:qualifiedValueShapesDisjoint.
>
> A SHACL shape that indirectly expresses these conditions using
> sh:qualifiedValueShapesDisjoint is
>
> ex:HandShape2 a sh:NodeShape ;
>    sh:targetClass ex:Hand ;
>    sh:property [ sh:path ex:digit ;
>      sh:maxCount 5 ] ;
>    sh:property [ sh:path ex:digit ;
>      sh:qualifiedValueShape [ sh:class ex:Thumb ] ;
>      sh:qualifiedValueShapesDisjoint true ;
>      sh:qualifiedMinCount 1 ; sh:qualifiedMaxCount 1 ] ;
>    sh:property [ sh:path ex:digit ;
>      sh:qualifiedValueShape [ sh:class ex:Finger ] ;
>      sh:qualifiedValueShapesDisjoint true ;
>      sh:qualifiedMinCount 4 ; sh:qualifiedMaxCount 4 ] .
>
> This version is slightly shorter than the previous shape, but slightly
> shortening a few shapes is not worth the extra complications that
> sh:qualifiedValueShapesDisjoint adds to SHACL.
>
> Peter F. Patel-Schneider
> Nuance Communications
>
> On 03/15/2017 05:31 PM, Holger Knublauch wrote:
>> If I understand your issue correctly, you are pointing out that such hands may
>> have other values in addition to the 5 expected ones, while the description of
>> the example was stating "... must have 5 values"? If that's all, I have added
>> "... must have *at least* 5 values". If there is anything else here please
>> clarify and point at specific sentences that are misleading.
>>
>> https://github.com/w3c/data-shapes/commit/a315a25c32e1cd21b36f21efa7d6799dd0a9f2e7
>>
>>
>> BTW your example doesn't work at all since you have used sh:digit instead of
>> ex:digit, but I have assumed the latter.
>>
>> Holger
>>
>>
>> On 16/03/2017 1:07, Peter F. Patel-Schneider wrote:
>>> The example shapes graph using of sh:qualifiedValueShapesDisjoint does not
>>> correspond to its textual description.  The following data graph conforms to
>>> the shapes graph but does not match the textual description because it
>>> contains a hand that has seven digits and where its fingers and thumbs are
>>> not disjoint.  A correct example is needed to justify the inclusion of
>>> sh:qualifiedValueShapesDisjoint in SHACL.
>>>
>>> ex:SixFingerHand rdf:type ex:Hand ;
>>>    sh:digit [ rdf:type ex:Thumb ] ;
>>>    sh:digit [ rdf:type ex:Finger ] ;
>>>    sh:digit [ rdf:type ex:Finger ] ;
>>>    sh:digit [ rdf:type ex:Finger ] ;
>>>    sh:digit [ rdf:type ex:Finger ] ;
>>>    sh:digit [ rdf:type ex:Finger, ex:Thumb ] ;
>>>    sh:digit [ ] .
>>>
>>> Peter F. Patel-Schneider
>>> Nuance Communications
>>>
>>

Received on Sunday, 19 March 2017 06:24:09 UTC