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

Commit 7587eda

Browse files
Merge pull request #37 from changqin26/feature/example-validation
Feature/example validation
2 parents e429625 + d0828fb commit 7587eda

2 files changed

Lines changed: 77 additions & 29 deletions

File tree

dataformat-core/src/test/java/io/adminshell/aas/v3/dataformat/core/AASFull.java

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
import io.adminshell.aas.v3.model.impl.DefaultView;
6464

6565
public class AASFull {
66-
66+
6767
public static final AssetAdministrationShell AAS_1 = new DefaultAssetAdministrationShell.Builder()
6868
.idShort("TestAssetAdministrationShell")
6969
.description(new LangString("An Example Asset Administration Shell for the test application", "en-us"))
@@ -254,7 +254,7 @@ public class AASFull {
254254
.key(new DefaultKey.Builder()
255255
.type(KeyElements.GLOBAL_REFERENCE)
256256
.idType(KeyType.IRI)
257-
.value("http://acplt.org/ValueId/ExampleValueId")
257+
.value("100")
258258
.build())
259259
.build())
260260
.valueType("int")
@@ -266,18 +266,18 @@ public class AASFull {
266266
.key(new DefaultKey.Builder()
267267
.type(KeyElements.GLOBAL_REFERENCE)
268268
.idType(KeyType.IRI)
269-
.value("http://acplt.org/ValueId/ExampleValueId")
269+
.value("50")
270270
.build())
271271
.build())
272272
.valueType("int")
273273
.type("http://acplt.org/Qualifier/ExampleQualifier2")
274274
.build())
275-
.value("ACPLT")
275+
.value("http://acplt.org/ValueId/ACPLT")
276276
.valueId(new DefaultReference.Builder()
277277
.key(new DefaultKey.Builder()
278278
.type(KeyElements.GLOBAL_REFERENCE)
279279
.idType(KeyType.IRI)
280-
.value("http://acplt.org/ValueId/ExampleValueId")
280+
.value("http://acplt.org/ValueId/ACPLT")
281281
.build())
282282
.build())
283283
.valueType("string")
@@ -298,7 +298,7 @@ public class AASFull {
298298
.key(new DefaultKey.Builder()
299299
.type(KeyElements.GLOBAL_REFERENCE)
300300
.idType(KeyType.IRI)
301-
.value("http://acplt.org/ValueId/ExampleValueId")
301+
.value("978-8234-234-342")
302302
.build())
303303
.build())
304304
.valueType("string")
@@ -347,12 +347,12 @@ public class AASFull {
347347
.idType(KeyType.IRI)
348348
.build())
349349
.build())
350-
.value("exampleValue2")
350+
.value("http://acplt.org/ValueId/ExampleValue2")
351351
.valueId(new DefaultReference.Builder()
352352
.key(new DefaultKey.Builder()
353353
.type(KeyElements.GLOBAL_REFERENCE)
354354
.idType(KeyType.IRI)
355-
.value("http://acplt.org/ValueId/ExampleValueId")
355+
.value("http://acplt.org/ValueId/ExampleValue2")
356356
.build())
357357
.build())
358358
.valueType("string")
@@ -369,7 +369,7 @@ public class AASFull {
369369
.idType(KeyType.IRI)
370370
.build())
371371
.build())
372-
.value("exampleValue")
372+
.value("http://acplt.org/ValueId/ExampleValueId")
373373
.valueId(new DefaultReference.Builder()
374374
.key(new DefaultKey.Builder()
375375
.type(KeyElements.GLOBAL_REFERENCE)
@@ -526,6 +526,7 @@ public class AASFull {
526526
.build())
527527
.submodelElement(new DefaultOperation.Builder()
528528
.idShort("ExampleOperation")
529+
.kind(ModelingKind.TEMPLATE)
529530
.category("Parameter")
530531
.description(new LangString("Example Operation object", "en-us"))
531532
.description(new LangString("Beispiel Operation Element", "de"))
@@ -549,7 +550,7 @@ public class AASFull {
549550
.idType(KeyType.IRI)
550551
.build())
551552
.build())
552-
.value("exampleValue")
553+
.value("http://acplt.org/ValueId/ExampleValueId")
553554
.valueId(new DefaultReference.Builder()
554555
.key(new DefaultKey.Builder()
555556
.type(KeyElements.GLOBAL_REFERENCE)
@@ -573,7 +574,7 @@ public class AASFull {
573574
.idType(KeyType.IRI)
574575
.build())
575576
.build())
576-
.value("exampleValue")
577+
.value("http://acplt.org/ValueId/ExampleValueId")
577578
.valueId(new DefaultReference.Builder()
578579
.key(new DefaultKey.Builder()
579580
.type(KeyElements.GLOBAL_REFERENCE)
@@ -597,7 +598,7 @@ public class AASFull {
597598
.idType(KeyType.IRI)
598599
.build())
599600
.build())
600-
.value("exampleValue")
601+
.value("http://acplt.org/ValueId/ExampleValueId")
601602
.valueId(new DefaultReference.Builder()
602603
.key(new DefaultKey.Builder()
603604
.type(KeyElements.GLOBAL_REFERENCE)
@@ -676,7 +677,7 @@ public class AASFull {
676677
.idType(KeyType.IRI)
677678
.build())
678679
.build())
679-
.value("exampleValue")
680+
.value("http://acplt.org/ValueId/ExampleValueId")
680681
.valueId(new DefaultReference.Builder()
681682
.key(new DefaultKey.Builder()
682683
.type(KeyElements.GLOBAL_REFERENCE)
@@ -884,6 +885,7 @@ public class AASFull {
884885
.build())
885886
.submodelElement(new DefaultOperation.Builder()
886887
.idShort("ExampleOperation")
888+
.kind(ModelingKind.TEMPLATE)
887889
.build())
888890
.submodelElement(new DefaultCapability.Builder()
889891
.idShort("ExampleCapability")
@@ -1079,6 +1081,7 @@ public class AASFull {
10791081
.build())
10801082
.submodelElement(new DefaultOperation.Builder()
10811083
.idShort("ExampleOperation")
1084+
.kind(ModelingKind.TEMPLATE)
10821085
.category("Parameter")
10831086
.description(new LangString("Example Operation object", "en-us"))
10841087
.description(new LangString("Beispiel Operation Element", "de"))
@@ -1414,6 +1417,7 @@ public class AASFull {
14141417
.build())
14151418
.submodelElement(new DefaultOperation.Builder()
14161419
.idShort("ExampleOperation")
1420+
.kind(ModelingKind.TEMPLATE)
14171421
.category("Parameter")
14181422
.description(new LangString("Example Operation object", "en-us"))
14191423
.description(new LangString("Beispiel Operation Element", "de"))
@@ -1732,6 +1736,13 @@ public class AASFull {
17321736
.build())
17331737
.build())
17341738
.embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder()
1739+
.dataSpecification(new DefaultReference.Builder()
1740+
.key(new DefaultKey.Builder()
1741+
.type(KeyElements.GLOBAL_REFERENCE)
1742+
.idType(KeyType.IRI)
1743+
.value("DataSpecificationIEC61360")
1744+
.build())
1745+
.build())
17351746
.dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder()
17361747
.preferredName(new LangString("Test Specification", "de"))
17371748
.preferredName(new LangString("TestSpecification", "en-us"))
@@ -1756,7 +1767,7 @@ public class AASFull {
17561767
.levelType(LevelType.MAX)
17571768
.valueList(new DefaultValueList.Builder()
17581769
.valueReferencePairTypes(new DefaultValueReferencePair.Builder()
1759-
.value("exampleValue")
1770+
.value("http://acplt.org/ValueId/ExampleValueId")
17601771
.valueId(new DefaultReference.Builder()
17611772
.key(new DefaultKey.Builder()
17621773
.type(KeyElements.GLOBAL_REFERENCE)
@@ -1767,7 +1778,7 @@ public class AASFull {
17671778
// TODO valueType
17681779
.build())
17691780
.valueReferencePairTypes(new DefaultValueReferencePair.Builder()
1770-
.value("exampleValue2")
1781+
.value("http://acplt.org/ValueId/ExampleValueId2")
17711782
.valueId(new DefaultReference.Builder()
17721783
.key(new DefaultKey.Builder()
17731784
.type(KeyElements.GLOBAL_REFERENCE)

dataformat-core/src/test/java/io/adminshell/aas/v3/dataformat/core/AASSimple.java

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public class AASSimple {
121121
private static final String SUBMODEL_OPERATIONAL_DATA_ID = "http://i40.customer.com/instance/1/1/AC69B1CB44F07935";
122122
private static final String SUBMODEL_OPERATIONAL_DATA_SEMANTIC_ID_PROPERTY = HTTP_CUSTOMER_COM_CD_1_1_18EBD56F6B43D895;
123123
private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT = ROTATION_SPEED;
124-
private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY = "VARIABLE";
124+
private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY = "Variable";
125125
private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE = "4370";
126126
private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUETYPE = "integer";
127127

@@ -235,11 +235,18 @@ public AASSimple() {
235235
.identifier(WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DESCRIPTION_TITLE).idType(IdentifierType.IRI)
236236
.build())
237237
.embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder()
238+
.dataSpecification(new DefaultReference.Builder()
239+
.key(new DefaultKey.Builder()
240+
.type(KeyElements.GLOBAL_REFERENCE)
241+
.idType(KeyType.IRI)
242+
.value("DataSpecificationIEC61360")
243+
.build())
244+
.build())
238245
.dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder()
239246
.preferredName(new LangString(TITLE, "EN")).preferredName(new LangString(TITEL, "DE"))
240-
.shortName(new LangString(TITLE, "EN")).shortName(new LangString(TITEL, "DE")).unit("")
241-
.sourceOfDefinition("").dataType(DataTypeIEC61360.STRING_TRANSLATABLE)
242-
.definition(new LangString(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS, "DE")).build())
247+
.shortName(new LangString(TITLE, "EN")).shortName(new LangString(TITEL, "DE")).unit("ExampleString")
248+
.sourceOfDefinition("ExampleString").dataType(DataTypeIEC61360.STRING_TRANSLATABLE)
249+
.definition(new LangString(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS, "EN")).build())
243250
.build())
244251
.build();
245252

@@ -248,34 +255,49 @@ public AASSimple() {
248255
.identification(new DefaultIdentifier.Builder()
249256
.identifier(WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_STORED_DOCUMENT_REPRESENTATION_DIGITAL_FILE)
250257
.idType(IdentifierType.IRI).build())
251-
.embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder().dataSpecificationContent(
258+
.embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder()
259+
.dataSpecification(new DefaultReference.Builder()
260+
.key(new DefaultKey.Builder()
261+
.type(KeyElements.GLOBAL_REFERENCE)
262+
.idType(KeyType.IRI)
263+
.value("DataSpecificationIEC61360")
264+
.build())
265+
.build())
266+
.dataSpecificationContent(
252267
new DefaultDataSpecificationIEC61360.Builder().preferredName(new LangString(DIGITAL_FILE, "EN"))
253-
.preferredName(new LangString(DIGITALE_DATEI, "DE"))
268+
.preferredName(new LangString(DIGITAL_FILE, "EN"))
254269
.shortName(new LangString(DIGITAL_FILE, "EN"))
255-
.shortName(new LangString(DIGITALE_DATEI, "DE")).unit("").sourceOfDefinition("")
256-
.dataType(DataTypeIEC61360.STRING).definition(new LangString(DIGITAL_FILE_DEFINITION, "DE"))
270+
.shortName(new LangString(DIGITALE_DATEI, "DE")).unit("ExampleString").sourceOfDefinition("ExampleString")
271+
.dataType(DataTypeIEC61360.STRING).definition(new LangString(DIGITAL_FILE_DEFINITION, "EN"))
257272
.build())
258273
.build())
259274
.build();
260275

261276
public static final ConceptDescription CONCEPT_DESCRIPTION_MAXROTATIONSPEED = new DefaultConceptDescription.Builder()
262277
.idShort(MAX_ROTATION_SPEED).category(PROPERTY)
263-
.administration(new DefaultAdministrativeInformation.Builder().version("").revision("2").build())
278+
.administration(new DefaultAdministrativeInformation.Builder().version("2").revision("2.1").build())
264279
.identification(new DefaultIdentifier.Builder().identifier(_0173_1_02_BAA120_008)
265280
.idType(IdentifierType.IRDI).build())
266281
.embeddedDataSpecifications(
267282
Arrays.asList(
268283
new DefaultEmbeddedDataSpecification.Builder()
284+
.dataSpecification(new DefaultReference.Builder()
285+
.key(new DefaultKey.Builder()
286+
.type(KeyElements.GLOBAL_REFERENCE)
287+
.idType(KeyType.IRI)
288+
.value("DataSpecificationIEC61360")
289+
.build())
290+
.build())
269291
.dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder()
270292
.preferredName(new LangString(MAX_DREHZAHL, "de"))
271293
.preferredName(new LangString(MAX_ROTATIONSPEED, "en")).unit(_1_MIN)
272294
.unitId(new DefaultReference.Builder()
273295
.key(new DefaultKey.Builder().type(KeyElements.GLOBAL_REFERENCE)
274296
.value(_0173_1_05_AAA650_002).idType(KeyType.IRDI).build())
275297
.build())
276-
.sourceOfDefinition("").dataType(DataTypeIEC61360.REAL_MEASURE)
298+
.sourceOfDefinition("ExampleString").dataType(DataTypeIEC61360.REAL_MEASURE)
277299
.definition(new LangString(MAX_ROTATE_DEF_DE, "de"))
278-
.definition(new LangString(MAX_ROTATE_DEF_EN, "en")).build())
300+
.definition(new LangString(MAX_ROTATE_DEF_EN, "EN")).build())
279301
.build()))
280302
.build();
281303

@@ -285,6 +307,13 @@ public AASSimple() {
285307
.idType(IdentifierType.IRI).build())
286308
.embeddedDataSpecification(
287309
new DefaultEmbeddedDataSpecification.Builder()
310+
.dataSpecification(new DefaultReference.Builder()
311+
.key(new DefaultKey.Builder()
312+
.type(KeyElements.GLOBAL_REFERENCE)
313+
.idType(KeyType.IRI)
314+
.value("DataSpecificationIEC61360")
315+
.build())
316+
.build())
288317
.dataSpecificationContent(
289318
new DefaultDataSpecificationIEC61360.Builder()
290319
.preferredName(new LangString(AKTUELLE_DREHZAHL, "DE"))
@@ -295,7 +324,7 @@ public AASSimple() {
295324
.key(new DefaultKey.Builder().type(KeyElements.GLOBAL_REFERENCE)
296325
.value(_0173_1_05_AAA650_002).idType(KeyType.IRDI).build())
297326
.build())
298-
.sourceOfDefinition("").dataType(DataTypeIEC61360.REAL_MEASURE)
327+
.sourceOfDefinition("ExampleString").dataType(DataTypeIEC61360.REAL_MEASURE)
299328
.definition(new LangString(
300329
AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD,
301330
"DE"))
@@ -311,12 +340,20 @@ public AASSimple() {
311340
.identification(new DefaultIdentifier.Builder().identifier(WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DOCUMENT)
312341
.idType(IdentifierType.IRI).build())
313342
.embeddedDataSpecification(new DefaultEmbeddedDataSpecification.Builder()
343+
.dataSpecification(new DefaultReference.Builder()
344+
.key(new DefaultKey.Builder()
345+
.type(KeyElements.GLOBAL_REFERENCE)
346+
.idType(KeyType.IRI)
347+
.value("DataSpecificationIEC61360")
348+
.build())
349+
.build())
314350
.dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder()
351+
.preferredName(new LangString(DOCUMENT, "EN"))
315352
.shortName(new LangString(DOCUMENT, "EN")).shortName(new LangString(DOKUMENT, "DE"))
316-
.unit("").sourceOfDefinition(ISO15519_1_2010).dataType(DataTypeIEC61360.STRING)
353+
.unit("ExampleString").sourceOfDefinition(ISO15519_1_2010).dataType(DataTypeIEC61360.STRING)
317354
.definition(new LangString(
318355
DOCUMENT_DEF,
319-
"DE"))
356+
"EN"))
320357
.build())
321358
.build())
322359
.build();

0 commit comments

Comments
 (0)