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

Re: ISSUE-139: Cases where constraint components do not make sense

From: Peter F. Patel-Schneider <pfpschneider@gmail.com>
Date: Fri, 8 Apr 2016 08:21:22 -0700
To: Holger Knublauch <holger@topquadrant.com>, "public-data-shapes-wg@w3.org" <public-data-shapes-wg@w3.org>
Message-ID: <5707CC72.703@gmail.com>
The first thing to consider is how this version of SHACL handles shapes. A
shape is always considered against a set of nodes. For some components, like
sh:minCount, it matters that the set is there but other components work on the
elements of the set individually and thus can pretend that there are only
individual nodes to be considered. (The current version of SHACL actually
works this way for components in property and inverse property constraints,
but the component itself is responsible for generating the set.)

The syntax you provide does not conform to Proposal 4. See
https://www.w3.org/2014/data-shapes/wiki/Refactor for more information on this
syntax.  I have rewritten your syntax in the closest analogue in Proposal 4
and added comments to describe the meaning of each component.
More information on the meaning of components can again be found at
https://www.w3.org/2014/data-shapes/wiki/Refactor.

MyShape a sh:Shape ;

  sh:propValues ( (sh:inverse ex:father)
	[ sh:datatype xsd:string ] ) ;
# Elements of the set validate precisely when all their values for the
# inverse of ex:father have datatype xsd:string

  sh:disjoint ( ex:thisProperty ex:otherProperty ) ;
# Elements of the set validate precisely when their values for
# ex:thisProperty are disjoint from their values for ex:otherProperty

  sh:disjoint ( (sh:inverse ex:mother ) ex:otherProperty );
# Elements of the set validate precisely when values for the
# inverse of ex:mother are disjoint from their values for ex:otherProperty

  sh:hasValue 10 ;
# The set as a whole validates precisely when it contains 10 as a member.

  sh:minCount 5 ;
# The set as a whole validates precisely when it has at least five members.

 sh:propValues ( (sh:inverse ex:brother)
	sh:minInclusive 42 ) ;
# Elements of the set validate precisely when all of their values for the
# inverse of ex:brother are larger than 42.

 sh:uniqueLang true ;
# The set as a whole validates precisely when it does not contain elements
# that share a language tag.

  sh:propValues ( (sh:inverse ex:parent)
	[ sh:uniqueLang true ] ) ;
# Elements of the set validate precisely when none of their values for the
# inverse of sh:parent share a language tag.

  sh:shape [ sh:filter ex:PersonShape ; sh:minCount 3 ] .
# The set as a whole validates precisely when it has at least three elements
# that validate against ex:PersonShape.


On 04/07/2016 08:44 PM, Holger Knublauch wrote:
> Hi Peter,
> 
> in your Proposal 4 all constraint components (sh:minCount etc) are applicable
> in all contexts (property constraints, inverse property constraints, node
> constraints). The following examples (using current syntax) would become
> valid. Could you please explain what the meaning of each of these cases would
> be, and when these cases make practical sense?
> 
> ex:MyShape a sh:Shape ;
> 
>     sh:inverseProperty [
>         sh:predicate ex:father ;
>         sh:datatype xsd:string ;
>     ] ;
> 
>     sh:constraint [
>         sh:disjoint ex:otherProperty ;
>     ] ;
> 
>     sh:inverseProperty [
>         sh:predicate ex:mother ;
>         sh:disjoint ex:otherProperty ;
>     ] ;
> 
>     sh:constraint [
>         sh:hasValue 10 ;
>     ] ;
> 
>     sh:constraint [
>         sh:minCount 5 ;
>     ] ;
> 
>     sh:inverseProperty [
>         sh:predicate https://www.w3.org/2014/data-shapes/wiki/Refactorex:brother ;
>         sh:minInclusive 42 ;
>     ] ;
> 
>     sh:constraint [
>         sh:uniqueLang true ;
>     ] ;
> 
>     sh:inverseProperty [
>         sh:predicate ex:parent ;
>         sh:uniqueLang true ;
>     ] ;
> 
>     sh:constraint [
>         sh:qualifiedValueShape ex:PersonShape ;
>         sh:qualifiedMinCount 3 ;
>     ] ;
> 
> For an overview of the current design, see the summary table at the beginning
> of chapter 3:
> 
>     http://w3c.github.io/data-shapes/shacl/#constraints
> 
> Thanks,
> Holger
> 
> 
Received on Friday, 8 April 2016 15:21:52 UTC

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