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
* #357: Added sh:expression
I had to make the definition of Deep Copy stand-alone so that I could reuse it in multiple places. I didn't add an example as Core doesn't define interesting enough node expression types. The test case shows the syntax.
* Update shacl12-core/index.html
Co-authored-by: Yousouf Taghzouti <[email protected]>
* #357: Clarify that reification is not included in deep copy
* Apply suggestions from code review
Co-authored-by: Ted Thibodeau Jr <[email protected]>
---------
Co-authored-by: Yousouf Taghzouti <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Copy file name to clipboardExpand all lines: shacl12-core/index.html
+61-4Lines changed: 61 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -575,6 +575,18 @@ <h3>Terminology</h3>
575
575
if one of the <a>SHACL types</a> of <code>n</code> in <code>G</code> is <code>C</code>.
576
576
</div>
577
577
</div>
578
+
<divclass="def">
579
+
<divclass="term-def-header">Deep Copy</div>
580
+
<div>
581
+
For a <a>node</a><code>n</code> in a <a>graph</a><code>sourceGraph</code>,
582
+
the <dfndata-lt="deep copy">deep copy</dfn> of <code>n</code> in a <a>graph</a><code>targetGraph</code>
583
+
is <code>n</code> in <code>targetGraph</code> plus, if <code>n</code> is a <a>blank node</a>,
584
+
any <a>triples</a> from <code>sourceGraph</code> that can be reached by transitively traversing
585
+
the <a>blank nodes</a> that appear in the <a>object</a> position of a triple that can be reached
586
+
starting with <code>n</code> as the <a>subject</a>. This is similar to
587
+
the <ahref="https://www.w3.org/submissions/CBD/">Concise Bounded Description</a>, but without reification.
588
+
</div>
589
+
</div>
578
590
579
591
</section>
580
592
@@ -2378,6 +2390,7 @@ <h2>Node Expressions</h2>
2378
2390
<ul>
2379
2391
<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>
2380
2392
<li>At <ahref="#targetNode"><code>sh:targetNode</code></a> to dynamically compute the targets of a shape.</li>
2393
+
<li>At <ahref="#ExpressionConstraintComponent"><code>sh:expression</code></a> to validate nodes against a condition.</li>
2381
2394
<li>As parameter values of most <ahref="#core-components">constraint components</a> to represent constraints that may be different depending on each focus node. <spanclass="todo">TODO: This change needs to be made still, see ISSUE 311.</span></li>
2382
2395
<li>At <ahref="#deactivated"><code>sh:deactivated</code></a> to deactivate certain shapes under specific conditions. <spanclass="todo">TODO: This change needs to be made still, see ISSUE 338.</span></li>
Validation results may have a value for the property <code>sh:resultPath</code> pointing at a <a>well-formed</a><a>SHACL property path</a>.
2824
2837
For results produced by a <a>property shape</a>, this <a>SHACL property path</a> is equivalent to the <a>value</a> of <code>sh:path</code> of the shape,
2825
2838
unless stated otherwise. <!-- sh:closed is an exception -->
2826
-
If the <code>sh:path</code><code>p</code> is a <a>blank node</a>, then the <code>sh:resultPath</code> is a "deep copy"
2827
-
of <code>p</code> and any <a>triples</a> that can be reached by transitively traversing the <a>blank nodes</a>
2828
-
that appear in the <a>object</a> position of these triples.
2829
-
See the <ahref="https://www.w3.org/submissions/CBD/">Concise Bounded Description</a>.
2839
+
If the <code>sh:path</code><code>p</code> is a <a>blank node</a>, then the <code>sh:resultPath</code> is a <a>deep copy</a> of <code>p</code> in the results graph.
2830
2840
</p>
2831
2841
</section>
2832
2842
<sectionid="results-value">
@@ -5982,6 +5992,52 @@ <h4>sh:in</h4>
5982
5992
</div>
5983
5993
</aside>
5984
5994
</section>
5995
+
5996
+
<sectionid="ExpressionConstraintComponent">
5997
+
<h4>sh:expression</h4>
5998
+
<p>
5999
+
Based on <a>node expressions</a>, this section introduces a <a>constraint component</a> called
Let <code>expr</code> be the <a>value</a> of <code>sh:expression</code>.
6029
+
For each <a>value node</a><code>v</code>
6030
+
and <code>scope</code> contains <code>v</code> as the value of <code>focusNode</code>
6031
+
where <code>evalExpr(expr, activeGraph, scope)</code>
6032
+
does not return <code>true</code> as one of its <a>output nodes</a>,
6033
+
there is a <a>validation result</a> that has <code>v</code> as its <code>sh:value</code>
6034
+
and a <a>deep copy</a> of <code>expr</code> in the results graph as its <code>sh:sourceConstraint</code>.
6035
+
If the <code>expr</code> has <a>values</a> for <code>sh:message</code> in the <a>shapes graph</a>,
6036
+
then these <a>values</a> become the (only) values for <code>sh:resultMessage</code> in the
6037
+
<a>validation result</a>.
6038
+
</div>
6039
+
</div>
6040
+
</section>
5985
6041
</section>
5986
6042
</section>
5987
6043
@@ -6479,6 +6535,7 @@ <h2>Changes between SHACL 1.0 Core and SHACL 1.2 Core</h2>
6479
6535
<li>Added the new constraint component <ahref="#SingleLineConstraintComponent"><code>sh:singleLine</code></a>, see <ahref="https://github.com/w3c/data-shapes/issues/177">Issue 177</a></li>
6480
6536
<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>
6481
6537
<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>
6538
+
<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>
0 commit comments