W3C home > Mailing lists > Public > public-data-shapes-wg@w3.org > April 2016

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

From: Holger Knublauch <holger@topquadrant.com>
Date: Mon, 11 Apr 2016 09:23:11 +1000
To: public-data-shapes-wg@w3.org
Message-ID: <570AE05F.7070708@topquadrant.com>
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 Sunday, 10 April 2016 23:23:44 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:30:31 UTC