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

Expressing conditional properties

From: Gary Murphy <gary@schemaapp.com>
Date: Tue, 11 Sep 2018 17:13:18 -0400
Message-ID: <CADnyxpsS91s=ejrm9DHbDME0Cs-aUp3Dj=-j2WWvnG2BRQdA8Q@mail.gmail.com>
To: "public-shacl@w3.org" <public-shacl@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:23:12 UTC