Skip to content

Commit 9087b46

Browse files
authored
Merge pull request #409 from w3c/issue-192-severity-levels
feat: #192 add severity levels that are not violations
2 parents 8723072 + cb7b0ae commit 9087b46

File tree

5 files changed

+114
-2
lines changed

5 files changed

+114
-2
lines changed

shacl12-core/index.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,6 +1771,14 @@ <h4>Declaring the Severity of a Shape or Constraint</h4>
17711771
<th>Severity</th>
17721772
<th>Description</th>
17731773
</tr>
1774+
<tr>
1775+
<td><code>sh:Trace</code></td>
1776+
<td>A trace message that is not a violation.</td>
1777+
</tr>
1778+
<tr>
1779+
<td><code>sh:Debug</code></td>
1780+
<td>A debug message that is not a violation.</td>
1781+
</tr>
17741782
<tr>
17751783
<td><code>sh:Info</code></td>
17761784
<td>A non-critical constraint violation indicating an informative message.</td>
@@ -1784,6 +1792,10 @@ <h4>Declaring the Severity of a Shape or Constraint</h4>
17841792
<td>A constraint violation.</td>
17851793
</tr>
17861794
</tbody></table>
1795+
<p>
1796+
Validation engines MAY treat <code>sh:Info</code> and <code>sh:Warning</code> as non-violating based on
1797+
options passed to the engine. By default, they are treated as violations.
1798+
</p>
17871799
<p>
17881800
In addition to declaring severities per shape, the property <code>sh:severity</code> can also be used
17891801
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>
@@ -2843,7 +2855,7 @@ <h4>Handling of Recursive Shapes</h4>
28432855
<h3>Conformance Checking</h3>
28442856
<p>
28452857
A <a>focus node</a> <dfn data-lt="conform|conformance">conforms</dfn> to a <a>shape</a> if and only if
2846-
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>
2858+
the set of result of the <a>validation</a> of the <a>focus node</a> against the <a>shape</a> does not contain any results with a severity level representing a violation and no <a>failure</a>
28472859
has been reported by it.
28482860
</p>
28492861
<p>
@@ -2958,7 +2970,7 @@ <h5>Conforms (sh:conforms)</h5>
29582970
<p>
29592971
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>.
29602972
It represents the outcome of the <a>conformance checking</a>.
2961-
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>, and <code>false</code> otherwise.
2973+
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> with a severity level representing a violation, and <code>false</code> otherwise.
29622974
</p>
29632975
</section>
29642976
<section id="result">

shacl12-test-suite/tests/core/misc/manifest.ttl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@
1313
mf:include <severity-001.ttl> ;
1414
mf:include <severity-002.ttl> ;
1515
mf:include <severity-003.ttl> ;
16+
mf:include <severity-004.ttl> ;
17+
mf:include <severity-005.ttl> ;
1618
.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@prefix dash: <http://datashapes.org/dash#> .
2+
@prefix ex: <http://example.com/ns#> .
3+
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
4+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
5+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
6+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
7+
@prefix sh: <http://www.w3.org/ns/shacl#> .
8+
@prefix sht: <http://www.w3.org/ns/shacl-test#> .
9+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
10+
11+
ex:TestShape
12+
rdf:type sh:NodeShape ;
13+
sh:datatype xsd:integer ;
14+
sh:severity sh:Debug ;
15+
sh:targetNode "Hello" ;
16+
.
17+
<>
18+
rdf:type mf:Manifest ;
19+
mf:entries (
20+
<severity-004>
21+
) ;
22+
.
23+
<severity-004>
24+
rdf:type sht:Validate ;
25+
rdfs:label "Test of sh:severity sh:Debug 004" ;
26+
mf:action [
27+
sht:dataGraph <> ;
28+
sht:shapesGraph <> ;
29+
] ;
30+
mf:result [
31+
rdf:type sh:ValidationReport ;
32+
sh:conforms "true"^^xsd:boolean ;
33+
sh:result [
34+
rdf:type sh:ValidationResult ;
35+
sh:focusNode "Hello" ;
36+
sh:resultSeverity sh:Debug ;
37+
sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
38+
sh:sourceShape ex:TestShape ;
39+
sh:value "Hello" ;
40+
] ;
41+
] ;
42+
mf:status sht:approved ;
43+
.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@prefix dash: <http://datashapes.org/dash#> .
2+
@prefix ex: <http://example.com/ns#> .
3+
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
4+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
5+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
6+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
7+
@prefix sh: <http://www.w3.org/ns/shacl#> .
8+
@prefix sht: <http://www.w3.org/ns/shacl-test#> .
9+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
10+
11+
ex:TestShape
12+
rdf:type sh:NodeShape ;
13+
sh:datatype xsd:integer ;
14+
sh:severity sh:Trace ;
15+
sh:targetNode "Hello" ;
16+
.
17+
<>
18+
rdf:type mf:Manifest ;
19+
mf:entries (
20+
<severity-005>
21+
) ;
22+
.
23+
<severity-005>
24+
rdf:type sht:Validate ;
25+
rdfs:label "Test of sh:severity sh:Trace 005" ;
26+
mf:action [
27+
sht:dataGraph <> ;
28+
sht:shapesGraph <> ;
29+
] ;
30+
mf:result [
31+
rdf:type sh:ValidationReport ;
32+
sh:conforms "true"^^xsd:boolean ;
33+
sh:result [
34+
rdf:type sh:ValidationResult ;
35+
sh:focusNode "Hello" ;
36+
sh:resultSeverity sh:Trace ;
37+
sh:sourceConstraintComponent sh:DatatypeConstraintComponent ;
38+
sh:sourceShape ex:TestShape ;
39+
sh:value "Hello" ;
40+
] ;
41+
] ;
42+
mf:status sht:approved ;
43+
.

shacl12-vocabularies/shacl.ttl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,18 @@ sh:Severity
221221
rdfs:subClassOf rdfs:Resource ;
222222
rdfs:isDefinedBy sh: .
223223

224+
sh:Trace
225+
a sh:Severity ;
226+
rdfs:label "Trace"@en ;
227+
rdfs:comment "The severity for a trace validation result."@en ;
228+
rdfs:isDefinedBy sh: .
229+
230+
sh:Debug
231+
a sh:Severity ;
232+
rdfs:label "Debug"@en ;
233+
rdfs:comment "The severity for a debug validation result."@en ;
234+
rdfs:isDefinedBy sh: .
235+
224236
sh:Info
225237
a sh:Severity ;
226238
rdfs:label "Info"@en ;

0 commit comments

Comments
 (0)