W3C home > Mailing lists > Public > public-shacl@w3.org > September 2018

Re: Expressing conditional properties

From: Irene Polikoff <irene@topquadrant.com>
Date: Tue, 11 Sep 2018 17:19:08 -0400
Message-Id: <76D6B41D-0BF5-4368-AC8B-B205F63F3501@topquadrant.com>
Cc: "public-shacl@w3.org" <public-shacl@w3.org>
To: Gary Murphy <gary@schemaapp.com>
There are SPARQL-based targets: https://www.w3.org/TR/shacl-af/#SPARQLTarget <https://www.w3.org/TR/shacl-af/#SPARQLTarget>

> On Sep 11, 2018, at 5:13 PM, Gary Murphy <gary@schemaapp.com> wrote:
> 
> Another novice question in my quest to translate my spin ;) I know I can do these things with sh:sparql but thought I'd ask if there is a more elegant strategy for defining shapes that apply only conditionally to a property based on the particular subclass of $this.
> 
> So for example, if I have a schema:Event, I would want to ensure that it has the schema:location but not if it happens to be a BroadcastEvent or OnDemandEvent -- normally I'd express this in spin rules with a filter on the ?type of ?this.  Is there a shacl equivalent?
> 
> A similar pattern happens where the rule applies only if some other property is or is not in a list of classes, for example, an ItemListElement only needs a position specified if its sibling property itemListOrder is ascending or descending, so in one sh:property I need to test the value/class of another property of the current focus.
> 
> by the way, the shacl playground is wonderful :)
> 
> -- 
> Gary Murphy
> Developer, Schema App
> e: gary@schemaapp.com <mailto:martha@schemaapp.com>
> w: https://www.schemaapp.com <https://www.schemaapp.com/>
Received on Tuesday, 11 September 2018 21:19:33 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 11 September 2018 21:19:34 UTC