At this moment, ShEx compact syntax has the possibility to associate production labels to triple constraints or triple expressions.
Although for ShEx 2.0, those production labels only serve for documentation purposes, their usage could serve to increase ShEx expressivity.
A ShEx processor could assign the value objects of the matched triple constraint to an internal variable that holds the production label and those labels could be used for comparison and even arithmetic expressions.
At this moment, ShEx compact syntax has the possibility to associate production labels to triple constraints or triple expressions.
Although for ShEx 2.0, those production labels only serve for documentation purposes, their usage could serve to increase ShEx expressivity.
A ShEx processor could assign the value objects of the matched triple constraint to an internal variable that holds the production label and those labels could be used for comparison and even arithmetic expressions.
A possible example could be:
Another typical example could be:
Given that ShEx supports XML Schema primitive datatypes, I would suggest that the language and built-in functions leverage those from XPath.
This approach would be similar to what SPARQL does in filter expressions.