Skip to content

Commit

Permalink
Added explanatory paragraph to the end of the constraint component ex…
Browse files Browse the repository at this point in the history
…ample in 6.1, made slight adjustment to wording in ASK validators
  • Loading branch information
HolgerKnublauch committed Feb 22, 2017
1 parent 611c0fd commit f73f0c1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions shacl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4259,7 +4259,8 @@ <h2>SPARQL-based Constraint Components</h2>
<h3>An Example SPARQL-based Constraint Component</h3>
<p>
The following example demonstrates how SPARQL can be used to specify new constraint components using the SHACL-SPARQL language.
The example implements <a href="#PatternConstraintComponent"><code>sh:pattern</code> and <code>sh:flags</code></a> using a <a href="#SPARQLAskValidator">SPARQL ASK</a> query to validate that each <a>value node</a> matches a given regular expression.
The example implements <a href="#PatternConstraintComponent"><code>sh:pattern</code> and <code>sh:flags</code></a> using a
<a href="#SPARQLAskValidator">SPARQL ASK</a> query to validate that each <a>value node</a> matches a given regular expression.
Note that this is only an example implementation and should not be considered normative.
</p>
<pre class="example-shapes" title="Constraint component based on SPARQL">
Expand All @@ -4282,6 +4283,16 @@ <h3>An Example SPARQL-based Constraint Component</h3>
FILTER (!isBlank($value) &amp;&amp;
IF(bound($flags), regex(str($value), $pattern, $flags), regex(str($value), $pattern)))
}""" .</pre>
<p>
Constraint components provide instructions to validation engines on how to identify and validate <a>constraints</a> within a <a>shape</a>.
In general, if a <a>shape</a> <code>S</code> has a <a>value</a> for a property <code>p</code>, and there is a <a>constraint component</a>
<code>C</code> that specifies <code>p</code> as a parameter, and <code>S</code> has values for all <a>mandatory parameters</a> of <code>C</code>,
then the set of these parameter values (including the <a>optional parameters</a>) declare a <a>constraint</a> and the validation engine uses a suitable <a>validator</a> from <code>C</code>
to perform the validation of this constraint.
In the example above, <code>sh:PatternConstraintComponent</code> declares the mandatory parameter <code>sh:pattern</code>,
the optional parameter <code>sh:flags</code>,
and a <a>validator</a> that can be used to perform validation against either <a>node shapes</a> or <a>property shapes</a>.
</p>
</section>

<section id="constraint-components-syntax">
Expand Down Expand Up @@ -4501,7 +4512,7 @@ <h3>Validation with SPARQL-based Constraint Components</h3>
with <code>v</code> <a>pre-bound</a> to the variable <code>value</code>,
create one <a>solution</a> consisting of the bindings
(<code>$this</code>, <a>focus node</a>) and (<code>$value</code>, <code>v</code>).
Let <code>QS</code> be the union of these <a>solutions</a>.
Let <code>QS</code> be a list of these <a>solutions</a>.
</li>
<li>
For <a>SELECT-based validators</a>:
Expand Down

0 comments on commit f73f0c1

Please sign in to comment.