W3C home > Mailing lists > Public > public-rdf-shapes@w3.org > June 2017

Re: compiling ShEx oneOf to SHACL

From: Irene Polikoff <irene@topquadrant.com>
Date: Mon, 5 Jun 2017 10:54:35 -0400
Cc: public-rdf-shapes@w3.org
Message-Id: <933F9A59-0E52-49F4-945A-69DCD9EF43F0@topquadrant.com>
To: Eric Prud'hommeaux <eric@w3.org>
You can use sh:xone instead of sh:or, then you will not need any NOT statements

http://w3c.github.io/data-shapes/shacl/#XoneConstraintComponent <http://w3c.github.io/data-shapes/shacl/#XoneConstraintComponent>


> On Jun 5, 2017, at 7:02 AM, Eric Prud'hommeaux <eric@w3.org> wrote:
> 
> I'm considering the feasibility of compiling ShEx to SHACL. Is there a
> shorter way to compile this ShEx oneOf:
> 
> <NameShape> {
>    foaf:name LITERAL
>  | foaf:givenName LITERAL ; foaf:familyName LITERAL
> }
> 
> than this SHACL?:
> 
> :UserShape
>  sh:or (
>    [ sh:and (
>      [ sh:property
>        [ sh:path foaf:name; sh:minCount 1; sh:maxCount 1 ] ]
>      [ sh:not [
>         sh:property
>           [ sh:path foaf:givenName; sh:minCount 1; sh:maxCount 1 ] ] ]
>      [ sh:not [
>         sh:property
>           [ sh:path foaf:familyName; sh:minCount 1; sh:maxCount 1 ] ] ] ) ]
>    [ sh:and (
>      [ sh:not [ sh:property
>        [ sh:path foaf:name; sh:minCount 1; sh:maxCount 1 ] ] ]
>      [ sh:property
>        [ sh:path foaf:givenName; sh:minCount 1; sh:maxCount 1 ] ]
>      [ sh:property
>        [ sh:path foaf:familyName; sh:minCount 1; sh:maxCount 1 ] ] ) ] ) .
> 
> -- 
> -ericP
> 
> office: +1.617.599.3509
> mobile: +33.6.80.80.35.59
> 
> (eric@w3.org)
> Feel free to forward this message to any list for any purpose other than
> email address distribution.
> 
> There are subtle nuances encoded in font variation and clever layout
> which can only be seen by printing this message on high-clay paper.
> 


Received on Monday, 5 June 2017 14:55:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:02:50 UTC