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
#173: Support sh:message, sh:severity, and sh:deactivated per constraint triple (#396)
* #173: Added reification support for sh:deactivated
* #173: sh:severity can now be set as reifier
* #173: Support for sh:message using reification
* #173: Removed domain from sh:severity
* Update shacl12-core/index.html
Co-authored-by: Thomas Bergwinkl <bergos@users.noreply.github.com>
---------
Co-authored-by: Thomas Bergwinkl <bergos@users.noreply.github.com>
<h4>Declaring the Severity of a Shape or Constraint</h4>
1728
1728
<pclass="syntax">
1729
1729
<spandata-syntax-rule="severity-maxCount">Shapes can specify one <a>value</a> for the property <code>sh:severity</code> in the <a>shapes graph</a>.</span>
1730
-
<spandata-syntax-rule="severity-nodeKind">Each value of <code>sh:severity</code>in a shape is an <a>IRI</a>.</span>
1730
+
<spandata-syntax-rule="severity-nodeKind">Each value of <code>sh:severity</code> is an <a>IRI</a>.</span>
1731
1731
</p>
1732
1732
<p>
1733
1733
The values of <code>sh:severity</code> are called <dfndata-lt="severity">severities</dfn>.
@@ -1752,6 +1752,17 @@ <h4>Declaring the Severity of a Shape</h4>
1752
1752
<td>A constraint violation.</td>
1753
1753
</tr>
1754
1754
</table>
1755
+
<p>
1756
+
In addition to declaring severities per shape, the property <code>sh:severity</code> can also be used
1757
+
on a <a>reifier</a> for a triple where the <a>shape</a> is the <a>subject</a> and one of the <a>parameters</a>
<h4>Declaring Messages for a Shape or Constraint</h4>
1945
1984
<pclass="syntax">
1946
1985
Shapes can have values for the property <code>sh:message</code>.
1947
-
<spandata-syntax-rule="message-datatype">The values of <code>sh:message</code>in a shape are either <code>xsd:string</code> literals or literals with a language tag.</span>
1948
-
A shape should not have more than one value for <code>sh:message</code> with the same language tag.
1986
+
<spandata-syntax-rule="message-datatype">The values of <code>sh:message</code> are either <code>xsd:string</code> literals or literals with a language tag.</span>
1987
+
A subject should not have more than one value for <code>sh:message</code> with the same language tag.
1949
1988
</p>
1950
1989
<p>
1951
1990
If a shape has at least one value for <code>sh:message</code> in the shapes graph, then
1952
1991
all <a>validation results</a> produced as a result of the shape will have exactly these messages
1953
1992
as their value of <code>sh:resultMessage</code>, i.e. the values will be copied from the shapes graph
1954
1993
into the results graph.
1955
1994
</p>
1995
+
<p>
1996
+
In addition to declaring messages per shape, the property <code>sh:message</code> can also be used
1997
+
on a <a>reifier</a> for a triple where the <a>shape</a> is the <a>subject</a> and one of the <a>parameters</a>
1998
+
of the <a>constraint</a> is the <a>predicate</a>.
1999
+
</p>
2000
+
<pclass="syntax">
2001
+
<spandata-syntax-rule="message-reifier-maxCount">
2002
+
Let <code>T</code> be the set of <a>triples</a> that represent a <a>constraint</a> in a <a>shape</a>.
2003
+
A <a>shapes graph</a> can specify at most one <a>value</a> for the property <code>sh:message</code>
2004
+
in the <a>reifiers</a> of the <a>triples</a> in <code>T</code>.
2005
+
</p>
1956
2006
<p><em>The remainder of this section is informative.</em></p>
1957
2007
<p>
1958
-
The example from the previous section uses this mechanism to supply the second validation result
1959
-
with two messages.
1960
2008
See the <ahref="#results-message">section on <code>sh:resultMessage</code> in the validation results</a>
1961
2009
on further details on how the values of <code>sh:resultMessage</code> are populated.
1962
2010
</p>
2011
+
<p>
2012
+
The example from the previous section uses this mechanism to supply the second validation result
2013
+
with two messages.
2014
+
The following example is a variation where the message is declared using reification.
Each validation result has exactly one <a>value</a> for the property <code>sh:resultSeverity</code>, and this value is an <a>IRI</a>.
2916
-
The value is equal to the <a>value</a> of <ahref="#severity"><code>sh:severity</code></a> of the <a>shape</a> in the <a>shapes graph</a> that caused the result,
2917
-
defaulting to <code>sh:Violation</code> if no <code>sh:severity</code> has been specified for the shape.
3027
+
The value is determined by the following rules (in order):
2918
3028
</p>
3029
+
<ol>
3030
+
<li>the <a>value</a> of <ahref="#severity"><code>sh:severity</code></a> at a <a>reifier</a> of any of the <a>triples</a> containing the <a>parameters</a> of the <a>constraint</a> that caused the result</li>
3031
+
<li>the <a>value</a> of <ahref="#severity"><code>sh:severity</code></a> of the <a>shape</a> in the <a>shapes graph</a> that caused the result</li>
3032
+
<li>defaulting to <code>sh:Violation</code> if no <code>sh:severity</code> has been specified for the shape or constraint.</li>
3033
+
</ol>
2919
3034
</section>
2920
3035
</section>
2921
3036
</section>
@@ -6754,6 +6869,7 @@ <h2>Changes between SHACL 1.0 Core and SHACL 1.2 Core</h2>
6754
6869
<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>
6755
6870
<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>
6756
6871
<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>
6872
+
<li>Values for <ahref="#deactivated"><code>sh:deactivated</code></a>, <ahref="#message"><code>sh:message</code></a> and <ahref="#severity"><code>sh:severity</code></a> can now be specified using RDF 1.2 reification, see <ahref="https://github.com/w3c/data-shapes/issues/173">Issue 173</a></li>
0 commit comments