Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated definition of validation and conformance checking, suggested …
…new formulation applied to sh:class (unfinished for the others)
  • Loading branch information
HolgerKnublauch committed Mar 1, 2017
1 parent 6a74a1a commit af5aedc
Showing 1 changed file with 46 additions and 36 deletions.
82 changes: 46 additions & 36 deletions shacl/index.html
Expand Up @@ -897,7 +897,7 @@ <h3>Constraints, Parameters and Constraint Components</h3>
</p>
<p>
A <a>shape</a> in a <a>shapes graph</a> <em>declares</em> a <dfn data-lt="constraints">constraint</dfn>
of kind <code>c</code> if <code>c</code> is a <a>constraint component</a> and the shape has <a>values</a> for all
of <dfn>kind</dfn> <code>c</code> if <code>c</code> is a <a>constraint component</a> and the shape has <a>values</a> for all
<a>mandatory parameters</a> of <code>c</code>.
The constraint declaration consists of the <a>values</a> that the shape has for all mandatory and optional parameters of that component.
</p>
Expand Down Expand Up @@ -1749,27 +1749,33 @@ <h3>Linking to shapes graphs (sh:shapesGraph)</h3>
<section id="validation-definition">
<h3>Validation</h3>
<p>
The <dfn data-lt="validating|validates|validated|validate">validation</dfn> of a
<a>focus node</a> in the <a>data graph</a> against a <a>constraint</a> in the <a>shapes graph</a>
produces the <a>top-level</a> validation results that are produced by the <a>validator</a> of the
<a>constraint component</a>, using as input the <a>focus node</a>,
the specific values of the <a>parameters</a> in the constraint,
and the <a>value nodes</a> of the <a>shape</a> in the <a>data graph</a>.
<dfn data-lt="validating|validates|validated|validate">Validation</dfn> is a mapping from some input
to <a>validation results</a>, as defined in the following paragraphs.
</p>
<p>
The <em>validation</em> of a <a>focus node</a> in the <a>data graph</a> against a non-<a>deactivated</a>
<a>shape</a> in the <a>shapes graph</a> produces the union of the results that are produced by the
<a>validation</a> of the <a>focus node</a> against all <a>constraints</a> of the <a>shape</a>.
The validation of any <a>focus node</a> against a <a>deactivated</a> <a>shape</a> produces no
<a>validation results</a> or <a>failures</a>.
<dfn>Validation of a focus node against a constraint:</dfn>
Given a <a>focus node</a> in the <a>data graph</a> and a <a>constraint</a> of <a>kind</a> <code>C</code> in the <a>shapes graph</a>,
the <a>validation results</a> are defined by the <a>validators</a> of the <a>constraint component</a> <code>C</code>.
These <a>validators</a> typically take as input the <a>focus node</a>, the specific <a>values</a> of the <a>parameters</a> of <code>C</code>
of the <a>constraint</a> in the <a>shapes graph</a>, and the <a>value nodes</a> in the <a>data graph</a> of the <a>shape</a> that declares the constraint.
</p>
<p>
The <em>validation</em> of a <a>data graph</a> against a <a>shape</a> produces the union of the
results that are produced by the <a>validation</a> of all <a>focus nodes</a> that are in the <a>target</a> of the <a>shape</a> in the <a>data graph</a>.
<dfn>Validation of a focus node against a shape:</dfn>
Given a <a>focus node</a> in the <a>data graph</a> and a <a>shape</a> in the <a>shapes graph</a>,
the <a>validation results</a> are the union of the results of the <a>validation</a> of the <a>focus node</a> against all
<a>constraints</a> declared by the <a>shape</a>, unless the <a>shape</a> has been <a>deactivated</a>,
in which case the <a>validation results</a> are empty.
</p>
<p>
The <em>validation</em> of a <a>data graph</a> against a <a>shapes graph</a> produces the union of
the results that are produced by the <a>validation</a> of the <a>data graph</a> against all
<dfn>Validation of a data graph against a shape:</dfn>
Given a <a>data graph</a> and a <a>shape</a> in the <a>shapes graph</a>,
the <a>validation results</a> are the union of the results of the <a>validation</a> of all
<a>focus nodes</a> that are in the <a>target</a> of the <a>shape</a> in the <a>data graph</a>.
</p>
<p>
<dfn>Validation of a data graph against a shapes graph:</dfn>
Given a <a>data graph</a> and a <a>shapes graph</a>,
the <a>validation results</a> are the union of results of the <a>validation</a> of the <a>data graph</a> against all
<a>shapes</a> in the <a>shapes graph</a>.
</p>
<p>
Expand Down Expand Up @@ -1820,10 +1826,10 @@ <h4>Handling of Recursive Shapes</h4>
</p>
<ul>
<li><a href="#AndConstraintComponent">sh:and</a></li>
<li><a href="#InConstraintComponent">sh:in</a></li>
<li><a href="#LanguageInConstraintComponent">sh:languageIn</a></li>
<li><a href="#OrConstraintComponent">sh:or</a></li>
<li><a href="#XoneConstraintComponent">sh:xone</a></li>
<li><a href="#InConstraintComponent">sh:in</a></li>
</ul>
<p>
A shape <code>s1</code> in an RDF graph <code>G</code> <dfn>refers</dfn> to shape <code>s2</code>
Expand All @@ -1844,12 +1850,20 @@ <h4>Handling of Recursive Shapes</h4>
<h3>Conformance Checking</h3>
<p>
A <a>focus node</a> <dfn data-lt="conform|conformance">conforms</dfn> to a <a>shape</a> if and only if
the <a>validation</a> of the <a>focus node</a> against the shape does not produce any <a>validation result</a> or a <a>failure</a>.
the set of result of the <a>validation</a> of the <a>focus node</a> against the <a>shape</a> is empty and no <a>failure</a>
has been reported by it.
</p>
<p>
<dfn>Conformance checking</dfn> produces <code>true</code> if and only if a given <a>focus node</a>
<a>conforms</a> to a given <a>shape</a>, and <code>false</code> otherwise.
</p>
<p id="conformance-nested">
Note that some <a>constraint components</a> of SHACL Core (e.g., those of <code>sh:not</code>, <code>sh:or</code> and <code>sh:node</code>)
rely on conformance checking.
In these cases, the so-called <dfn>nested</dfn> <a>validation results</a> used to determine the outcome of conformance checking are
separated from those of the surrounding validation process and typically do not end up in the same validation report
(except perhaps as values of <a href="#results-detail"><code>sh:detail</code></a>).
</p>
</section>

<section id="validation-report">
Expand Down Expand Up @@ -1901,13 +1915,14 @@ <h5>Conforms (sh:conforms)</h5>
<p>
Each SHACL instance of <code>sh:ValidationReport</code> in the results graph has exactly one value for the property <code>sh:conforms</code> and the value is of datatype <code>xsd:boolean</code>.
It represents the outcome of the <a>conformance checking</a>.
The value of <code>sh:conforms</code> is <code>true</code> if and only if the validation process did not produce any <a>top-level</a> <a>validation results</a>.
The value of <code>sh:conforms</code> is <code>true</code> if and only if the <a>validation</a> did not produce any <a>validation results</a>.
</p>
</section>
<section id="result">
<h5>Result (sh:result)</h5>
<p>
For every <a>top-level</a> <a>validation result</a> that is produced by a validation process (except those mentioned in the context of <a href="#results-exclusions">sh:details</a>),
For every <a>validation result</a> that is produced by a <a>validation</a> process
(except those mentioned in the context of <a href="#conformance-nested">conformance checking</a>),
the SHACL instance of <code>sh:ValidationReport</code> in the results graph has a value for the property <code>sh:result</code>.
Each value of <code>sh:result</code> is a <a>SHACL instance</a> of the class <code>sh:ValidationResult</code>.
</p>
Expand Down Expand Up @@ -1980,17 +1995,12 @@ <h4>Constraint Component (sh:sourceConstraintComponent)</h4>
</p>
</section>
<section id="results-detail">
<h4>Detail (sh:detail)</h4>
<h4>Details (sh:detail)</h4>
<p>
The property <code>sh:detail</code> may link a (parent) result with one or more other
(child) results that provide further details about the cause of the (parent) result.
Depending on the capabilities of the SHACL processor, this may include violations of
nested constraints that have been evaluated via <code>sh:node</code>.
</p>
<p id="results-exclusions">
Any validation results produced by the processing of shapes as values of <a>shape-expecting constraint parameters</a> except <code>sh:property</code> (such as <code>sh:node</code>)
are temporary, i.e. they are not <a>top-level</a> results in the results graph of the surrounding validation process.
Only the validation results that are not <a>object</a> of any <code>sh:details</code> triple in the results graph are <dfn>top-level</dfn> results.
The property <code>sh:detail</code> may link a (parent) result with one or more SHACL instances of
<code>sh:AbstractResult</code> that can provide further details about the cause of the (parent) result.
Depending on the capabilities of the SHACL processor, this may for example include violations of
<a>nested</a> constraints that have been evaluated via <code>sh:node</code>.
</p>
</section>
<section id="results-message">
Expand Down Expand Up @@ -2049,7 +2059,7 @@ <h2>Core Constraint Components</h2>
<code>$paramName</code> where <code>paramName</code> is the part of the parameter's <a>IRI</a> after the <code>sh:</code> namespace.
For example, the textual definition of <code>sh:ClassConstraintComponent</code> refers to the value of
<code>sh:class</code> using the variable <code>$class</code>.
Note that these validators define the only validation results that are being produced by the component.
Note that these validators define the <em>only</em> validation results that are being produced by the component.
Furthermore, the validators always produce <em>new</em> result nodes, i.e. when the textual definition states that
&quot;...a validation result MUST be produced...&quot; then this refers to a distinct new node in a results graph.
</p>
Expand Down Expand Up @@ -2119,7 +2129,7 @@ <h4>sh:class</h4>
<div class="def-text-body" data-validator="Class">
For each <a>value node</a>
that is either a <a>literal</a>, or a non-literal that is not a <a>SHACL instance</a> of <code>$class</code> in the <a>data graph</a>,
a <a>validation result</a> MUST be produced with the <a>value node</a> as <code>sh:value</code>.
there is a <a>validation result</a> with the <a>value node</a> as <code>sh:value</code>.
</div>
</div>
<p><em>The remainder of this section is informative.</em></p>
Expand Down Expand Up @@ -3522,7 +3532,7 @@ <h4>sh:node</h4>
<section id="PropertyConstraintComponent">
<h4>sh:property</h4>
<p>
<code>sh:property</code> specifies the condition that each <a>value node</a> conforms to the given <a>property shape</a>.
<code>sh:property</code> can be used to specify that each <a>value node</a> has a given <a>property shape</a>.
</p>
<p>
<span class="component-class">Constraint Component IRI</span>: <code>sh:PropertyShapeComponent</code>
Expand All @@ -3537,7 +3547,7 @@ <h4>sh:property</h4>
<tr>
<td><code>sh:property</code></td>
<td>
A <a>property shape</a> that all value nodes need to conform to.
A <a>property shape</a> that all value nodes need to have.
<span data-syntax-rule="property-shape">Each value of <code>sh:property</code> must be a <a>well-formed</a> <a>property shape</a>.</span>
</td>
</tr>
Expand Down Expand Up @@ -4259,10 +4269,10 @@ <h2>SPARQL-based Constraint Components</h2>
<a>SPARQL-based constraints</a> provide a lot of flexibility
but may be hard to understand for some people or lead to repetition.
This section introduces <a>SPARQL-based constraint components</a> as a way to abstract the complexity of SPARQL
and to declare high level reusable components similar to the <a href="#core-components">Core constraint components</a>.
and to declare high-level reusable components similar to the <a href="#core-components">Core constraint components</a>.
Such constraint components can be declared using the SHACL RDF vocabulary and thus shared and reused.
</p>

<section class="informative">
<h3>An Example SPARQL-based Constraint Component</h3>
<p>
Expand Down

0 comments on commit af5aedc

Please sign in to comment.