Closed tpluscode closed 1 year ago
Ooh, curious. I double checked the published CG Note and it does in fact phrase it differently, as I would expect
constant term expression [...] produces the set { $expr }.
Why was tis changed?
In https://w3c.github.io/shacl/shacl-af/#node-expressions-constant it still reads
For the constant term expression $expr, Eval($expr, $this) produces the list of length 1 with $expr as its only member.
and I believe this makes sense. Each node expression is one node. Only if it's a blank node, the node expression is assumed to have further values and the engine needs to walk into the properties of that blank node.
In your example, you basically have three sh:values rules, and I believe it is reasonable to assume that the total inferred values of the properties are the union of each sh:values rule. So I believe it will work just fine, without changes to how constant expressions work.
Ok, I see how it makes sense to treat each node as an individual node. I somehow assumed that the full set would be the expression. Thanks for explaining
The current spec says:
I think it should be supported to have the "constant" consist of multiple values. Analogous to
sh:hasValue
with multiple objects.The result would be
[ schema:name "Apple"@en, "Apfel"@de, "Jabłko"@pl ]