Skip to content

Commit

Permalink
ISSUE-139: Made some properties ill-formed at node shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
HolgerKnublauch committed Feb 9, 2017
1 parent ae310ad commit 9ca4d67
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions shacl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,10 @@ <h3>SHACL Example</h3>
sh:closed true ;
sh:ignoredProperties ( rdf:type ) .</pre>
<p>
The example below shows the same shape definition as a JSON-LD [[json-ld]] fragment
(assuming a suitable <code>@context</code> declaration for syntactic sugar and prefixes exists).
The example below shows the same shape definition as a possible JSON-LD [[json-ld]] fragment.
Note that we have left out a <code>@context</code> declaration, and depending on the
<code>@context</code> the rendering may look quite different.
Therefore this example should be understood as an illustration only.
</p>
<pre class="example-shapes jsonld">
{
Expand Down Expand Up @@ -2032,11 +2034,9 @@ <h2>Core Constraint Components</h2>
It is expected that additional reusable libraries of <a>constraint components</a> will be maintained by third parties.
</p>
<p>
All constraint components can be used both in <a>property shapes</a> and <a>node shapes</a>.
However, some components may always result in violations in a particular shape type.
For example, <a href="#MinCountConstraintComponent">sh:minCount</a> does not make sense in <a>node shapes</a> unless the
value of <code>sh:minCount</code> is <code>1</code>, because the set of <a>value nodes</a> used during the validation of
<a>node shapes</a> always consists of the <a>focus node</a> only.
By default, all constraint components can be used both in <a>property shapes</a> and <a>node shapes</a>.
However, some constraint parameters have syntax rules attached to them that would make <a>node shapes</a> that use these parameters <a>ill-formed</a>.
Examples of this include <code>sh:minCount</code> which is only supported for <a>property shapes</a>.
</p>
<p class="def-sparql">
The SPARQL definitions in this section represent potential <a href="#constraint-components-validators">validators</a>.
Expand Down Expand Up @@ -2260,6 +2260,7 @@ <h4>sh:minCount</h4>
<td>
The minimum cardinality.
<span data-syntax-rule="minCount-datatype">The values of <code>sh:minCount</code> are literals with datatype <code>xsd:integer</code>.</span>
<span data-syntax-rule="minCount-scope"><a>Node shapes</a> cannot have any value for <code>sh:minCount</code>.</span>
</td>
</tr>
</table>
Expand Down Expand Up @@ -2318,6 +2319,7 @@ <h4>sh:maxCount</h4>
<td>
The maximum cardinality.
<span data-syntax-rule="maxCount-datatype">The values of <code>sh:maxCount</code> are literals with datatype <code>xsd:integer</code>.</span>
<span data-syntax-rule="maxCount-scope"><a>Node shapes</a> cannot have any value for <code>sh:maxCount</code>.</span>
</td>
</tr>
</table>
Expand Down Expand Up @@ -2801,6 +2803,7 @@ <h4>sh:uniqueLang</h4>
<td>
<code>true</code> to activate this constraint.
<span data-syntax-rule="uniqueLang-datatype">The values of <code>sh:uniqueLang</code> are literals with datatype <code>xsd:boolean</code>.</span>
<span data-syntax-rule="uniqueLang-scope"><a>Node shapes</a> cannot have any value for <code>sh:uniqueLang</code>.</span>
</td>
</tr>
</table>
Expand Down Expand Up @@ -2856,8 +2859,7 @@ <h4>sh:uniqueLang</h4>
<h3>Property Pair Constraint Components</h3>
<p>
The constraint components in this section specify conditions on the sets of <a>value nodes</a> in relation to other properties.
<a>Value nodes</a> of <a>node shapes</a> are always defined as a set of size 1
and may produce unexpected results when used with constraint components of this category.
These constraint components can only be used by <a>property shapes</a>.
</p>

<section id="EqualsConstraintComponent">
Expand All @@ -2880,6 +2882,7 @@ <h4>sh:equals</h4>
<td>
The property to compare with.
<span data-syntax-rule="equals-nodeKind">The values of <code>sh:equals</code> are <a>IRIs</a>.</span>
<span data-syntax-rule="equals-scope"><a>Node shapes</a> cannot have any value for <code>sh:equals</code>.</span>
</td>
</tr>
</table>
Expand Down Expand Up @@ -2953,6 +2956,7 @@ <h4>sh:disjoint</h4>
<td>
The property to compare the values with.
<span data-syntax-rule="disjoint-nodeKind">The values of <code>sh:disjoint</code> are <a>IRIs</a>.</span>
<span data-syntax-rule="disjoint-scope"><a>Node shapes</a> cannot have any value for <code>sh:disjoint</code>.</span>
</td>
</tr>
</table>
Expand Down Expand Up @@ -3016,6 +3020,7 @@ <h4>sh:lessThan</h4>
<td>
The property to compare the values with.
<span data-syntax-rule="lessThan-nodeKind">The values of <code>sh:lessThan</code> are <a>IRIs</a>.</span>
<span data-syntax-rule="lessThan-scope"><a>Node shapes</a> cannot have any value for <code>sh:lessThan</code>.</span>
</td>
</tr>
</table>
Expand Down Expand Up @@ -3072,6 +3077,7 @@ <h4>sh:lessThanOrEquals</h4>
<td>
The property to compare the values with.
<span data-syntax-rule="lessThanOrEquals-nodeKind">The values of <code>sh:lessThanOrEquals</code> are <a>IRIs</a>.</span>
<span data-syntax-rule="lessThanOrEquals-scope"><a>Node shapes</a> cannot have any value for <code>sh:lessThanOrEquals</code>.</span>
</td>
</tr>
</table>
Expand Down Expand Up @@ -3536,9 +3542,6 @@ <h4>sh:qualifiedValueShape, sh:qualifiedMinCount, sh:qualifiedMaxCount</h4>
<code>sh:qualifiedValueShape</code> specifies the condition that a specified number of <a>value nodes</a> conforms to the given shape.
Each <code>sh:qualifiedValueShape</code> can have: one value for <code>sh:qualifiedMinCount</code>, one value for <code>sh:qualifiedMaxCount</code> or, one value for each, at the same <a>subject</a>.
</p>
<p>
<span class="component-class">Constraint Component IRI</span>: <code>sh:QualifiedValueShapeConstraintComponent</code>
</p>

<div class="parameters">Parameters:</div>
<table class="term-table">
Expand All @@ -3551,6 +3554,7 @@ <h4>sh:qualifiedValueShape, sh:qualifiedMinCount, sh:qualifiedMaxCount</h4>
<td>
The shape that the specified number of value nodes needs to conform to.
<span data-syntax-rule="qualifiedValueShape-shape">The values of <code>sh:qualifiedValueShape</code> must be <a>well-formed</a> <a>shapes</a>.</span>
<span data-syntax-rule="qualifiedValueShape-scope"><a>Node shapes</a> cannot have any value for <code>sh:qualifiedValueShape</code>.</span>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -3603,6 +3607,7 @@ <h4>sh:qualifiedValueShape, sh:qualifiedMinCount, sh:qualifiedMaxCount</h4>
<a>value nodes</a> has produced a <a>failure</a>.
Otherwise, a <a>validation result</a> MUST be produced if <code>C</code>
is less than <code>$qualifiedMinCount</code>.
The <a>constraint component</a> for <code>sh:qualifiedMinCount</code> is <code>sh:QualifiedMinCountConstraintComponent</code>.
</div>
</div>

Expand All @@ -3614,6 +3619,7 @@ <h4>sh:qualifiedValueShape, sh:qualifiedMinCount, sh:qualifiedMaxCount</h4>
<a>value nodes</a> has produced a <a>failure</a>.
Otherwise, a <a>validation result</a> MUST be produced if <code>C</code>
is greater than <code>$qualifiedMaxCount</code>.
The <a>constraint component</a> for <code>sh:qualifiedMaxCount</code> is <code>sh:QualifiedMaxCountConstraintComponent</code>.
</div>
</div>

Expand Down Expand Up @@ -4639,6 +4645,8 @@ <h2>Revision History</h2>
The detailed list of changes and their diffs can be found in the <a href="https://github.com/w3c/data-shapes/commits/gh-pages/shacl/index.html">Git repository</a>.
</p>
<ul>
<li><b>2017-02-09</b>: Declared the use of sh:minCount, sh:maxCount, sh:uniqueLang, the 4 property pair parameters and sh:qualifiedValueShape at node shapes ill-formed (<a href="http://www.w3.org/2014/data-shapes/track/issues/139">ISSUE-139</a>)</li>
<li><b>2017-02-09</b>: Corrected the constraint component IRIs of sh:qualifiedMinCount and sh:qualifiedMaxCount</li>
<li><b>2017-02-08</b>: Clarified validation of ASK-based constraint components in 6.3</li>
<li><b>2017-02-07</b>: Slightly updated definition of pre-binding (now about query instead of graph pattern)</li>
<li><b>2017-02-07</b>: Added an example snippet in JSON-LD</li>
Expand Down

0 comments on commit 9ca4d67

Please sign in to comment.