You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: shacl12-core/index.html
+216Lines changed: 216 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2520,6 +2520,7 @@ <h2>Node Expressions</h2>
2520
2520
<ul>
2521
2521
<li>At <ahref="#property-shapes"><code>sh:values</code> and <code>sh:defaultValue</code></a> to derive the value nodes of a property shape.</li>
2522
2522
<li>At <ahref="#targetNode"><code>sh:targetNode</code></a> to dynamically compute the targets of a shape.</li>
2523
+
<li>At <ahref="#NodeByExpressionConstraintComponent"><code>sh:nodeByExpression</code></a> to validate nodes against a dynamically computed set of node shapes.</li>
2523
2524
<li>At <ahref="#ExpressionConstraintComponent"><code>sh:expression</code></a> to validate nodes against a condition.</li>
2524
2525
<li>At <ahref="#deactivated"><code>sh:deactivated</code></a> to deactivate certain shapes under specific conditions.</li>
The <a>node shapes</a> that all value nodes need to conform to.
6032
+
<spandata-syntax-rule="nodeByExpression-scope">The <a>values</a> of <code>sh:nodeByExpression</code> in a shape must be <a>well-formed</a><a>node expressions</a>.</span>
Let <code>$expr</code> be a <a>value</a> of <code>sh:nodeByExpression</code>.
6040
+
For each <a>value node</a><code>v</code>: perform <a>conformance checking</a> of <code>v</code> against each <a>output node</a>
6041
+
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>.
6042
+
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>.
6043
+
Otherwise, if <code>v</code> does not <a>conform</a> to <code>s</code>,
6044
+
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>.
6045
+
</div>
6046
+
</div>
6047
+
<p><em>The remainder of this section is informative.</em></p>
6048
+
<p>
6049
+
<code>sh:nodeByExpression</code> functions similarly to <code>sh:node</code>, but instead of referencing a fixed <a>node shape</a>,
6050
+
a referenced <a>node expression</a> is used to dynamically compute the set of <a>node shapes</a> to which each <a>value node</a> must conform.
6051
+
</p>
6052
+
<p>
6053
+
Note that `sh:node` and `sh:nodeByExpression` exhibit the same behavior when given a <a>value</a> that is an <a>IRI</a> of a <a>node shape</a>.
6054
+
In this case, `sh:node` directly validates against the specified <a>node shape</a>, whereas `sh:nodeByExpression` interprets the <a>IRI</a>
6055
+
as an <a>IRI expression</a> that evaluates to a set containing the same <a>node shape</a>.
6056
+
</p>
6057
+
<p>
6058
+
In the following example, all values of the property <code>ex:address</code> must fulfill the
6059
+
constraints expressed by the <a>shape</a><code>ex:AddressShape</code>.
"sh:resultMessage": "Value does not conform to shape ex:AddressShape.",
6199
+
"sh:resultPath": {
6200
+
"@id": "ex:address"
6201
+
},
6202
+
"sh:resultSeverity": {
6203
+
"@id": "sh:Violation"
6204
+
},
6205
+
"sh:sourceConstraint": {
6206
+
"@id": "ex:AddressShape"
6207
+
},
6208
+
"sh:sourceConstraintComponent": {
6209
+
"@id": "sh:NodeByExpressionConstraintComponent"
6210
+
},
6211
+
"sh:sourceShape": {
6212
+
"@id": "_:b66_b1"
6213
+
},
6214
+
"sh:value": {
6215
+
"@id": "ex:RetosAddress"
6216
+
}
6217
+
}
6218
+
}</pre>
6219
+
</div>
6220
+
</div>
6221
+
</aside>
6222
+
</section>
6008
6223
</section>
6009
6224
6010
6225
<sectionid="core-components-others">
@@ -6869,6 +7084,7 @@ <h2>Changes between SHACL 1.0 Core and SHACL 1.2 Core</h2>
6869
7084
<li>Added the new class <ahref="#ShapeClass"><code>sh:ShapeClass</code></a> for implicit class targets, see <ahref="https://github.com/w3c/data-shapes/issues/212">Issue 212</a></li>
6870
7085
<li>Moved SPARQL-based validators from Core to an Appendix of SHACL-SPARQL, see <ahref="https://github.com/w3c/data-shapes/issues/271">Issue 271</a></li>
6871
7086
<li>Added the new constraint component <ahref="#ExpressionConstraintComponent"><code>sh:expression</code></a>, see <ahref="https://github.com/w3c/data-shapes/issues/357">Issue 357</a></li>
7087
+
<li>Added the new constraint component <ahref="#NodeByExpressionConstraintComponent"><code>sh:nodeByExpression</code></a>, see <ahref="https://github.com/w3c/data-shapes/issues/408">Issue 408</a></li>
6872
7088
<li>Values for <ahref="#deactivated"><code>sh:deactivated</code></a>, <ahref="#message"><code>sh:message</code></a> and <ahref="#severity"><code>sh:severity</code></a> can now be specified using RDF 1.2 reification, see <ahref="https://github.com/w3c/data-shapes/issues/173">Issue 173</a></li>
0 commit comments