Re: shapes-ISSUE-57 (labra): Grouping of Shapes [SHACL Spec]

Hi!

as long as I haven't mixed something up wrt. the proposed feature of 
sh:NodeConstraints + under the assumption that sh:valueshape can be used 
in sh:nodeconstraints too, following shapes expressed in SHACL should be 
equivalent to your ShEx shapes ->

ex:PersonShape
	a sh:Shape ;
	sh:constraint [
		a sh:NodeConstraint ;
		sh:valueShape [
			sh:constraint [
				a sh:OrConstraint ;
				sh:shapes (
					[
						sh:property [
							sh:predicate ex:name ;
							sh:datatype xsd:string ;
						]
					]
					[
						sh:property [
							sh:predicate ex:firstname ;
							sh:minCount 1 ;
							sh:datatype xsd:string ;
						] ;
						sh:property [
							sh:predicate ex:lastname ;
							sh:datatype xsd:string ;
						]
					]
				)
			]
		] ;
		sh:maxCount 1 ;
	] ;
.

ex:ClosedIssueShape
	a sh:Shape ;
	sh:constraint [
		a sh:NodeConstraint ;
		sh:valueShape [
			sh:constraint [
				a sh:OrConstraint ;
				sh:shapes (
					[
						sh:property [
							sh:predicate ex:resolution  ;
							sh:valueShape ex:RejectionShape ;
						]
					]
						sh:property [
							sh:predicate ex:rejection ;
							sh:valueShape ex:RejectionShape ;
						]
					]
				)
			]
		] ;
		sh:minCount 1 ;
	] ;
.

---
DDipl.-Ing. Simon Steyskal
Institute for Information Business, WU Vienna

www: http://www.steyskal.info/  twitter: @simonsteys

Am 2015-05-23 08:24, schrieb RDF Data Shapes Working Group Issue 
Tracker:
> shapes-ISSUE-57 (labra): Grouping of Shapes [SHACL Spec]
> 
> http://www.w3.org/2014/data-shapes/track/issues/57
> 
> Raised by: Jose Emilio Labra Gayo
> On product: SHACL Spec
> 
> When combining Shapes with and and or operators, it is natural to
> group those shapes. In compact syntax, grouping is represented by
> parenthesis.
> 
> For example:
> 
> <PersonShape> {
>   foaf:name xsd:string
> | ( foaf:firstName xsd:string +
>   , foaf:lastName xsd:String
>   )
> }
> 
> A natural extension is to add cardinalities on those groups. SHACL
> spec should define if groupings and cardinalities over groupings are
> possible.

Received on Thursday, 8 October 2015 19:12:45 UTC