diff --git a/shacl12-core/index.html b/shacl12-core/index.html index b23d37b2..48ee624a 100644 --- a/shacl12-core/index.html +++ b/shacl12-core/index.html @@ -1486,10 +1486,6 @@

Declaring the Severity of a Shape or Constraint

A constraint violation. -

- Validation engines MAY treat sh:Info and sh:Warning as non-violating based on - options passed to the engine. By default, they are treated as violations. -

In addition to declaring severities per shape, the property sh:severity can also be used on a reifier for a triple where the shape is the subject and one of the parameters @@ -1503,8 +1499,8 @@

Declaring the Severity of a Shape or Constraint

The remainder of this section is informative.

- The specific values of sh:severity have no impact on the validation, - but MAY be used by user interface tools to categorize validation results. + The validation process handles the values of sh:severity according to conformance checking. + Additionally, user interface tools MAY use the values to categorize validation results. The values of sh:severity are used by SHACL processors to populate the sh:resultSeverity field of validation results, see section on severity in validation results. Any IRI can be used as a severity. @@ -2280,10 +2276,16 @@

Handling of Recursive Shapes

Conformance Checking

- A focus node conforms to a shape if and only if - the set of result of the validation of the focus node against the shape does not contain any results with a severity level representing a violation and no failure + A focus node conforms to a shape if and only if + the set of result of the validation of the focus node against the shape does not contain any validation results with a severity level of the set of disallowed levels and no failure has been reported by it.

+

+ The set of disallowed severity levels is defined as the objects of triples with predicate + sh:conformanceDisallows and the validation report as subject. + If the validation report contains no such triples, sh:Violation, sh:Warning, and + sh:Info are set as defaults. +

Conformance checking produces true if and only if a given focus node conforms to a given shape, and false otherwise. @@ -2316,9 +2318,19 @@

Validation Report

+
+
Conformance-Disallow Set (`sh:conformanceDisallows`)
+

+ Each SHACL instance of sh:ValidationReport in the results graph MAY have one or more values + for the property sh:conformanceDisallows. All values of sh:conformanceDisallows MUST be IRIs. +

+

+ All values combined define the set of disallowed + severity levels. Presence of any sh:ValidationResult with a severity level in the set of + disallowed severity levels MUST result in a sh:conforms value + of false on the associated sh:ValidationReport instance. +

+

+ If no values are present in the results graph for the property + sh:conformanceDisallows, then a default set MUST be used, comprised of + sh:Violation, sh:Warning, and sh:Info. +

+

+ The conformance-disallow set is defined by the validation engine. + A validation engine MAY provide mechanisms to customize this set.

@@ -5622,6 +5655,7 @@

Changes between the original SHACL Core and SHACL 1.2 Core

  • Added the new constraint component sh:ReifierShape; see Issue 300
  • Added parameter to look up rdfs:subClassOf triples in the union of the shapes graph and the data graph; see Issue 185
  • Generalized to also allow xsd:integers; see Issue 479
  • +
  • Added new sh:conformanceDisallows property to the validation report; see Issue 453
  • Added annotation property ; see Issue 559
  • Added the target types sh:targetWhere and sh:shape, see Issue 517
  • diff --git a/shacl12-test-suite/tests/core/validation-reports/conformance-disallows-001.ttl b/shacl12-test-suite/tests/core/validation-reports/conformance-disallows-001.ttl new file mode 100644 index 00000000..4f1924d0 --- /dev/null +++ b/shacl12-test-suite/tests/core/validation-reports/conformance-disallows-001.ttl @@ -0,0 +1,56 @@ +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:PersonShape + rdf:type sh:NodeShape ; + sh:property ex:PersonShape-age ; + sh:targetNode ex:Person ; +. +ex:PersonShape-age + rdf:type sh:PropertyShape ; + sh:path ex:age ; + sh:severity sh:Warning ; + sh:datatype xsd:integer ; +. +ex:Bob + rdf:type ex:Person ; + ex:age "twenty two" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of path sh:conformanceDisallows 001" ; + rdfs:comment "conformanceDisallows presence lets sh:conforms be true despite presence of an sh:Warning-severity result. Test contents and behavior otherwise match conformance-disallows-002."@en ; + rdfs:seeAlso ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "true"^^xsd:boolean ; + sh:conformanceDisallows sh:Violation ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Warning ; + sh:focusNode ex:Bob ; + sh:resultPath ex:age ; + sh:value "twenty two" ; + sh:resultMessage "ex:age expects a literal of datatype xsd:integer." ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:PersonShape-age ; + ] + ] ; + mf:status sht:approved ; +. diff --git a/shacl12-test-suite/tests/core/validation-reports/conformance-disallows-002.ttl b/shacl12-test-suite/tests/core/validation-reports/conformance-disallows-002.ttl new file mode 100644 index 00000000..2afb8a0f --- /dev/null +++ b/shacl12-test-suite/tests/core/validation-reports/conformance-disallows-002.ttl @@ -0,0 +1,55 @@ +@prefix ex: . +@prefix mf: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix sht: . +@prefix xsd: . + +ex:PersonShape + rdf:type sh:NodeShape ; + sh:property ex:PersonShape-age ; + sh:targetNode ex:Person ; +. +ex:PersonShape-age + rdf:type sh:PropertyShape ; + sh:path ex:age ; + sh:severity sh:Warning ; + sh:datatype xsd:integer ; +. +ex:Bob + rdf:type ex:Person ; + ex:age "twenty two" ; +. +<> + rdf:type mf:Manifest ; + mf:entries ( + + ) ; +. + + rdf:type sht:Validate ; + rdfs:label "Test of path sh:conformanceDisallows 002" ; + rdfs:comment "conformanceDisallows absence causes sh:conforms be false due to presence of an sh:Warning-severity result. Test contents and behavior otherwise match conformance-disallows-001."@en ; + rdfs:seeAlso ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "false"^^xsd:boolean ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Warning ; + sh:focusNode ex:Bob ; + sh:resultPath ex:age ; + sh:value "twenty two" ; + sh:resultMessage "ex:age expects a literal of datatype xsd:integer." ; + sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; + sh:sourceShape ex:PersonShape-age ; + ] + ] ; + mf:status sht:approved ; +. diff --git a/shacl12-test-suite/tests/core/validation-reports/manifest.ttl b/shacl12-test-suite/tests/core/validation-reports/manifest.ttl index b200ca17..e1598875 100644 --- a/shacl12-test-suite/tests/core/validation-reports/manifest.ttl +++ b/shacl12-test-suite/tests/core/validation-reports/manifest.ttl @@ -5,5 +5,7 @@ <> a mf:Manifest ; rdfs:label "Tests for validation reports" ; + mf:include ; + mf:include ; mf:include ; . diff --git a/shacl12-vocabularies/shacl.ttl b/shacl12-vocabularies/shacl.ttl index 6e2a0734..b0c08331 100644 --- a/shacl12-vocabularies/shacl.ttl +++ b/shacl12-vocabularies/shacl.ttl @@ -204,6 +204,14 @@ sh:conforms rdfs:range xsd:boolean ; rdfs:isDefinedBy sh: . +sh:conformanceDisallows + a rdf:Property ; + rdfs:label "conformance disallows"@en ; + rdfs:comment "Severity levels that are evaluated in the conformance check."@en ; + rdfs:domain sh:ValidationReport ; + rdfs:range sh:Severity ; + rdfs:isDefinedBy sh: . + sh:result a rdf:Property ; rdfs:label "result"@en ;