- From: Peter F. Patel-Schneider <pfpschneider@gmail.com>
- Date: Thu, 31 Mar 2016 08:55:19 -0700
- To: Eric Prud'hommeaux <eric@w3.org>, public-data-shapes-wg@w3.org
On 03/30/2016 03:03 PM, Eric Prud'hommeaux wrote: > PROPOSAL: write stems in shacl like: > > <http://a.example/S1> a sh:Shape; > sh:propValues ( > <http://a.example/p1> [ > sh:values [ > a sh:StemRange; > shex:stem <http://a.example/v> > ] > ] > ). > > This matches { <s1> <http://a.example/p1> <http://a.example/v123> } > and { <s1> <http://a.example/p1> <http://a.example/v> } > but fails { <s1> <http://a.example/p1> <http://a.example/uv> } The following syntax might be better: ex:S1 a sh:Shape; sh:propValues ( <http://a.example/p1> [ a sh:Shape ; sh:stem <http://a.example/v> ] ) . or, in the current SHACL syntax: ex:S1 a sh:Shape; sh:property [ a sh:Shape ; sh:predicate <http://a.example/p1> ; sh:stem <http://a.example/v> ]. I appears to me that this is equivalent to ex:S1 a sh:Shape; sh:property [ a sh:Shape ; sh:predicate <http://a.example/p1> ; sh:nodeKind sh:IRI ; sh:pattern "^http://a.example/v" ]. > PROPOSAL: write exclusions in shacl like: > > <http://a.example/S1> a sh:Shape; > sh:propValues ( > <http://a.example/p1> [ > sh:values [ > a sh:StemRange; > shex:stem <http://a.example/v> > sh:exclusions: ( > [ "type": "Stem", "stem": <http://a.example/v1> ], > [ "type": "Stem", "stem": <http://a.example/v2> ], > [ "type": "Stem", "stem": <http://a.example/v3> ] > ) > ] > ] > ). > > This matches { <s1> <http://a.example/p1> <http://a.example/v4> } > and { <s1> <http://a.example/p1> <http://a.example/v456> } > but fails { <s1> <http://a.example/p1> <http://a.example/v2> } > and { <s1> <http://a.example/p1> <http://a.example/v234> } It appears to me that this is equivalent to ex:S1 a sh:Shape; sh:propValues ( <http://a.example/p1> [ a sh:Shape ; sh:nodeKind sh:IRI ; sh:pattern "^http://a.example/v" ; sh:not [ a sh:Shape ; sh:pattern "^http://a.example/v1" ] ; sh:not [ a sh:Shape ; sh:pattern "^http://a.example/v2" ] ; sh:not [ a sh:Shape ; sh:pattern "^http://a.example/v3" ] ] ) . (because of the repeated sh:not the current syntax for this would be quite large). >> You can find the stem tests in <http://raw.githubusercontent.com/shexSpec/shexTest/master/validation/manifest.ttl> with >> >> SELECT * { ?s <http://www.w3.org/ns/shacl/test-suite#trait> <http://www.w3.org/ns/shacl/test-suite#Stem> } >> >> Gotta put my child to bed. will try to write to formalize later. >> -- >> -ericP >
Received on Thursday, 31 March 2016 15:55:48 UTC