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
@@ -2531,6 +2531,7 @@ <h2>Node Expressions</h2>
2531
2531
<ul>
2532
2532
<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>
2533
2533
<li>At <ahref="#targetNode"><code>sh:targetNode</code></a> to dynamically compute the targets of a shape.</li>
2534
+
<li>At <ahref="#NodeByExpressionConstraintComponent"><code>sh:nodeByExpression</code></a> to validate nodes against a dynamically computed set of node shapes.</li>
2534
2535
<li>At <ahref="#ExpressionConstraintComponent"><code>sh:expression</code></a> to validate nodes against a condition.</li>
2535
2536
<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.
6651
+
<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>.
6659
+
For each <a>value node</a><code>v</code>: perform <a>conformance checking</a> of <code>v</code> against each <a>output node</a>
6660
+
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>.
6661
+
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>.
6662
+
Otherwise, if <code>v</code> does not <a>conform</a> to <code>s</code>,
6663
+
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>.
6664
+
</div>
6665
+
</div>
6666
+
<p><em>The remainder of this section is informative.</em></p>
6667
+
<p>
6668
+
<code>sh:nodeByExpression</code> functions similarly to <code>sh:node</code>, but instead of referencing a fixed <a>node shape</a>,
6669
+
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.
6670
+
</p>
6671
+
<p>
6672
+
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>.
6673
+
In this case, `sh:node` directly validates against the specified <a>node shape</a>, whereas `sh:nodeByExpression` interprets the <a>IRI</a>
6674
+
as an <a>IRI expression</a> that evaluates to a set containing the same <a>node shape</a>.
6675
+
</p>
6676
+
<p>
6677
+
In the following example, all values of the property <code>ex:address</code> must fulfill the
6678
+
constraints expressed by the <a>shape</a><code>ex:AddressShape</code>.
"sh:resultMessage": "Value does not conform to shape ex:AddressShape.",
6818
+
"sh:resultPath": {
6819
+
"@id": "ex:address"
6820
+
},
6821
+
"sh:resultSeverity": {
6822
+
"@id": "sh:Violation"
6823
+
},
6824
+
"sh:sourceConstraint": {
6825
+
"@id": "ex:AddressShape"
6826
+
},
6827
+
"sh:sourceConstraintComponent": {
6828
+
"@id": "sh:NodeByExpressionConstraintComponent"
6829
+
},
6830
+
"sh:sourceShape": {
6831
+
"@id": "_:b66_b1"
6832
+
},
6833
+
"sh:value": {
6834
+
"@id": "ex:RetosAddress"
6835
+
}
6836
+
}
6622
6837
}</pre>
6623
6838
</div>
6624
6839
</div>
@@ -7526,6 +7741,7 @@ <h2>Changes between SHACL 1.0 Core and SHACL 1.2 Core</h2>
7526
7741
<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>
7527
7742
<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>
7528
7743
<li>Added the new value <code>sh:ByTypes</code> for <ahref="#ClosedConstraintComponent"><code>sh:closed</code></a>; see <ahref="https://github.com/w3c/data-shapes/issues/172">Issue 172</a></li>
7744
+
<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>
7529
7745
<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