Re: shapes-ISSUE-146 (sh:qualifiedMinCount ): treatment of unbound results from sh:hasShape in sh:qualifiedMinCount (and elsewhere) [SHACL - Core]

The text indicates that errors are counted, but the code appears to propagate
them.

peter


On 04/10/2016 04:23 PM, Holger Knublauch wrote:
> I believe the query is correct, but I have added a paragraph to make it a bit
> clearer:
> 
> Note that in the SPARQL query above, we assume that the |SUM| operation fails
> if one of the values of |?s| is not a number. This mechanism is used by the
> error handling, which sets |?s| to the string |'error'| whenever one of the
> individual |sh:hasShape| calls fails.
> 
> HTH
> Holger
> 
> 
> On 9/04/2016 7:11, RDF Data Shapes Working Group Issue Tracker wrote:
>> shapes-ISSUE-146 (sh:qualifiedMinCount ): treatment of unbound results from sh:hasShape in sh:qualifiedMinCount (and elsewhere) [SHACL - Core]
>>
>> http://www.w3.org/2014/data-shapes/track/issues/146
>>
>> Raised by: Peter Patel-Schneider
>> On product: SHACL - Core
>>
>> It's hard to determine just what is going on in the SPARQL code, but appears that if any call to hasShape returns unbound then a validation result will be produced, which does not match the text.
>>
>>
>> TEXTUAL DEFINITION of sh:qualifiedMinCount
>> A validation result must be produced if the number of triples that have the focus node as its subject, the sh:predicate as its predicate and where validating the object against the shape specified by sh:qualifiedValueShape produces no validation results with severity sh:Violation or a failure is less than sh:qualifiedMinCount. The produced validation result must have the focus node as its sh:subject, and the sh:predicate as its sh:predicate.
>> SPARQL DEFINITION of sh:qualifiedMinCount
>>
>> SELECT $this ($this AS ?subject) $predicate ?failure
>> WHERE {
>>  {
>>   SELECT (SUM(?s) AS ?count)
>>   WHERE {
>>    {
>>     FILTER NOT EXISTS { $this $predicate ?value } .
>>     BIND (0 AS ?s) .
>>    }
>>    UNION
>>    {
>>     $this $predicate ?value .
>>     BIND (sh:hasShape(?value, $qualifiedValueShape, $shapesGraph) AS ?hasShape) .
>>     BIND (IF(bound(?hasShape), IF(?hasShape, 1, 0), 'error') AS ?s) .
>>    }
>>   }
>>  }
>>  BIND (!bound(?count) AS ?failure) .
>>  FILTER IF(?failure, true, ?count < $qualifiedMinCount) .
>> }
>>
>>
>>
>>
>>
> 

Received on Thursday, 14 April 2016 18:10:32 UTC