[data-shapes] Pull Request: #314: Made focusNode an explicit param of exprEval, SPARQL-based expressions now pre-bind all scope vars

HolgerKnublauch has just submitted a new pull request for https://github.com/w3c/data-shapes:

== #314: Made focusNode an explicit param of exprEval, SPARQL-based expressions now pre-bind all scope vars ==
<!--
# Pull request instructions
(Note that text between the HTML comments will be recorded in this pull request's source for future editing, but will not render on Github.  Text is suggested with portions needing substitution enclosed in curly braces.  The curly braces also need to be removed when substituting.)

Please use "Closing keywords" for the associated Issue if this PR should close the Issue once merged.
https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword

If this PR edits a document, please consider including a "Live render."  The non-comment template text suggests one mechanism.  If including the link line(s), please test-load the link(s) while drafting the PR.
-->

Two changes in this PR:

- Instead of having focusNode as part of the scope, I have pulled it out into an explicit special variable. This is cleaner because this variable really has a special status (e.g. it's called this in SPARQL) and it usually has a value (except in sh:targetNode).
- The SPARQL-based node expressions now accept the scope vars as parameters. This makes it possible to define user-defined (SPARQL) functions through custom node expression types. For map-based NEe, these would be simple name-value pairs for the input parameters. For list-based NEs, these could be arg1, arg2, arg3 etc. The NE document can specify the details, but the SPARQL document does not need to change further to accommodate the use cases.

Closes #314


See https://github.com/w3c/data-shapes/pull/370


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

Received on Tuesday, 22 April 2025 07:16:00 UTC