Skip to content

Conversation

@HolgerKnublauch
Copy link
Contributor

@HolgerKnublauch HolgerKnublauch requested a review from afs November 17, 2025 10:34
@HolgerKnublauch HolgerKnublauch added the Node Expressions For SHACL 1.2 Node Expressions label Nov 17, 2025
<p><em>The remainder of this section is informative.</em></p>
<p>
Note that the scope in the evaluation of expression constraints contains the variable <code>value</code>
Note that the scope in the evaluation of expression constraints contains the <a href="#VarExpression">variable</a> <code>value</code>
Copy link
Contributor

@afs afs Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least:

Suggested change
Note that the scope in the evaluation of expression constraints contains the <a href="#VarExpression">variable</a> <code>value</code>
Note that the scope in the evaluation of expression constraints contains the <a href="#dfn-var-expression">variable</a> <code>value</code>

although this called a "var expression" not "a variable" so that seems to make it:

Suggested change
Note that the scope in the evaluation of expression constraints contains the <a href="#VarExpression">variable</a> <code>value</code>
Note that the scope in the evaluation of expression constraints contains the <a href="#VarExpression">var expression</a> <code>value</code>

The definition:

A blank node that is the subject of the following properties is called a var expression with the function name shnex:VarExpression:

says the blank node is the var expression and is an RDF term.

If you want to keep it as the current design, please keep using "var expression" and then shacl12-rules can define variable. (There are only two other uses of "variable" in the node expressions doc at the moment.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't even need to talk VarExpressions at all here. The key is the term "scope". And scope is defined in SHACL 1.2 core as

				<li><code>scope</code> is a map from (key) <a>nodes</a> to individual (value) <a>nodes</a>.
				The empty map is written as <code>{}</code>.

So I think we can avoid the term variable in that definition and just refer to mappings in the scope, where the key in the map is the value of shnex:var of the var expression.

I guess the proper fix is then to create a deep link to the scope definition and reference that from node expressions.

Copy link
Contributor

@afs afs Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The map is from a string (taken from shnex:var) to RDF term.

If it is a node (RDF Term), then

[ shnex:var "foo" ] .
[ shnex:var "foo" ] .

is two different scope entries.

If there is no varExpression, how does a node expression

  [ sparql:plus ( [ shnex:var foo" ] 1 ) ]

Something has to define

   exprEval([ shnex:var "foo" ])

and that to be an error if "foo" is not in the scope, which is returning an empty list from scope lookup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Node Expressions For SHACL 1.2 Node Expressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No definition of "variable"

3 participants