shapes-ISSUE-219 (One-of shapes): Should we add a one-of-a-list-of-shapes operator [SHACL - Core]

shapes-ISSUE-219 (One-of shapes): Should we add a one-of-a-list-of-shapes operator [SHACL - Core]

http://www.w3.org/2014/data-shapes/track/issues/219

Raised by: Holger Knublauch
On product: SHACL - Core

Use case: a node must have either ex:fullName or (ex:firstName and ex:lastName) but not both. Expressing this is currently verbose and leads to combinatorial explosions of "A but not B or C or D" cases.

We could add a new constraint component that takes a list of shapes and makes sure that the value node conforms to exactly one of these shapes. I don't think this is any more difficult than sh:or and sh:and but covers additional use cases.

PROPOSAL: Add sh:choice (or sh:oneOf) taking a list of shapes, passes if value node conforms to exactly one of these shapes.

Note: We had discussed this before https://www.w3.org/2015/09/17-shapes-minutes.html#resolution04 but sh:xor was rejected because of the meaning of an odd number of matches.

Received on Tuesday, 24 January 2017 05:45:54 UTC