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

Commit e111b17

Browse files
author
Matthias Böckmann
committed
Fixing some JavaDoc warnings
Reducing verbosity of test Repairing shapes.ttl, which had missing prefixes
1 parent dd86b70 commit e111b17

4 files changed

Lines changed: 48 additions & 28 deletions

File tree

dataformat-jsonld/src/main/java/io/adminshell/aas/v3/dataformat/jsonld/Serializer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public Serializer() {
8484
*
8585
* @param instance the instance to be serialized
8686
* @return RDF serialization of the provided object graph
87+
* @throws IOException if the serialization fails
8788
*/
8889
public String serialize(Object instance) throws IOException {
8990
return serialize(instance, RDFLanguages.JSONLD, new HashMap<>());
@@ -145,6 +146,7 @@ public String serializePlainJson(Object instance) throws JsonProcessingException
145146
* @param valueType class of top level type
146147
* @param <T> deserialized type
147148
* @return an object representing the provided JSON(-LD) structure
149+
* @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF
148150
*/
149151
public <T> T deserialize(String serialization, Class<T> valueType) throws DeserializationException {
150152
try {
@@ -164,6 +166,7 @@ public <T> T deserialize(String serialization, Class<T> valueType) throws Deseri
164166
* @param serializationFormat RDF input format
165167
* @param <T> deserialized type
166168
* @return an object representing the provided JSON(-LD) structure
169+
* @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF
167170
*/
168171
public <T> T deserialize(String serialization, Class<T> valueType, Lang serializationFormat) throws DeserializationException {
169172
try {
@@ -182,6 +185,7 @@ public <T> T deserialize(String serialization, Class<T> valueType, Lang serializ
182185
* @param valueType class of top level type
183186
* @param <T> deserialized type
184187
* @return an object representing the provided JSON(-LD) structure
188+
* @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF
185189
*/
186190
public <T> T deserialize(Model rdfModel, Class<T> valueType) throws DeserializationException {
187191
try {

dataformat-jsonld/src/main/java/io/adminshell/aas/v3/dataformat/jsonld/preprocessing/JsonPreprocessor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public interface JsonPreprocessor {
2929
* preprocessing method
3030
* @param input of the transformation, the original JSON-LD
3131
* @return the transformation´s result
32+
* @throws IOException if preprocessing fails, e.g. because the input is not valid RDF
3233
*/
3334
public String preprocess(String input) throws IOException;
3435

dataformat-jsonld/src/test/java/io/adminshell/aas/v3/model/dataformat/jsonld/SerializerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void serializeEnvironment() throws IOException {
6666
.submodels(submodel)
6767
.build();
6868
String output = new Serializer().serialize(aasEnv);
69-
System.out.println(output);
69+
//System.out.println(output);
7070
Assert.assertTrue(output.contains("@context"));
7171
Assert.assertTrue(output.contains("rdf:"));
7272

validator/src/main/resources/shapes.ttl

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,14 @@ aas:AssetShape a sh:NodeShape ;
176176
sh:targetClass aas:Asset ;
177177
rdfs:subClassOf aas:HasDataSpecificationShape ;
178178
rdfs:subClassOf aas:IdentifiableShape ;
179-
179+
#sh:property [
180+
# a sh:PropertyShape ;
181+
# sh:path <https://admin-shell.io/aas/3/0/RC01/Asset/identification> ;
182+
# sh:class aas:Identifier ;
183+
# sh:maxCount 1 ;
184+
# sh:minCount 1 ;
185+
# sh:message "(Asset.identification): The <i>identification</i> attribute points to exactly one <i>Identifier</i> entity."^^xsd:string ;
186+
# ] ;
180187
.
181188

182189
aas:AssetInformationShape a sh:NodeShape ;
@@ -314,6 +321,14 @@ aas:AssetAdministrationShellEnvironmentShape a sh:NodeShape ;
314321
sh:message "(AssetAdministrationShellEnvironment.assetAdministrationShells): At least one <i>assetAdministrationShells</i> attribute having an <i>AssetAdministrationShell</i> entity is required."^^xsd:string ;
315322
sh:minCount 1 ;
316323
] ;
324+
sh:property [
325+
a sh:PropertyShape ;
326+
sh:path <https://admin-shell.io/aas/3/0/RC01/AssetAdministrationShellEnvironment/assets> ;
327+
sh:class aas:Asset;
328+
sh:message "(AssetAdministrationShellEnvironment.assets): The <i>assets</i> attribute points to an <i>Asset</i> entity."^^xsd:string ;
329+
# sh:minCount 1 ;
330+
# sh:maxCount 1 ;
331+
] ;
317332
sh:property [
318333
a sh:PropertyShape ;
319334
sh:path <https://admin-shell.io/aas/3/0/RC01/AssetAdministrationShellEnvironment/conceptDescriptions> ;
@@ -405,8 +420,8 @@ aas:CertificateShape a sh:NodeShape ;
405420
sh:select """
406421
SELECT ?this ?type
407422
WHERE {
408-
?this a ?type .
409-
FILTER (?type = aas:Certificate)
423+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
424+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/Certificate>)
410425
}
411426
""" ;
412427
] ;
@@ -445,8 +460,8 @@ aas:ConstraintShape a sh:NodeShape ;
445460
sh:select """
446461
SELECT ?this ?type
447462
WHERE {
448-
?this a ?type .
449-
FILTER (?type = aas:Constraint)
463+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
464+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/Constraint>)
450465
}
451466
""" ;
452467
] ;
@@ -463,8 +478,8 @@ aas:DataElementShape a sh:NodeShape ;
463478
sh:select """
464479
SELECT ?this ?type
465480
WHERE {
466-
?this a ?type .
467-
FILTER (?type = aas:DataElement)
481+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
482+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/DataElement>)
468483
}
469484
""" ;
470485
] ;
@@ -480,8 +495,8 @@ aas:DataSpecificationContentShape a sh:NodeShape ;
480495
sh:select """
481496
SELECT ?this ?type
482497
WHERE {
483-
?this a ?type .
484-
FILTER (?type = aas:DataSpecificationContent)
498+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
499+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/DataSpecificationContent>)
485500
}
486501
""" ;
487502
] ;
@@ -783,8 +798,8 @@ aas:EventShape a sh:NodeShape ;
783798
sh:select """
784799
SELECT ?this ?type
785800
WHERE {
786-
?this a ?type .
787-
FILTER (?type = aas:Event)
801+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
802+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/Event>)
788803
}
789804
""" ;
790805
] ;
@@ -846,8 +861,8 @@ aas:HasDataSpecificationShape a sh:NodeShape ;
846861
sh:select """
847862
SELECT ?this ?type
848863
WHERE {
849-
?this a ?type .
850-
FILTER (?type = aas:HasDataSpecification)
864+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
865+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/HasDataSpecification>)
851866
}
852867
""" ;
853868
] ;
@@ -871,8 +886,8 @@ aas:HasKindShape a sh:NodeShape ;
871886
sh:select """
872887
SELECT ?this ?type
873888
WHERE {
874-
?this a ?type .
875-
FILTER (?type = aas:HasKind)
889+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
890+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/HasKind>)
876891
}
877892
""" ;
878893
] ;
@@ -897,8 +912,8 @@ aas:HasSemanticsShape a sh:NodeShape ;
897912
sh:select """
898913
SELECT ?this ?type
899914
WHERE {
900-
?this a ?type .
901-
FILTER (?type = aas:HasSemantics)
915+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
916+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/HasSemantics>)
902917
}
903918
""" ;
904919
] ;
@@ -924,8 +939,8 @@ aas:IdentifiableShape a sh:NodeShape ;
924939
sh:select """
925940
SELECT ?this ?type
926941
WHERE {
927-
?this a ?type .
928-
FILTER (?type = aas:Identifiable)
942+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
943+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/Identifiable>)
929944
}
930945
""" ;
931946
] ;
@@ -1217,8 +1232,8 @@ aas:QualifiableShape a sh:NodeShape ;
12171232
sh:select """
12181233
SELECT ?this ?type
12191234
WHERE {
1220-
?this a ?type .
1221-
FILTER (?type = aas:Qualifiable)
1235+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
1236+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/Qualifiable>)
12221237
}
12231238
""" ;
12241239
] ;
@@ -1308,8 +1323,8 @@ aas:HasExtensionsShape a sh:NodeShape ;
13081323
sh:select """
13091324
SELECT ?this ?type
13101325
WHERE {
1311-
?this a ?type .
1312-
FILTER (?type = aas:HasExtensions)
1326+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
1327+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/HasExtensions>)
13131328
}
13141329
""" ;
13151330
] ;
@@ -1372,8 +1387,8 @@ aas:ReferableShape a sh:NodeShape ;
13721387
sh:select """
13731388
SELECT ?this ?type
13741389
WHERE {
1375-
?this a ?type .
1376-
FILTER (?type = aas:Referable)
1390+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
1391+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/Referable>)
13771392
}
13781393
""" ;
13791394
] ;
@@ -1526,8 +1541,8 @@ aas:SubmodelElementShape a sh:NodeShape ;
15261541
sh:select """
15271542
SELECT ?this ?type
15281543
WHERE {
1529-
?this a ?type .
1530-
FILTER (?type = aas:SubmodelElement)
1544+
?this <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ?type .
1545+
FILTER (?type = <https://admin-shell.io/aas/3/0/RC01/SubmodelElement>)
15311546
}
15321547
""" ;
15331548
] ;

0 commit comments

Comments
 (0)