w3c / data-shapes

RDF Data Shapes WG repo
89 stars 33 forks source link

Re 4.2.3 sh:nodeKind: provide an instance for the combination of all kinds #24

Closed white-gecko closed 7 years ago

white-gecko commented 7 years ago

The values of sh:nodeKind are one of the following six instances of the class sh:NodeKind: sh:BlankNode, sh:IRI and sh:Literal as well as the following values that represent combinations of the former three, i.e. either-or: sh:BlankNodeOrIRI, sh:BlankNodeOrLiteral and sh:IRIOrLiteral. A validation result MUST be produced for each value node that does not match the given node kind.

(Shapes Constraint Language (SHACL) W3C Editor's Draft 15 December 2016, https://w3c.github.io/data-shapes/shacl/#NodeKindConstraintComponent)

My proposal: There should also be an instance of sh:NodeKind which stands for the combination of all of the three kinds: sh:BlankNodeOrIRIOrLiteral, sh:NodeOrLiteral, or just sh:AnyNodeKind or something similar.

Argument: I assume, the default for no sh:nodeKind specified is that it can by of any kind. But to make the open world a little bit more precise in this case it should also be possible to explicitly specify this case, e.g. when writing out the defaults.

HolgerKnublauch commented 7 years ago

I see where you are coming from. We did have similar discussions in the past, on whether to encourage default values for min/maxCount constraints. I believe your scenario is similar to sh:minCount=0 and best handled by the UI tools. In UI tools, there would typically be a drop down box with values such as "unlimited", "at least one", "exactly one". Likewise for node kind a UI would typically start with "any" regardless of whether a sh:nodeKind constraint exists or not. This would IMHO be better although I don't have any formal evidence for this other than the (small) performance overhead of checking for sh:AnyNodeKind. So I am not totally opposed to your suggestion. However, I believe if we go down this route, people will soon ask for similar catch-all values for sh:class (sh:AnyClass), sh:datatype, sh:maxCount (sh:Unlimited), sh:shape (sh:AnyShape). I find this pattern redundant and best handled on UI level. If the RDF graph has no value for a parameter, then it is already "unconstrained".

HolgerKnublauch commented 7 years ago

Hi Natanael, we have recently changed to a more formal use of GitHub and it was suggested that we try to get feedback from the submitter on whether they are OK with closing these tickets. It would help us if you could clarify whether you can live with the current state.