1616import org .eclipse .rdf4j .model .vocabulary .SHACL ;
1717
1818public enum SourceConstraintComponent {
19- MaxCountConstraintComponent (SHACL .MAX_COUNT_CONSTRAINT_COMPONENT , false ),
20- MinCountConstraintComponent (SHACL .MIN_COUNT_CONSTRAINT_COMPONENT , false ),
21-
22- DatatypeConstraintComponent (SHACL .DATATYPE_CONSTRAINT_COMPONENT , true ),
23- NodeKindConstraintComponent (SHACL .NODE_KIND_CONSTRAINT_COMPONENT , true ),
24- ClassConstraintComponent (SHACL .CLASS_CONSTRAINT_COMPONENT , true ),
25-
26- PatternConstraintComponent (SHACL .PATTERN_CONSTRAINT_COMPONENT , true ),
27- UniqueLangConstraintComponent (SHACL .UNIQUE_LANG_CONSTRAINT_COMPONENT , false ),
28- LanguageInConstraintComponent (SHACL .LANGUAGE_IN_CONSTRAINT_COMPONENT , true ),
29- MaxLengthConstraintComponent (SHACL .MAX_LENGTH_CONSTRAINT_COMPONENT , true ),
30- MinLengthConstraintComponent (SHACL .MIN_LENGTH_CONSTRAINT_COMPONENT , true ),
31-
32- InConstraintComponent (SHACL .IN_CONSTRAINT_COMPONENT , true ),
33- HasValueConstraintComponent (SHACL .HAS_VALUE_CONSTRAINT_COMPONENT , false ),
34- HasValueInConstraintComponent (DASH .HasValueInConstraintComponent , false ),
35- ClosedConstraintComponent (SHACL .CLOSED_CONSTRAINT_COMPONENT , true ),
36-
37- MinExclusiveConstraintComponent (SHACL .MIN_EXCLUSIVE_CONSTRAINT_COMPONENT , true ),
38- MaxExclusiveConstraintComponent (SHACL .MAX_EXCLUSIVE_CONSTRAINT_COMPONENT , true ),
39- MaxInclusiveConstraintComponent (SHACL .MAX_INCLUSIVE_CONSTRAINT_COMPONENT , true ),
40- MinInclusiveConstraintComponent (SHACL .MIN_INCLUSIVE_CONSTRAINT_COMPONENT , true ),
41-
42- AndConstraintComponent (SHACL .AND_CONSTRAINT_COMPONENT , true ),
43- OrConstraintComponent (SHACL .OR_CONSTRAINT_COMPONENT , true ),
44- NotConstraintComponent (SHACL .NOT_CONSTRAINT_COMPONENT , true ),
45- XoneConstraintComponent (SHACL .XONE_CONSTRAINT_COMPONENT , true ),
46-
47- DisjointConstraintComponent (SHACL .DISJOINT_CONSTRAINT_COMPONENT , true ),
48- EqualsConstraintComponent (SHACL .EQUALS_CONSTRAINT_COMPONENT , true ),
49- LessThanConstraintComponent (SHACL .LESS_THAN_CONSTRAINT_COMPONENT , true ),
19+ MaxCountConstraintComponent (SHACL .MAX_COUNT_CONSTRAINT_COMPONENT , ProducesValidationResultValue . NEVER ),
20+ MinCountConstraintComponent (SHACL .MIN_COUNT_CONSTRAINT_COMPONENT , ProducesValidationResultValue . NEVER ),
21+
22+ DatatypeConstraintComponent (SHACL .DATATYPE_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
23+ NodeKindConstraintComponent (SHACL .NODE_KIND_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
24+ ClassConstraintComponent (SHACL .CLASS_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
25+
26+ PatternConstraintComponent (SHACL .PATTERN_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
27+ UniqueLangConstraintComponent (SHACL .UNIQUE_LANG_CONSTRAINT_COMPONENT , ProducesValidationResultValue . NEVER ),
28+ LanguageInConstraintComponent (SHACL .LANGUAGE_IN_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
29+ MaxLengthConstraintComponent (SHACL .MAX_LENGTH_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
30+ MinLengthConstraintComponent (SHACL .MIN_LENGTH_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
31+
32+ InConstraintComponent (SHACL .IN_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
33+ HasValueConstraintComponent (SHACL .HAS_VALUE_CONSTRAINT_COMPONENT , ProducesValidationResultValue . NEVER ),
34+ HasValueInConstraintComponent (DASH .HasValueInConstraintComponent , ProducesValidationResultValue . NEVER ),
35+ ClosedConstraintComponent (SHACL .CLOSED_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
36+
37+ MinExclusiveConstraintComponent (SHACL .MIN_EXCLUSIVE_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
38+ MaxExclusiveConstraintComponent (SHACL .MAX_EXCLUSIVE_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
39+ MaxInclusiveConstraintComponent (SHACL .MAX_INCLUSIVE_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
40+ MinInclusiveConstraintComponent (SHACL .MIN_INCLUSIVE_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
41+
42+ AndConstraintComponent (SHACL .AND_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
43+ OrConstraintComponent (SHACL .OR_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
44+ NotConstraintComponent (SHACL .NOT_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
45+ XoneConstraintComponent (SHACL .XONE_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
46+
47+ DisjointConstraintComponent (SHACL .DISJOINT_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
48+ EqualsConstraintComponent (SHACL .EQUALS_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
49+ LessThanConstraintComponent (SHACL .LESS_THAN_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
5050 LessThanOrEqualsConstraintComponent (SHACL .LESS_THAN_OR_EQUALS_CONSTRAINT_COMPONENT ,
51- true ),
51+ ProducesValidationResultValue . ALWAYS ),
5252
5353 QualifiedMaxCountConstraintComponent (SHACL .QUALIFIED_MAX_COUNT_CONSTRAINT_COMPONENT ,
54- false ),
54+ ProducesValidationResultValue . NEVER ),
5555 QualifiedMinCountConstraintComponent (SHACL .QUALIFIED_MIN_COUNT_CONSTRAINT_COMPONENT ,
56- false ),
57- NodeConstraintComponent (SHACL .NODE_CONSTRAINT_COMPONENT , true ),
58- PropertyConstraintComponent (SHACL .PROPERTY_CONSTRAINT_COMPONENT , false ),
56+ ProducesValidationResultValue . NEVER ),
57+ NodeConstraintComponent (SHACL .NODE_CONSTRAINT_COMPONENT , ProducesValidationResultValue . ALWAYS ),
58+ PropertyConstraintComponent (SHACL .PROPERTY_CONSTRAINT_COMPONENT , ProducesValidationResultValue . NEVER ),
5959
60- SPARQLConstraintComponent (SHACL .SPARQL_CONSTRAINT_COMPONENT , true );
60+ SPARQLConstraintComponent (SHACL .SPARQL_CONSTRAINT_COMPONENT , ProducesValidationResultValue . SOMETIMES );
6161
6262 private final IRI iri ;
63- private final boolean producesValidationResultValue ;
63+ private final ProducesValidationResultValue producesValidationResultValue ;
6464
65- SourceConstraintComponent (IRI iri , boolean producesValidationResultValue ) {
65+ SourceConstraintComponent (IRI iri , ProducesValidationResultValue producesValidationResultValue ) {
6666 this .iri = iri ;
6767 this .producesValidationResultValue = producesValidationResultValue ;
6868 }
@@ -72,6 +72,16 @@ public IRI getIri() {
7272 }
7373
7474 public boolean producesValidationResultValue () {
75- return producesValidationResultValue ;
75+ return producesValidationResultValue != ProducesValidationResultValue .NEVER ;
76+ }
77+
78+ public boolean alwaysProducesValidationResultValue () {
79+ return producesValidationResultValue == ProducesValidationResultValue .ALWAYS ;
80+ }
81+
82+ private enum ProducesValidationResultValue {
83+ ALWAYS ,
84+ NEVER ,
85+ SOMETIMES
7686 }
7787}
0 commit comments