Skip to content

Commit 9616681

Browse files
committed
Update spec to support node expressions in sh:node
1 parent 5e715ec commit 9616681

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

shacl12-core/index.html

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,6 +2520,7 @@ <h2>Node Expressions</h2>
25202520
<ul>
25212521
<li>At <a href="#property-shapes"><code>sh:values</code> and <code>sh:defaultValue</code></a> to derive the value nodes of a property shape.</li>
25222522
<li>At <a href="#targetNode"><code>sh:targetNode</code></a> to dynamically compute the targets of a shape.</li>
2523+
<li>At <a href="#NodeConstraintComponent"><code>sh:node</code></a> to validate nodes against a dynamically computed set of node shapes.</li>
25232524
<li>At <a href="#ExpressionConstraintComponent"><code>sh:expression</code></a> to validate nodes against a condition.</li>
25242525
<li>At <a href="#deactivated"><code>sh:deactivated</code></a> to deactivate certain shapes under specific conditions.</li>
25252526
</ul>
@@ -5380,7 +5381,10 @@ <h3>Shape-based Constraint Components</h3>
53805381
<section id="NodeConstraintComponent">
53815382
<h4>sh:node</h4>
53825383
<p>
5383-
<code>sh:node</code> specifies the condition that each <a>value node</a> conforms to the given <a>node shape</a>.
5384+
<code>sh:node</code> specifies the condition that each <a>value node</a> conforms to the
5385+
<a>node shapes</a> produced by a <a>node expression</a>.
5386+
The evaluation of these node expressions is repeated for all <a>value nodes</a> of the <a>shape</a>
5387+
as the <a>focus node</a>.
53845388
</p>
53855389
<p>
53865390
<span class="component-class">Constraint Component IRI</span>: <code>sh:NodeConstraintComponent</code>
@@ -5395,19 +5399,20 @@ <h4>sh:node</h4>
53955399
<tr>
53965400
<td><code>sh:node</code></td>
53975401
<td>
5398-
The <a>node shape</a> that all value nodes need to conform to.
5399-
<span data-syntax-rule="node-node">The values of <code>sh:node</code> in a shape must be <a>well-formed</a> <a>node shapes</a>.</span>
5402+
The <a>node shapes</a> that all value nodes need to conform to.
5403+
<span data-syntax-rule="node-node">The <a>values</a> of <code>sh:node</code> in a shape must be <a>well-formed</a> <a>node expressions</a>.</span>
54005404
</td>
54015405
</tr>
54025406
</table>
54035407
<div class="def def-text">
54045408
<div class="def-header">TEXTUAL DEFINITION</div>
54055409
<div class="def-text-body" data-validator="Node">
5406-
Let <code>$node</code> be a <a>value</a> of <code>sh:node</code>.
5407-
For each <a>value node</a> <code>v</code>:
5408-
A <a>failure</a> MUST be produced if the <a>conformance checking</a> of <code>v</code> against <code>$node</code> produces a <a>failure</a>.
5409-
Otherwise, if <code>v</code> does not <a>conform</a> to <code>$node</code>,
5410-
there is a <a>validation result</a> with <code>v</code> as <code>sh:value</code>.
5410+
Let <code>$expr</code> be a <a>value</a> of <code>sh:node</code>.
5411+
For each <a>value node</a> <code>v</code>: perform <a>conformance checking</a> of <code>v</code> against each <a>output node</a>
5412+
of <code>evalExpr(expr, <a>data graph</a>, v, {})</code> <code>s</code> that is a <a>node shape</a> in the <a>shapes graph</a>.
5413+
For each conformance check, a <a>failure</a> MUST be produced if the <a>conformance checking</a> of <code>v</code> against <code>s</code> produces a <a>failure</a>.
5414+
Otherwise, if <code>v</code> does not <a>conform</a> to <code>s</code>,
5415+
there is a <a>validation result</a> with <code>v</code> as <code>sh:value</code> and a <a>deep copy</a> of <code>s</code> as <code>sh:sourceConstraint</code>.
54115416
</div>
54125417
</div>
54135418
<p><em>The remainder of this section is informative.</em></p>
@@ -5534,6 +5539,7 @@ <h4>sh:node</h4>
55345539
sh:resultPath ex:address ;
55355540
sh:value ex:RetosAddress ;
55365541
sh:resultMessage "Value does not conform to shape ex:AddressShape." ;
5542+
sh:sourceConstraint ex:AddressShape ;
55375543
sh:sourceConstraintComponent sh:NodeConstraintComponent ;
55385544
sh:sourceShape _:b1 ;
55395545
]
@@ -5558,6 +5564,9 @@ <h4>sh:node</h4>
55585564
"sh:resultSeverity": {
55595565
"@id": "sh:Violation"
55605566
},
5567+
"sh:sourceConstraint": {
5568+
"@id": "ex:AddressShape"
5569+
},
55615570
"sh:sourceConstraintComponent": {
55625571
"@id": "sh:NodeConstraintComponent"
55635572
},
@@ -6864,7 +6873,7 @@ <h2>Revision History</h2>
68646873
<section class="appendix informative" id="changes-12">
68656874
<h2>Changes between SHACL 1.0 Core and SHACL 1.2 Core</h2>
68666875
<ul>
6867-
<li>Introduced <a>node expressions</a> as an extension point to dynamically compute lists of nodes. Generalized <code>sh:targetNode</code>, <code>sh:deactivated</code> and <code>sh:defaultValue</code>, and introduced <code>sh:values</code> to support node expressions.</li>
6876+
<li>Introduced <a>node expressions</a> as an extension point to dynamically compute lists of nodes. Generalized <code>sh:targetNode</code>, <code>sh:node</code>, <code>sh:deactivated</code> and <code>sh:defaultValue</code>, and introduced <code>sh:values</code> to support node expressions.</li>
68686877
<li>Added the new constraint component <a href="#SingleLineConstraintComponent"><code>sh:singleLine</code></a>, see <a href="https://github.com/w3c/data-shapes/issues/177">Issue 177</a></li>
68696878
<li>Added the new class <a href="#ShapeClass"><code>sh:ShapeClass</code></a> for implicit class targets, see <a href="https://github.com/w3c/data-shapes/issues/212">Issue 212</a></li>
68706879
<li>Moved SPARQL-based validators from Core to an Appendix of SHACL-SPARQL, see <a href="https://github.com/w3c/data-shapes/issues/271">Issue 271</a></li>

0 commit comments

Comments
 (0)