Skip to content

Commit

Permalink
Defined and used the term RDF list (https://lists.w3.org/Archives/Pub…
Browse files Browse the repository at this point in the history
  • Loading branch information
HolgerKnublauch committed Oct 14, 2016
1 parent 15b0db4 commit 3483adc
Showing 1 changed file with 34 additions and 24 deletions.
58 changes: 34 additions & 24 deletions shacl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,16 @@ <h3>Terminology</h3>
<a href="https://www.w3.org/TR/sparql11-query/#rTriplesBlock"><code>TriplesBlock</code></a> of the form <code>s path ?o</code>.
</div>
</div>
<div class="def">
<div class="term-def-header">RDF Lists</div>
<div>
In this document, an <dfn data-lt="RDF lists">RDF list</dfn> is an <a>IRI</a> or <a>blank node</a>
that is either <code>rdf:nil</code>, or has exactly one <a>value</a> for the property <code>rdf:first</code>
and exactly one <a>value</a> for the property <code>rdf:rest</code> that is also an RDF list.
The <a>values</a> of the <a>path</a> <code>rdf:rest*/rdf:first</code> starting from a given list node
are called the <dfn data-lt="member">members</dfn> of the list.
</div>
</div>
<div class="def">
<div class="term-def-header">SHACL Subclass, SHACL superclass</div>
<div>
Expand Down Expand Up @@ -1189,12 +1199,12 @@ <h4>Property Paths</h4>
</li>
<li>
If the graph contains a <a>triple</a> of the form <code>p rdf:first elt</code>,
the path must be a well-formed RDF list with a at least two members.
the path must be an <a>RDF list</a> with a at least two <a>members</a>.
Each member must be valid SHACL property path that is converted into a sequence of either <code>SequencePath</code> or <code>AlternativePath</code> elements.
</li>
<li>
If the graph contains a <a>triple</a> of the form <code>p sh:alternativePath elt</code>,
the value of path must be a well-formed RDF list with a at least two members.
the value of path must be an <a>RDF list</a> with a at least two <a>members</a>.
All members must be valid SHACL property paths that become a series of <code>AlternativePath</code> elements.
</li>
<li>
Expand Down Expand Up @@ -2266,7 +2276,7 @@ <h4>sh:languageIn</h4>
<tr>
<td><code>sh:languageIn</code></td>
<td><code>rdf:List</code></td>
<td>A list of language ranges (list members are <code>xsd:string</code>)</td>
<td>An <a>RDF list</a> of language ranges (<a>members</a> must have datatype <code>xsd:string</code>)</td>
</tr>
</table>
<div class="def def-text">
Expand Down Expand Up @@ -2708,7 +2718,7 @@ <h3>sh:and</h3>
This is comparable to a logical "and" operator.
</p>
<p>
All the non-literal member nodes of <code>rdf:List</code>s that are objects of triples with <code>sh:and</code> as predicate have <code>sh:Shape</code> as <a>expected type</a>.
All the non-literal <a>members</a> of <a>RDF lists</a> that are objects of triples with <code>sh:and</code> as predicate have <code>sh:Shape</code> as <a>expected type</a>.
</p>
<p>
<span class="component-class">Constraint Component IRI</span>: <code>sh:AndConstraintComponent</code>
Expand All @@ -2724,15 +2734,15 @@ <h3>sh:and</h3>
<tr>
<td><code>sh:and</code></td>
<td><code>rdf:List</code> (members: <code>sh:Shape</code>)</td>
<td>List of shapes to validate the value nodes against</td>
<td><a>RDF list</a> of shapes to validate the value nodes against</td>
</tr>
</table>
<div class="def def-text">
<div class="def-header">TEXTUAL DEFINITION</div>
<div class="def-text-body">
A <a>validation result</a> must be produced for each <a>value node</a> if the following condition is false:
The validation of the <a>value node</a> against all of the <a>shapes</a> in the <code>sh:and</code> list produces a <a>validation result</a> for at least one shape.
A <a>failure</a> must be produced if the validation of one of the shapes produces a <a>failure</a>.
The validation of the <a>value node</a> against all of the <a>members</a> of the <a>RDF list</a> that is the value of <code>sh:and</code> produces a <a>validation result</a> for at least one <a>member</a>.
A <a>failure</a> must be produced if the validation of one of the <a>members</a> produces a <a>failure</a>.
</div>
</div>
<p>
Expand Down Expand Up @@ -2785,7 +2795,7 @@ <h3>sh:or</h3>
This is comparable to a logical "or" operator.
</p>
<p>
All the non-literal member nodes of <code>rdf:List</code>s that are objects of triples with <code>sh:or</code> as predicate have <code>sh:Shape</code> as <a>expected type</a>.
All the non-literal <a>members</a> of <a>RDF lists</a> that are objects of triples with <code>sh:or</code> as predicate have <code>sh:Shape</code> as <a>expected type</a>.
</p>
<p>
<span class="component-class">Constraint Component IRI</span>: <code>sh:OrConstraintComponent</code>
Expand All @@ -2801,15 +2811,15 @@ <h3>sh:or</h3>
<tr>
<td><code>sh:or</code></td>
<td><code>rdf:List</code> (members: <code>sh:Shape</code>)</td>
<td>List of shapes to validate the value nodes against</td>
<td><a>RDF list</a> of shapes to validate the value nodes against</td>
</tr>
</table>
<div class="def def-text">
<div class="def-header">TEXTUAL DEFINITION</div>
<div class="def-text-body">
A <a>validation result</a> must be produced for each <a>value node</a> if the following condition is false:
The validation of the <a>value node</a> against all of the <a>shapes</a> in the <code>sh:or</code> list produces no <a>validation results</a> for at least one shape.
A <a>failure</a> must be produced if the <a>validation</a> of one of the shapes produces a <a>failure</a>.
The validation of the <a>value node</a> against all of the <a>members</a> in the <a>RDF list</a> that is the value of <code>sh:or</code> produces no <a>validation results</a> for at least one <a>member</a>.
A <a>failure</a> must be produced if the <a>validation</a> of one of the <a>members</a> produces a <a>failure</a>.
</div>
</div>
<p>
Expand Down Expand Up @@ -3129,7 +3139,7 @@ <h4>sh:partition</h4>
)
] .</pre>
<p>
The value of the <code>sh:partition</code> constraint parameter MUST be an <code>rdf:List</code> that contains zero or more resources.
The value of the <code>sh:partition</code> constraint parameter MUST be an <a>RDF list</a> that contains zero or more resources.
Each resource in the list defines conditions on a subset of the value nodes and may contain the following parameters:
</p>
<ul>
Expand All @@ -3142,12 +3152,12 @@ <h4>sh:partition</h4>
The corresponding subset consists of those remaining nodes for which the boolean function is <code>true</code>.</li>
</ul>
<p>
Note that a resource that contains no parameters matches all nodes. Such a resource is useful as the last member of the list where it acts as a default matching rule in the case where nodes that do not match any of the preceeding constraints are allowed.
Note that a resource that contains no parameters matches all nodes. Such a resource is useful as the last <a>member</a> of the list where it acts as a default matching rule in the case where nodes that do not match any of the preceeding constraints are allowed.
Note also that a qualified cardinality constraint defined using <code>sh:qualifiedValueShape</code>,
<code>sh:qualifiedMinCount</code>, and <code>sh:qualifiedMaxCount</code> is equivalent to a <code>sh:partition</code> constraint that contains two resources with the first one containing the corresponding parameters and the last one being the default matching rule that matches any set of nodes.
</p>
<p>
Each member of the list is used by the SHACL processor to match a subset of the value nodes.
Each <a>member</a> of the list is used by the SHACL processor to match a subset of the value nodes.
The SHACL processor matches as many nodes as possible and then compares the result with the specified
minimum and maximum cardinalities if specified. This is referred to as a <em>greedy</em> matching algorithm.
Greedy pattern matching is commonly used with textual regular expressions.
Expand All @@ -3165,7 +3175,7 @@ <h4>sh:partition</h4>
then N consists of all the nodes X such that (F, P, X) is in D.</li>
</ul>
<p>
Let the value of the <code>sh:partition</code> parameter be the list (Q<sub>1</sub>, ..., Q<sub>n</sub>) of resources.
Let the value of the <code>sh:partition</code> parameter be the <a>RDF list</a> with <a>members</a> (Q<sub>1</sub>, ..., Q<sub>n</sub>).
The SHACL processor MUST perform the following steps to validate the constraint C at F.
</p>
<ol>
Expand All @@ -3184,8 +3194,8 @@ <h4>sh:partition</h4>
<li>If R is non-empty and no violations have been reported yet then report a violation.</li>
</ol>
<p>
Note that the order of resources within the list is significant.
In general, if the members of the list are reordered then different value node sets will be matched
Note that the order of resources within the RDF list is significant.
In general, if the members of the RDF list are reordered then different value node sets will be matched
and different violation results will be reported.
</p>
</section>
Expand Down Expand Up @@ -3226,7 +3236,7 @@ <h3>sh:closed, sh:ignoredProperties</h3>
<tr>
<td><code>sh:ignoredProperties</code></td>
<td><code>rdf:List</code> (members: <code>rdf:Property</code>)</td>
<td>Optional list of properties that are also permitted in addition to those explicitly enumerated via <code>sh:property</code></td>
<td>Optional <a>RDF list</a> of properties that are also permitted in addition to those explicitly enumerated via <code>sh:property</code></td>
</tr>
</table>
<div id="def-ClosedShape-text" class="def def-text">
Expand All @@ -3236,7 +3246,7 @@ <h3>sh:closed, sh:ignoredProperties</h3>
a <a>validation result</a> must be produced for each <a>triple</a> that has the <a>focus node</a> as its
<a>subject</a> and a <a>predicate</a> that is not explicitly enumerated as a <code>sh:predicate</code>
in any of the <code>sh:property</code> constraints at the surrounding shape.
If the parameter <code>sh:ignoredProperties</code> is present then the properties enumerated in this list are also permitted.
If the parameter <code>sh:ignoredProperties</code> is present then the properties enumerated in this <a>RDF list</a> are also permitted.
The produced <a>validation result</a> must have the predicate of the triple as its <code>sh:path</code>,
and the object of the triple as its <code>sh:value</code>.
</div>
Expand Down Expand Up @@ -3343,7 +3353,7 @@ <h4>sh:hasValue</h4>
<h4>sh:in</h4>
<p>
The property <code>sh:in</code> exclusively enumerates the permitted <a>value nodes</a>.
For example when specified as part of a <a>property constraint</a>, then each <a>value</a> of the given property must be a member of the specified list.
For example when specified as part of a <a>property constraint</a>, then each <a>value</a> of the given property must be a <a>member</a> of the specified <a>RDF list</a>.
</p>
<p>
<span class="component-class">Constraint Component IRI</span>: <code>sh:InConstraintComponent</code>
Expand All @@ -3359,16 +3369,16 @@ <h4>sh:in</h4>
<tr>
<td><code>sh:in</code></td>
<td><code>rdf:List</code></td>
<td>Enumeration of allowed values</td>
<td><a>RDF list</a> that has the allowed values as <a>members</a></td>
</tr>
</table>
<div class="def def-text">
<div class="def-header">TEXTUAL DEFINITION</div>
<div class="def-text-body">
The values of <code>sh:in</code> must be well-formed <code>rdf:List</code>s.
The members of that <code>rdf:List</code> must not be blank nodes.
The values of <code>sh:in</code> must be <a>RDF lists</a>.
The <a>members</a> of that RDF list must not be blank nodes.
A <a>validation result</a> must be produced for every <a>value node</a>
that is not a member of the given list.
that is not a member of the given RDF list.
Matching of literals needs to be exact, e.g. <code>"04"^^xsd:byte</code> does not match <code>"4"^^xsd:integer</code>.
</div>
</div>
Expand Down

0 comments on commit 3483adc

Please sign in to comment.