Re: Overriding rules in sub-classes

Gary,

Not sure this is the best solution, but you could probably define a custom
SPARQL-based target type (https://www.w3.org/TR/shacl-af/#SPARQLTargetType),
say schema:OrganizationOnly, that uses SPARQL to pick members of
schema:Organization that are not members of schema:LocalBusiness. Then you
could write two constraints - one targeting schema:OrganizationOnly, and
one targeting schema:LocalBusiness.

Jakub

On Thu, Sep 5, 2019 at 2:57 PM Gary Murphy <gary@schemaapp.com> wrote:

>
> Is it possible to specifically override a rule when applied to a subclass?
>
> I have
> schema:LocalBusiness rdfs:subClassOf schema:Organization
>
> and in the shapes rules for both I have
> sh:path schema:sameAs ;
> sh:minCount 1 ;
>
> and each has a message, but the message is (slightly) different; when I
> validate the file, I get both rules reporting, so there are two messages,
> one for Organization, one for LocalBusiness
>
> Is there a general pattern for avoiding this?  I'd like to override the
> Organization rule rather than see both.
>
> --
> Gary Lawrence Murphy <gary@schemaapp.com> - Hunch Manifest, 15 Wyndham N
> 'C', Guelph
>

Received on Thursday, 5 September 2019 19:15:04 UTC