Expressing conditional properties

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 <martha@schemaapp.com>
w: https://www.schemaapp.com

Received on Tuesday, 11 September 2018 21:13:53 UTC