Re: Overriding rules in sub-classes

Well that's the problem, the constraints don't always say the same thing,
or may have different sh:severity, or may be contingent on other properties
of the sub-class item or inverse paths; if there's no mechanism, then of
course there has to be a work-around, which may be to programmatically sift
the received shacl results to select out those pertaining to the actual
instance class before displaying them.

I had hoped it may be possible to limit the scope of sh:deactivated in some
way, so in the sub-class, a rule could implicate the ancestor shape by
name, deactivate it, and then provide it's own class-specific test, but
then again, when the shacl engine encountered the parent rule, how could it
know?  I'm thinking Jakub's method of excluding the subClass in the
ancestor rule may be the best option.


On Thu, Sep 5, 2019 at 3:10 PM Irene Polikoff <irene@topquadrant.com> wrote:

> Since LocalBusiness is a subclass of Organization, you do not need to
> repeat the constraint for it.
>
> It is already in place. There is no override since the constraints say the
> same thing. It is just unnecessary repetition.
>
> On Sep 5, 2019, at 2:32 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
>
>

-- 
Gary Lawrence Murphy <gary@schemaapp.com> - Hunch Manifest, 15 Wyndham N
'C', Guelph

Received on Friday, 6 September 2019 14:34:15 UTC