[data-shapes] give a better example of `nodeByExpression`, or move it out of Core (#481)

VladimirAlexiev has just created a new issue for https://github.com/w3c/data-shapes:

== give a better example of `nodeByExpression`, or move it out of Core ==
https://raw.githack.com/w3c/data-shapes/master/shacl12-core/index.html#example-52 :
```ttl
ex:PersonShape
 a sh:NodeShape ;
 sh:targetClass ex:Person ;
 sh:property [   # _:b1
  sh:path ex:address ;
  sh:minCount 1 ;
  sh:nodeByExpression ex:AddressShape ;
 ] .
```
This is not a good example because instead of `sh:nodeByExpression`, we can use a plain `sh:node` (as in https://raw.githack.com/w3c/data-shapes/master/shacl12-core/index.html#example-48).

@mgberg @afs @HolgerKnublauch 
Can we come up with a better example?

I see in one of the commits of https://github.com/w3c/data-shapes/pull/408
> # Only using an IRI Expression here because Core doesn't define interesting node expressions

So I guess you want to keep Core self-contained and not use expressions except the trivial ones in https://raw.githack.com/w3c/data-shapes/master/shacl12-core/index.html#node-expressions. I think there are 2 better alternatives:
1. That example could use a more complex expression, refer to the Node Expressions spec, and mention that supporting such expressions by Core-conforming engines is not required
2. Or I could argue that `sh:nodeByExpression` itself should not be part of Core but of Node Expressions. 
   - @mgberg can you confirm that the evaluation result of `sh:node` and `sh:nodeByExpression` on IRIs/literals is the same?

Now I think that 2 is the better option: If an engine doesn't support non-trivial Node Expressions, why should it support `sh:nodeByExpression`?


Please view or discuss this issue at https://github.com/w3c/data-shapes/issues/481 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 7 August 2025 09:45:36 UTC