Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Commit 3badc97

Browse files
committed
fixed constraint AASd-090 to use enum names in CamelCase vs SCREAMING_SNAKE_CASE
1 parent 801e300 commit 3badc97

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

validator/src/main/resources/constraint_shapes.ttl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ aas:DataElementExcludingFileAndBlobCorrectCategory a sh:NodeShape ;
10481048
sh:targetClass aas:DataElement;
10491049
sh:sparql [
10501050
a sh:SPARQLConstraint ;
1051-
sh:message "For data elements DataElement/category shall be one of the following values: CONSTANT, PARAMETER or VARIABLE. Exception: File and Blob data elements." ;
1051+
sh:message "For data elements DataElement/category shall be one of the following values: Constant, Parameter or Variable. Exception: File and Blob data elements." ;
10521052
sh:prefixes rdf: ;
10531053
sh:select """
10541054
SELECT ?element
@@ -1057,7 +1057,7 @@ aas:DataElementExcludingFileAndBlobCorrectCategory a sh:NodeShape ;
10571057
FILTER(?subclass != <https://admin-shell.io/aas/3/0/RC01/File> && ?subclass != <https://admin-shell.io/aas/3/0/RC01/Blob>)
10581058
?element a ?subclass .
10591059
?element <https://admin-shell.io/aas/3/0/RC01/Referable/category> ?category .
1060-
FILTER(?category != "CONSTANT" && ?category != "PARAMETER" && ?category != "VARIABLE")
1060+
FILTER(?category != "Constant" && ?category != "Parameter" && ?category != "Variable")
10611061
}
10621062
""" ;
10631063
] .

validator/src/test/java/io/adminshell/aas/v3/model/validator/TestAASd_090.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@
4242
public class TestAASd_090 {
4343
@Test
4444
public void correctCategoryConstant() throws ValidationException {
45-
ShaclValidator.getInstance().validate(createProperty("idShort1", "CONSTANT"));
45+
ShaclValidator.getInstance().validate(createProperty("idShort1", "Constant"));
4646
}
4747

4848
@Test
4949
public void correctCategoryParameter() throws ValidationException {
50-
ShaclValidator.getInstance().validate(createProperty("idShort1", "PARAMETER"));
50+
ShaclValidator.getInstance().validate(createProperty("idShort1", "Parameter"));
5151
}
5252

5353
@Test
5454
public void correctCategoryVariable() throws ValidationException {
55-
ShaclValidator.getInstance().validate(createProperty("idShort1", "VARIABLE"));
55+
ShaclValidator.getInstance().validate(createProperty("idShort1", "Variable"));
5656
}
5757

5858
@Test
@@ -72,7 +72,7 @@ public void wrongCategory() {
7272
fail();
7373
} catch (ValidationException e) {
7474
assertTrue(e.getMessage().endsWith(
75-
"For data elements DataElement/category shall be one of the following values: CONSTANT, PARAMETER or VARIABLE. Exception: File and Blob data elements."));
75+
"For data elements DataElement/category shall be one of the following values: Constant, Parameter or Variable. Exception: File and Blob data elements."));
7676
}
7777
}
7878

0 commit comments

Comments
 (0)