Description
Originally raised in this comment, excerpted here:
Section 4.6.4 of the 1.0 spec., consistent with today's draft state, reads:
sh:xone
specifies the condition that each value node conforms to exactly one of the provided shapes.However, the remainder of that section doesn't talk about whether
sh:xone
can or can't be empty. This shape in SHACL-SHACL is consistent with that lack of detail, but the validation for a user with any targeted nodes would always fail, because there isn't exactly one match.Thinking about it a bit, this seems like it would be a backwards-incompatible change to add a
sh:minListLength 1
here that fails a SHACL-SHACL run, because thesh:xone
subject could be defined with no targets and sneak in as valid against SHACL-SHACL of SHACL 1.0.
Should SHACL 1.2 do anything about empty sh:xone
lists? We have a few options:
- Update the spec to say
sh:xone
must have a member, and add ash:minListLength 1
constraint to SHACL-SHACL withsh:Violation
severity. - Update the spec to say
sh:xone
should have a member, and add ash:minListLength 1
constraint to SHACL-SHACL with a lesser severity. - Update the spec to say
sh:xone
should have a member, and do not update SHACL-SHACL.
If updating the spec, this is my first sketch of wording for the sh:xone
spec. section, added to the span
s of data-syntax-rule
s a new rule xone-members-minCount
:
There must be at least one member of such list.
If updating SHACL-SHACL to report less-than-sh:Violation
severity, then we could use sh:Warning
for the shape authors that they're about to cause trouble for their shape users. #192 goes into other severities if we end up thinking a non-violation level would be better.
A PR for this Issue should be built on:
- Issue 415: Use
sh:memberShape
in SHACL SHACL #417 - feat: #192 add severity levels that are not violations #409 (if group decides on non-violation severity)