Re: Question on value based constraints

fwiw, sh:and isn't really necessary though.. is this what you wanted -> 
https://gist.github.com/simonstey/e3add7ff0740dd95a4c80d26840ca3e3 ?

br simon

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

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

Am 2019-04-17 18:41, schrieb Simon Steyskal:
> Hi!
> 
> have you tried combining sh:xone with two sh:and constraints?
> 
> e.g. something along the lines of:
> 
> sh:xone (
>    sh:and (
>         ex:hasAddress sh:datatype xsd:string
>         ex:addrType sh:hasValue "simple"
>    )
> 
>    sh:and (
>         ex:hasAddress sh:class ex:complexAddr
>         ex:addrType sh:hasValue "comolex"
>    )
> )
> 
> (I'm on mobile right now so just pseudocode)
> 
> br simon
> 
> -------- Original message --------
> From: Felix Sasaki <felix@sasakiatcf.com>
> Date: 4/17/19 18:26 (GMT+01:00)
> To: public-shacl@w3.org
> Subject: Question on value based constraints
> 
> HI all,
> 
> I have a question on how to model alternative constraints based on
> literal values.
> 
> Let's assume the two alternatives ways to express an address:
> 
> ALTERNATIVE 1:
> ex:person1 ex:hasAddress "Street xzy plz 12345 ..."
> ex:person1 ex:addressType "simpleAddress".
> 
> ALTERNATIVE 2:
> 
> ex:person1 ex:hasAddress ex:someComplexAddress1 # object is an
> instance of class ex:complexAddress
> ex:person1 ex:addressType "complexAddress".
> 
> I want to define two alternative shapes for addresses: one is simple,
> i.e. the literal value "Street xzy plz 12345 ...", and one is complex,
> i.e. an instance of ex:complexAddress.
> 
> How do I model the choice between the two address' shapes based on the
> values "simpleAddress" vs. "complexAddress"?
> 
> Regards,
> 
> Felix

Received on Thursday, 18 April 2019 04:38:30 UTC