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.
6101
+
<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>.
6109
+
For each <a>value node</a><code>v</code>: perform <a>conformance checking</a> of <code>v</code> against each <a>output node</a>
6110
+
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>.
6111
+
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>.
6112
+
Otherwise, if <code>v</code> does not <a>conform</a> to <code>s</code>,
6113
+
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>.
6114
+
</div>
6115
+
</div>
6116
+
<p><em>The remainder of this section is informative.</em></p>
6117
+
<p>
6118
+
<code>sh:nodeByExpression</code> functions similarly to <code>sh:node</code>, but instead of referencing a fixed <a>node shape</a>,
6119
+
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.
6120
+
</p>
6121
+
<p>
6122
+
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>.
6123
+
In this case, `sh:node` directly validates against the specified <a>node shape</a>, whereas `sh:nodeByExpression` interprets the <a>IRI</a>
6124
+
as an <a>IRI expression</a> that evaluates to a set containing the same <a>node shape</a>.
6125
+
</p>
6126
+
<p>
6127
+
In the following example, all values of the property <code>ex:address</code> must fulfill the
6128
+
constraints expressed by the <a>shape</a><code>ex:AddressShape</code>.
"sh:resultMessage": "Value does not conform to shape ex:AddressShape.",
6268
+
"sh:resultPath": {
6269
+
"@id": "ex:address"
6270
+
},
6271
+
"sh:resultSeverity": {
6272
+
"@id": "sh:Violation"
6273
+
},
6274
+
"sh:sourceConstraint": {
6275
+
"@id": "ex:AddressShape"
6276
+
},
6277
+
"sh:sourceConstraintComponent": {
6278
+
"@id": "sh:NodeByExpressionConstraintComponent"
6279
+
},
6280
+
"sh:sourceShape": {
6281
+
"@id": "_:b66_b1"
6282
+
},
6283
+
"sh:value": {
6284
+
"@id": "ex:RetosAddress"
6285
+
}
6286
+
}
6287
+
}</pre>
6288
+
</div>
6289
+
</div>
6290
+
</aside>
6291
+
</section>
6077
6292
</section>
6078
6293
6079
6294
<sectionid="core-components-others">
@@ -6938,6 +7153,7 @@ <h2>Changes between SHACL 1.0 Core and SHACL 1.2 Core</h2>
6938
7153
<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>
6939
7154
<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>
6940
7155
<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>
7156
+
<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>
6941
7157
<li>The values of <ahref="#ClassConstraintComponent"><code>sh:class</code></a> and <ahref="#DatatypeConstraintComponent"><code>sh:datatype</code></a> can now also be lists, indicating a union of choices; see <ahref="https://github.com/w3c/data-shapes/issues/160">Issue 160</a></li>
0 commit comments