From 13ee1845bacc5e059d9dc58c2deba8d22dc35b06 Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Fri, 16 Jun 2023 18:52:05 +0200 Subject: [PATCH 01/59] upgrade to latest generated java model and adding toString method --- .../v3/dataformat/aasx/AASXDeserializer.java | 3 +- .../v3/dataformat/aasx/AASXSerializer.java | 3 +- ...ssetAdministrationShellElementVisitor.java | 9 +- ...ministrationShellElementWalkerVisitor.java | 25 +- .../core/serialization/EnumSerializer.java | 9 +- .../v3/dataformat/core/util/AasUtils.java | 5 +- .../aas4j/v3/dataformat/core/AASFull.java | 416 +++++++++--------- .../aas4j/v3/dataformat/core/AASSimple.java | 37 +- .../v3/dataformat/core/CustomProperty.java | 23 +- .../json/mixins/SubmodelElementListMixin.java | 13 +- .../v3/dataformat/json/util/Examples.java | 9 +- .../ValueReferencePairNodeDeserializer.java | 19 +- .../xml/mixins/AssetInformationMixin.java | 7 +- .../dataformat/xml/mixins/QualifierMixin.java | 5 +- .../dataformat/xml/mixins/ResourceMixin.java | 5 +- .../xml/mixins/SubmodelElementListMixin.java | 13 +- .../v3/dataformat/xml/XmlSerializerTest.java | 7 +- ...Elements.java => AasSubmodelElements.java} | 39 +- .../aas4j/v3/model/AbstractLangString.java | 3 +- .../v3/model/AdministrativeInformation.java | 55 +-- .../model/AnnotatedRelationshipElement.java | 1 + .../v3/model/AssetAdministrationShell.java | 37 +- .../aas4j/v3/model/AssetInformation.java | 81 ++-- .../digitaltwin/aas4j/v3/model/AssetKind.java | 1 + .../aas4j/v3/model/BasicEventElement.java | 119 ++--- .../digitaltwin/aas4j/v3/model/Blob.java | 37 +- .../aas4j/v3/model/Capability.java | 1 + .../aas4j/v3/model/ConceptDescription.java | 9 +- .../aas4j/v3/model/DataElement.java | 1 + .../v3/model/DataSpecificationContent.java | 1 + .../v3/model/DataSpecificationIec61360.java | 193 ++++---- .../aas4j/v3/model/DataTypeDefXSD.java | 178 -------- .../aas4j/v3/model/DataTypeIec61360.java | 41 +- .../digitaltwin/aas4j/v3/model/Direction.java | 1 + .../v3/model/EmbeddedDataSpecification.java | 1 + .../digitaltwin/aas4j/v3/model/Entity.java | 63 +-- .../aas4j/v3/model/EntityType.java | 1 + .../aas4j/v3/model/Environment.java | 37 +- .../aas4j/v3/model/EventElement.java | 1 + .../aas4j/v3/model/EventPayload.java | 131 +++--- .../digitaltwin/aas4j/v3/model/Extension.java | 37 +- .../digitaltwin/aas4j/v3/model/File.java | 37 +- .../aas4j/v3/model/HasDataSpecification.java | 3 +- .../aas4j/v3/model/HasExtensions.java | 1 + .../digitaltwin/aas4j/v3/model/HasKind.java | 1 + .../aas4j/v3/model/HasSemantics.java | 17 +- .../aas4j/v3/model/Identifiable.java | 1 + .../digitaltwin/aas4j/v3/model/Key.java | 1 + .../digitaltwin/aas4j/v3/model/KeyTypes.java | 1 + .../LangStringDefinitionTypeIec61360.java | 1 + .../aas4j/v3/model/LangStringNameType.java | 1 + .../LangStringPreferredNameTypeIec61360.java | 1 + .../LangStringShortNameTypeIec61360.java | 1 + .../aas4j/v3/model/LangStringTextType.java | 1 + .../digitaltwin/aas4j/v3/model/LevelType.java | 39 +- .../aas4j/v3/model/ModellingKind.java | 1 + .../aas4j/v3/model/MultiLanguageProperty.java | 23 +- .../digitaltwin/aas4j/v3/model/Operation.java | 39 +- .../aas4j/v3/model/OperationVariable.java | 1 + .../digitaltwin/aas4j/v3/model/Property.java | 53 +-- .../aas4j/v3/model/Qualifiable.java | 1 + .../digitaltwin/aas4j/v3/model/Qualifier.java | 53 +-- .../aas4j/v3/model/QualifierKind.java | 3 +- .../digitaltwin/aas4j/v3/model/Range.java | 37 +- .../digitaltwin/aas4j/v3/model/Referable.java | 53 +-- .../digitaltwin/aas4j/v3/model/Reference.java | 55 +-- .../aas4j/v3/model/ReferenceElement.java | 1 + .../aas4j/v3/model/ReferenceTypes.java | 1 + .../aas4j/v3/model/RelationshipElement.java | 1 + .../digitaltwin/aas4j/v3/model/Resource.java | 37 +- .../aas4j/v3/model/SpecificAssetID.java | 88 ---- .../aas4j/v3/model/StateOfEvent.java | 1 + .../digitaltwin/aas4j/v3/model/Submodel.java | 3 +- .../aas4j/v3/model/SubmodelElement.java | 7 +- .../v3/model/SubmodelElementCollection.java | 11 +- .../aas4j/v3/model/SubmodelElementList.java | 57 +-- .../digitaltwin/aas4j/v3/model/ValueList.java | 1 + .../aas4j/v3/model/ValueReferencePair.java | 19 +- .../aas4j/v3/model/annotations/IRI.java | 1 + .../v3/model/annotations/KnownSubtypes.java | 1 + .../v3/model/builder/AbstractBuilder.java | 1 + .../AdministrativeInformationBuilder.java | 31 +- .../AnnotatedRelationshipElementBuilder.java | 105 ++--- .../AssetAdministrationShellBuilder.java | 71 +-- .../builder/AssetInformationBuilder.java | 53 +-- .../builder/BasicEventElementBuilder.java | 167 +++---- .../aas4j/v3/model/builder/BlobBuilder.java | 125 +++--- .../aas4j/v3/model/builder/Builder.java | 1 + .../v3/model/builder/CapabilityBuilder.java | 105 ++--- .../builder/ConceptDescriptionBuilder.java | 67 +-- .../DataSpecificationIec61360Builder.java | 135 +++--- .../EmbeddedDataSpecificationBuilder.java | 1 + .../aas4j/v3/model/builder/EntityBuilder.java | 163 +++---- .../v3/model/builder/EnvironmentBuilder.java | 41 +- .../v3/model/builder/EventPayloadBuilder.java | 71 +-- .../v3/model/builder/ExtendableBuilder.java | 1 + .../v3/model/builder/ExtensionBuilder.java | 53 +-- .../aas4j/v3/model/builder/FileBuilder.java | 125 +++--- .../aas4j/v3/model/builder/KeyBuilder.java | 1 + ...ngStringDefinitionTypeIec61360Builder.java | 1 + .../builder/LangStringNameTypeBuilder.java | 1 + ...tringPreferredNameTypeIec61360Builder.java | 1 + ...angStringShortNameTypeIec61360Builder.java | 1 + .../builder/LangStringTextTypeBuilder.java | 1 + .../v3/model/builder/LevelTypeBuilder.java | 23 +- .../builder/MultiLanguagePropertyBuilder.java | 131 +++--- .../v3/model/builder/OperationBuilder.java | 149 +++---- .../builder/OperationVariableBuilder.java | 1 + .../v3/model/builder/PropertyBuilder.java | 135 +++--- .../v3/model/builder/QualifierBuilder.java | 43 +- .../aas4j/v3/model/builder/RangeBuilder.java | 125 +++--- .../v3/model/builder/ReferenceBuilder.java | 41 +- .../builder/ReferenceElementBuilder.java | 105 ++--- .../builder/RelationshipElementBuilder.java | 105 ++--- .../v3/model/builder/ResourceBuilder.java | 21 +- .../model/builder/SpecificAssetIDBuilder.java | 91 ---- .../v3/model/builder/SubmodelBuilder.java | 131 +++--- .../SubmodelElementCollectionBuilder.java | 122 ++--- .../builder/SubmodelElementListBuilder.java | 147 ++++--- .../v3/model/builder/ValueListBuilder.java | 1 + .../builder/ValueReferencePairBuilder.java | 11 +- .../DefaultAdministrativeInformation.java | 55 ++- .../DefaultAnnotatedRelationshipElement.java | 88 ++-- .../impl/DefaultAssetAdministrationShell.java | 88 ++-- .../model/impl/DefaultAssetInformation.java | 68 +-- .../model/impl/DefaultBasicEventElement.java | 172 ++++---- .../aas4j/v3/model/impl/DefaultBlob.java | 113 ++--- .../v3/model/impl/DefaultCapability.java | 87 ++-- .../model/impl/DefaultConceptDescription.java | 62 +-- .../DefaultDataSpecificationIec61360.java | 182 ++++---- .../DefaultEmbeddedDataSpecification.java | 13 +- .../aas4j/v3/model/impl/DefaultEntity.java | 141 +++--- .../v3/model/impl/DefaultEnvironment.java | 38 +- .../v3/model/impl/DefaultEventPayload.java | 116 ++--- .../aas4j/v3/model/impl/DefaultExtension.java | 61 +-- .../aas4j/v3/model/impl/DefaultFile.java | 113 ++--- .../aas4j/v3/model/impl/DefaultKey.java | 13 +- ...faultLangStringDefinitionTypeIec61360.java | 17 +- .../model/impl/DefaultLangStringNameType.java | 13 +- ...ltLangStringPreferredNameTypeIec61360.java | 17 +- ...efaultLangStringShortNameTypeIec61360.java | 17 +- .../model/impl/DefaultLangStringTextType.java | 13 +- .../aas4j/v3/model/impl/DefaultLevelType.java | 47 +- .../impl/DefaultMultiLanguageProperty.java | 119 ++--- .../aas4j/v3/model/impl/DefaultOperation.java | 118 ++--- .../model/impl/DefaultOperationVariable.java | 8 + .../aas4j/v3/model/impl/DefaultProperty.java | 132 +++--- .../aas4j/v3/model/impl/DefaultQualifier.java | 72 +-- .../aas4j/v3/model/impl/DefaultRange.java | 116 ++--- .../aas4j/v3/model/impl/DefaultReference.java | 54 ++- .../model/impl/DefaultReferenceElement.java | 88 ++-- .../impl/DefaultRelationshipElement.java | 89 ++-- .../aas4j/v3/model/impl/DefaultResource.java | 37 +- .../v3/model/impl/DefaultSpecificAssetID.java | 147 ------- .../aas4j/v3/model/impl/DefaultSubmodel.java | 120 ++--- .../DefaultSubmodelElementCollection.java | 103 ++--- .../impl/DefaultSubmodelElementList.java | 138 +++--- .../aas4j/v3/model/impl/DefaultValueList.java | 8 + .../model/impl/DefaultValueReferencePair.java | 29 +- 159 files changed, 3936 insertions(+), 4011 deletions(-) rename model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/{AASSubmodelElements.java => AasSubmodelElements.java} (59%) delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXSD.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetID.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIDBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetID.java diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index d2ce12523..5108b7bf9 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -168,7 +169,7 @@ private List parseElements(Collection elements) { paths.add(file.getValue()); } else if (element instanceof SubmodelElementCollection) { SubmodelElementCollection collection = (SubmodelElementCollection) element; - paths.addAll(parseElements(collection.getValue())); + paths.addAll(parseElements(collection.getValues())); } } return paths; diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index 095c964e2..449be54c3 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -225,7 +226,7 @@ private Collection findFileElements(Collection elements) files.add((File) element); } else if (element instanceof SubmodelElementCollection) { // Recursive call to deal with SubmodelElementCollections - files.addAll(findFileElements(((SubmodelElementCollection) element).getValue())); + files.addAll(findFileElements(((SubmodelElementCollection) element).getValues())); } } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementVisitor.java index f9b13eceb..d0e27b8f7 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementVisitor.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +54,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; @@ -132,8 +133,8 @@ public default void visit(HasSemantics hasSemantics) { Class type = hasSemantics.getClass(); if (Extension.class.isAssignableFrom(type)) { visit((Extension) hasSemantics); - } else if (SpecificAssetID.class.isAssignableFrom(type)) { - visit((SpecificAssetID) hasSemantics); + } else if (SpecificAssetId.class.isAssignableFrom(type)) { + visit((SpecificAssetId) hasSemantics); } else if (Submodel.class.isAssignableFrom(type)) { visit((Submodel) hasSemantics); } else if (SubmodelElement.class.isAssignableFrom(type)) { @@ -245,7 +246,7 @@ public default void visit(Extension extension) { public default void visit(File file) { } - public default void visit(SpecificAssetID identifierKeyValuePair) { + public default void visit(SpecificAssetId identifierKeyValuePair) { } public default void visit(Key key) { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java index d16f45849..f8229333e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +72,7 @@ public default void visit(ConceptDescription conceptDescription) { if (conceptDescription == null) { return; } - conceptDescription.getIsCaseOf().forEach(x -> visit(x)); + conceptDescription.getIsCaseOfs().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(conceptDescription); } @@ -98,7 +99,7 @@ public default void visit(HasSemantics hasSemantics) { if (hasSemantics == null) { return; } - visit(hasSemantics.getSemanticID()); + visit(hasSemantics.getSemanticId()); hasSemantics.getSupplementalSemanticIds().forEach(x->visit(x)); AssetAdministrationShellElementVisitor.super.visit(hasSemantics); } @@ -113,11 +114,11 @@ public default void visit(Identifiable identifiable) { } @Override - public default void visit(SpecificAssetID specificAssetId) { + public default void visit(SpecificAssetId specificAssetId) { if (specificAssetId == null) { return; } - visit(specificAssetId.getExternalSubjectID()); + visit(specificAssetId.getExternalSubjectId()); AssetAdministrationShellElementVisitor.super.visit(specificAssetId); } @@ -126,8 +127,8 @@ public default void visit(MultiLanguageProperty multiLanguageProperty) { if (multiLanguageProperty == null) { return; } - multiLanguageProperty.getValue().forEach(x -> visit(x)); - visit(multiLanguageProperty.getValueID()); + multiLanguageProperty.getValues().forEach(x -> visit(x)); + visit(multiLanguageProperty.getValueId()); AssetAdministrationShellElementVisitor.super.visit(multiLanguageProperty); } @@ -145,7 +146,7 @@ public default void visit(Property property) { if (property == null) { return; } - visit(property.getValueID()); + visit(property.getValueId()); AssetAdministrationShellElementVisitor.super.visit(property); } @@ -163,7 +164,7 @@ public default void visit(Qualifier qualifier) { if (qualifier == null) { return; } - visit(qualifier.getValueID()); + visit(qualifier.getValueId()); AssetAdministrationShellElementVisitor.super.visit(qualifier); } @@ -172,8 +173,8 @@ public default void visit(Referable referable) { if (referable == null) { return; } - referable.getDescription().forEach(x -> visit(x)); - referable.getDisplayName().forEach(x -> visit(x)); + referable.getDescriptions().forEach(x -> visit(x)); + referable.getDisplayNames().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(referable); } @@ -252,7 +253,7 @@ public default void visit(Extension extension) { if (extension == null) { return; } - extension.getRefersTo().forEach(x -> visit(x)); + extension.getRefersTos().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(extension); } @@ -281,7 +282,7 @@ public default void visit(SubmodelElementCollection submodelElementCollection) { if (submodelElementCollection == null) { return; } - submodelElementCollection.getValue().forEach(x -> visit(x)); + submodelElementCollection.getValues().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(submodelElementCollection); } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index dadf9bc6c..bc015d93e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +19,7 @@ import java.io.IOException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; @@ -37,11 +38,11 @@ public class EnumSerializer extends JsonSerializer { @Override public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { - if (value instanceof DataTypeDefXSD) { + if (value instanceof DataTypeDefXsd) { // only for the DataTypeDefXsd notation - if (value.equals(DataTypeDefXSD.ANY_URI)) { + if (value.equals(DataTypeDefXsd.ANY_URI)) { gen.writeString("xs:anyURI"); - } else if (value.equals(DataTypeDefXSD.NON_NEGATIVE_INTEGER)) { + } else if (value.equals(DataTypeDefXsd.NON_NEGATIVE_INTEGER)) { gen.writeString("xs:nonNegativeInteger"); } else if(isTimeRelatedValue(value)) { handleTimeRelatedValue(gen, value); diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index a7d12cd1a..46985b03e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -331,14 +332,14 @@ public static T resolve(Reference reference, Environment e if (keyType != null) { if (SubmodelElementList.class.isAssignableFrom(current.getClass())) { try { - current = ((SubmodelElementList) current).getValue().get(Integer.parseInt(key.getValue())); + current = ((SubmodelElementList) current).getValues().get(Integer.parseInt(key.getValue())); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format("invalid value for key with index %d, expected integer values >= 0, but found '%s'", i, key.getValue())); } catch (IndexOutOfBoundsException ex) { throw new IllegalArgumentException(String.format("index out of bounds exception for key with index %d, expected integer values >= 0 and < %d, but found '%s'", i, - ((SubmodelElementList) current).getValue().size(), + ((SubmodelElementList) current).getValues().size(), key.getValue())); } } else { diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 4844d4e3c..483d4a0d9 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +19,11 @@ import java.util.Arrays; import java.util.Base64; -import org.eclipse.digitaltwin.aas4j.v3.model.AASSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; @@ -88,10 +89,9 @@ public class AASFull { public static AssetAdministrationShell createAAS1() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() - )) + .description(new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build()) + .description(new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + ) .id("https://acplt.org/Test_AssetAdministrationShell") .administration(new DefaultAdministrativeInformation.Builder() .version("0") @@ -106,7 +106,7 @@ public static AssetAdministrationShell createAAS1() { .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetID("https://acplt.org/Test_Asset") + .globalAssetId("https://acplt.org/Test_Asset") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -138,7 +138,7 @@ public static AssetAdministrationShell createAAS2() { .id("https://acplt.org/Test_AssetAdministrationShell_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetID("https://acplt.org/Test_Asset_Mandatory") + .globalAssetId("https://acplt.org/Test_Asset_Mandatory") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -163,7 +163,7 @@ public static AssetAdministrationShell createAAS3() { .id("https://acplt.org/Test_AssetAdministrationShell2_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetID("https://acplt.org/Test_Asset_Mandatory") + .globalAssetId("https://acplt.org/Test_Asset_Mandatory") .build()) .build(); } @@ -171,7 +171,7 @@ public static AssetAdministrationShell createAAS3() { public static AssetAdministrationShell createAAS4() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() )) @@ -182,7 +182,7 @@ public static AssetAdministrationShell createAAS4() { .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetID("https://acplt.org/Test_Asset_Missing") + .globalAssetId("https://acplt.org/Test_Asset_Missing") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -197,7 +197,7 @@ public static AssetAdministrationShell createAAS4() { public static Submodel createSubmodel1() { return new DefaultSubmodel.Builder() .idShort("Identification") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() )) @@ -207,7 +207,7 @@ public static Submodel createSubmodel1() { .revision("9") .build()) .kind(ModellingKind.INSTANCE) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/AssetIdentification") @@ -219,11 +219,11 @@ public static Submodel createSubmodel1() { .displayName( new DefaultLangStringNameType.Builder().text("Manufacturer Name").language("en-us").build() ) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("0173-1#02-AAO677#002") @@ -234,19 +234,19 @@ public static Submodel createSubmodel1() { .qualifiers(new DefaultQualifier.Builder() .value("100") .type("http://acplt.org/Qualifier/ExampleQualifier") - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) .qualifiers(new DefaultQualifier.Builder() .value("50") .type("http://acplt.org/Qualifier/ExampleQualifier2") - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) - .value("http://acplt.org/ValueId/ACPLT") - .valueType(DataTypeDefXSD.STRING) - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ACPLT") + .valueType(DataTypeDefXsd.STRING) + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ACPLT") + .value("http://acplt.org/valueId/ACPLT") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) @@ -254,11 +254,11 @@ public static Submodel createSubmodel1() { .submodelElements(new DefaultProperty.Builder() .idShort("InstanceId") .category("VARIABLE") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") @@ -282,8 +282,8 @@ public static Submodel createSubmodel1() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build())) .value("978-8234-234-342") - .valueType(DataTypeDefXSD.STRING) - .valueID(new DefaultReference.Builder() + .valueType(DataTypeDefXsd.STRING) + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("978-8234-234-342") @@ -297,7 +297,7 @@ public static Submodel createSubmodel1() { public static Submodel createSubmodel2() { return new DefaultSubmodel.Builder() .idShort("BillOfMaterial") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() )) @@ -306,7 +306,7 @@ public static Submodel createSubmodel2() { .version("0") .build()) .kind(ModellingKind.INSTANCE) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/BillOfMaterial") @@ -315,11 +315,11 @@ public static Submodel createSubmodel2() { .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") @@ -329,23 +329,23 @@ public static Submodel createSubmodel2() { .statements(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValue2") - .valueType(DataTypeDefXSD.STRING) - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExampleValue2") + .valueType(DataTypeDefXsd.STRING) + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValue2") + .value("http://acplt.org/valueId/ExampleValue2") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) @@ -353,23 +353,23 @@ public static Submodel createSubmodel2() { .statements(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") - .valueType(DataTypeDefXSD.STRING) - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId") + .valueType(DataTypeDefXsd.STRING) + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) @@ -378,11 +378,11 @@ public static Submodel createSubmodel2() { .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity2") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") @@ -390,7 +390,7 @@ public static Submodel createSubmodel2() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .entityType(EntityType.SELF_MANAGED_ENTITY) - .globalAssetID("https://acplt.org/Test_Asset2") + .globalAssetId("https://acplt.org/Test_Asset2") .build()) .build(); } @@ -398,7 +398,7 @@ public static Submodel createSubmodel2() { public static Submodel createSubmodel3() { return new DefaultSubmodel.Builder() .idShort("TestSubmodel") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) @@ -408,7 +408,7 @@ public static Submodel createSubmodel3() { .revision("9") .build()) .kind(ModellingKind.INSTANCE) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") @@ -418,11 +418,11 @@ public static Submodel createSubmodel3() { .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") @@ -463,11 +463,11 @@ public static Submodel createSubmodel3() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") @@ -508,17 +508,17 @@ public static Submodel createSubmodel3() { .idShort("ExampleProperty3") .category("PARAMETER") .value("some example annotation") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") @@ -529,89 +529,89 @@ public static Submodel createSubmodel3() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId") + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .outputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId") + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .inoutputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty3") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId") + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .build()) .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") @@ -624,11 +624,11 @@ public static Submodel createSubmodel3() { .category("PARAMETER") .direction(Direction.INPUT) .state(StateOfEvent.ON) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") @@ -655,64 +655,64 @@ public static Submodel createSubmodel3() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId") + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .value(Arrays.asList( + .values(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) - .valueID(new DefaultReference.Builder() + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleMultiLanguageValueId") + .value("http://acplt.org/valueId/ExampleMultiLanguagevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) @@ -720,11 +720,11 @@ public static Submodel createSubmodel3() { .value(new DefaultRange.Builder() // TODO: a SME-List must only contain one SME-Type, e.g. Property or Range .idShort("ExampleRange") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") @@ -733,18 +733,18 @@ public static Submodel createSubmodel3() { .build()) .min("0") .max("100") - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") @@ -754,11 +754,11 @@ public static Submodel createSubmodel3() { .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) @@ -770,11 +770,11 @@ public static Submodel createSubmodel3() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") @@ -787,11 +787,11 @@ public static Submodel createSubmodel3() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/ReferenceElements/ExampleReferenceElement") @@ -918,11 +918,11 @@ public static Submodel createSubmodel4() { .submodelElements(new DefaultSubmodelElementList.Builder() .idShort("ExampleSubmodelElementListUnordered") .orderRelevant(false) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .value(null) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") @@ -931,9 +931,9 @@ public static Submodel createSubmodel4() { .idShort("ExampleRange") .min(null) .max(null) - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") @@ -967,7 +967,7 @@ public static Submodel createSubmodel5() { public static Submodel createSubmodel6() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelMissing") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) @@ -977,7 +977,7 @@ public static Submodel createSubmodel6() { .version("0") .revision("9") .build()) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") @@ -987,11 +987,11 @@ public static Submodel createSubmodel6() { .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") @@ -1032,11 +1032,11 @@ public static Submodel createSubmodel6() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") @@ -1077,17 +1077,17 @@ public static Submodel createSubmodel6() { .idShort("ExampleProperty") .category("PARAMETER") .value("some example annotation") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") @@ -1098,11 +1098,11 @@ public static Submodel createSubmodel6() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1111,21 +1111,21 @@ public static Submodel createSubmodel6() { .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value("exampleValue") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .outputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1134,21 +1134,21 @@ public static Submodel createSubmodel6() { .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value("exampleValue") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .inoutputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty3") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1157,21 +1157,21 @@ public static Submodel createSubmodel6() { .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value("exampleValue") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .build()) .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") @@ -1184,11 +1184,11 @@ public static Submodel createSubmodel6() { .category("PARAMETER") .direction(Direction.INPUT) .state(StateOfEvent.ON) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") @@ -1215,12 +1215,12 @@ public static Submodel createSubmodel6() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) - .description(Arrays.asList( + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") @@ -1230,11 +1230,11 @@ public static Submodel createSubmodel6() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1243,26 +1243,26 @@ public static Submodel createSubmodel6() { .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value("exampleValue") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .value(Arrays.asList( + .values(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) @@ -1270,11 +1270,11 @@ public static Submodel createSubmodel6() { .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") @@ -1283,18 +1283,18 @@ public static Submodel createSubmodel6() { .build()) .min("0") .max("100") - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") @@ -1304,11 +1304,11 @@ public static Submodel createSubmodel6() { .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") @@ -1321,11 +1321,11 @@ public static Submodel createSubmodel6() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") @@ -1338,11 +1338,11 @@ public static Submodel createSubmodel6() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") @@ -1372,7 +1372,7 @@ public static Submodel createSubmodel6() { public static Submodel createSubmodel7() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelTemplate") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) @@ -1382,7 +1382,7 @@ public static Submodel createSubmodel7() { .version("0") .revision("9") .build()) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") @@ -1393,11 +1393,11 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") @@ -1438,11 +1438,11 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") @@ -1483,11 +1483,11 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") @@ -1498,11 +1498,11 @@ public static Submodel createSubmodel7() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1510,18 +1510,18 @@ public static Submodel createSubmodel7() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(null) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .outputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1529,18 +1529,18 @@ public static Submodel createSubmodel7() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(null) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .inoutputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1548,18 +1548,18 @@ public static Submodel createSubmodel7() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(null) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .build()) .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") @@ -1572,11 +1572,11 @@ public static Submodel createSubmodel7() { .category("PARAMETER") .direction(Direction.OUTPUT) .state(StateOfEvent.OFF) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") @@ -1603,26 +1603,26 @@ public static Submodel createSubmodel7() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1630,16 +1630,16 @@ public static Submodel createSubmodel7() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(null) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") @@ -1650,11 +1650,11 @@ public static Submodel createSubmodel7() { .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") @@ -1663,16 +1663,16 @@ public static Submodel createSubmodel7() { .build()) .min(null) .max("100") - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange2") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") @@ -1681,18 +1681,18 @@ public static Submodel createSubmodel7() { .build()) .min("0") .max(null) - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") @@ -1702,11 +1702,11 @@ public static Submodel createSubmodel7() { .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") @@ -1718,11 +1718,11 @@ public static Submodel createSubmodel7() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") @@ -1735,11 +1735,11 @@ public static Submodel createSubmodel7() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") @@ -1751,11 +1751,11 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection2") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") @@ -1769,7 +1769,7 @@ public static Submodel createSubmodel7() { public static ConceptDescription createConceptDescription1() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) @@ -1798,7 +1798,7 @@ public static ConceptDescription createConceptDescription2() { public static ConceptDescription createConceptDescription3() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription1") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) @@ -1835,7 +1835,7 @@ public static ConceptDescription createConceptDescription4() { .build()) .build()) .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(Arrays.asList( + .preferredNames(Arrays.asList( new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() )) @@ -1845,7 +1845,7 @@ public static ConceptDescription createConceptDescription4() { .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) .unit("SpaceUnit") - .unitID(new DefaultReference.Builder() + .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Units/SpaceUnit") @@ -1858,21 +1858,21 @@ public static ConceptDescription createConceptDescription4() { .value("TEST") .valueList(new DefaultValueList.Builder() .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId") - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId") + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId2") - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId2") + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId2") + .value("http://acplt.org/valueId/ExamplevalueId2") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index 73681dc8b..a57f4a418 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +21,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Extension; @@ -43,7 +44,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResource; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; import org.junit.Assert; @@ -144,11 +145,11 @@ public static AssetAdministrationShell createAAS() { .id(AAS_IDENTIFIER) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetID(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) - .specificAssetIds(new DefaultSpecificAssetID.Builder() + .globalAssetId(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) + .specificAssetIds(new DefaultSpecificAssetId.Builder() .name(EQUIPMENT_ID) .value(_538FD1B3_F99F_4A52_9C75_72E9FA921270) - .externalSubjectID(new DefaultReference.Builder() + .externalSubjectId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_ERP_012) @@ -156,10 +157,10 @@ public static AssetAdministrationShell createAAS() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) - .specificAssetIds(new DefaultSpecificAssetID.Builder() + .specificAssetIds(new DefaultSpecificAssetId.Builder() .name(DEVICE_ID) .value(QJ_YG_PGGJWKI_HK4_RR_QI_YS_LG) - .externalSubjectID(new DefaultReference.Builder() + .externalSubjectId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_IO_T_1) @@ -200,7 +201,7 @@ public static AssetAdministrationShell createAAS() { public static Submodel createSubmodelTechnicalData() { return new DefaultSubmodel.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID) @@ -210,7 +211,7 @@ public static Submodel createSubmodelTechnicalData() { .idShort(SUBMODEL_TECHNICAL_DATA_ID_SHORT) .id(SUBMODEL_TECHNICAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_PROPERTY) @@ -220,7 +221,7 @@ public static Submodel createSubmodelTechnicalData() { .idShort(SUBMODEL_TECHNICAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_TECHNICAL_DATA_PROPERTY_CATEGORY) .value(SUBMODEL_TECHNICAL_DATA_PROPERTY_VALUE) - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build()) .build(); } @@ -231,7 +232,7 @@ public static Submodel createSubmodelOperationalData() { .idShort(SUBMODEL_OPERATIONAL_DATA_ID_SHORT) .id(SUBMODEL_OPERATIONAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_OPERATIONAL_DATA_SEMANTIC_ID_PROPERTY) @@ -241,7 +242,7 @@ public static Submodel createSubmodelOperationalData() { .idShort(SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY) .value(SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE) - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build()) .build(); } @@ -252,7 +253,7 @@ public static Submodel createSubmodelDocumentation() { .idShort(SUBMODEL_DOCUMENTATION_ID_SHORT) .id(SUBMODEL_DOCUMENTATION_ID) .submodelElements(new DefaultSubmodelElementCollection.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_SEMANTIC_ID) @@ -261,7 +262,7 @@ public static Submodel createSubmodelDocumentation() { .build()) .idShort(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_ID_SHORT) .value(new DefaultProperty.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID) @@ -270,10 +271,10 @@ public static Submodel createSubmodelDocumentation() { .build()) .idShort(SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT) .value(SUBMODEL_DOCUMENTATION_PROPERTY_VALUE) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultFile.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID) @@ -364,7 +365,7 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_DREHZAHL).language("de").build()) .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_ROTATIONSPEED).language("en").build()) .unit(_1_MIN) - .unitID(new DefaultReference.Builder() + .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) @@ -401,7 +402,7 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) .unit(_1_MIN) - .unitID(new DefaultReference.Builder() + .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java index 40652ceb7..b9bc9de24 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +36,7 @@ public class CustomProperty implements Property { protected Reference valueId; - protected DataTypeDefXSD valueType; + protected DataTypeDefXsd valueType; protected List qualifiers; @@ -82,12 +83,12 @@ public boolean equals(Object obj) { } @Override - final public DataTypeDefXSD getValueType() { + final public DataTypeDefXsd getValueType() { return this.valueType; } @Override - final public void setValueType(DataTypeDefXSD dataType) { + final public void setValueType(DataTypeDefXsd dataType) { this.valueType = dataType; } @@ -102,12 +103,12 @@ final public void setValue(String value) { } @Override - final public Reference getValueID() { + final public Reference getValueId() { return valueId; } @Override - final public void setValueID(Reference valueId) { + final public void setValueId(Reference valueId) { this.valueId = valueId; } @@ -122,22 +123,22 @@ final public void setCategory(String category) { } @Override - final public List getDescription() { + final public List getDescriptions() { return description; } @Override - final public void setDescription(List description) { + final public void setDescriptions(List description) { this.description = description; } @Override - final public List getDisplayName() { + final public List getDisplayNames() { return displayName; } @Override - final public void setDisplayName(List displayName) { + final public void setDisplayNames(List displayName) { this.displayName = displayName; } @@ -172,12 +173,12 @@ final public void setEmbeddedDataSpecifications(List } @Override - final public Reference getSemanticID() { + final public Reference getSemanticId() { return semanticId; } @Override - final public void setSemanticID(Reference semanticId) { + final public void setSemanticId(Reference semanticId) { this.semanticId = semanticId; } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java index e420e8e53..5ca0161db 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +22,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.Collection; -import org.eclipse.digitaltwin.aas4j.v3.model.AASSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; public interface SubmodelElementListMixin { @@ -41,16 +42,16 @@ public interface SubmodelElementListMixin { public void setSemanticIdListElement(Reference semanticIdListElement); @JsonProperty("typeValueListElement") - public AASSubmodelElements getTypeValueListElement(); + public AasSubmodelElements getTypeValueListElement(); @JsonProperty("typeValueListElement") - public void setTypeValueListElement(AASSubmodelElements typeValueListElement); + public void setTypeValueListElement(AasSubmodelElements typeValueListElement); @JsonProperty("valueTypeListElement") - public DataTypeDefXSD getValueTypeListElement(); + public DataTypeDefXsd getValueTypeListElement(); @JsonProperty("valueTypeListElement") - public void setValueTypeListElement(DataTypeDefXSD valueTypeListElement); + public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); @JsonProperty("value") public Collection getValues(); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java index 6297303af..7cf92fa72 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java @@ -1,5 +1,6 @@ /* * Copyright 2022 jab. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +31,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; public class Examples { @@ -50,11 +51,11 @@ public class Examples { .id("https://example.org/AssetAdministrationShell") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetID("https://example.org/Asset") - .specificAssetIds(new DefaultSpecificAssetID.Builder() + .globalAssetId("https://example.org/Asset") + .specificAssetIds(new DefaultSpecificAssetId.Builder() .name("ExampleAssetId") .value("ExampleValue") - .externalSubjectID(new DefaultReference.Builder() + .externalSubjectId(new DefaultReference.Builder() .type(ReferenceTypes.EXTERNAL_REFERENCE) .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java index e795faa56..2b26e1ece 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; import java.io.IOException; @@ -14,6 +31,6 @@ public class ValueReferencePairNodeDeserializer implements CustomJsonNodeDeseria public ValueReferencePair readValue(JsonNode node, JsonParser parser) throws IOException { String value = node.get("value").asText(); Reference valueId = DeserializationHelper.createInstanceFromNode(parser, node.get("valueId"), Reference.class); - return new DefaultValueReferencePair.Builder().value(value).valueID(valueId).build(); + return new DefaultValueReferencePair.Builder().value(value).valueId(valueId).build(); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java index 19304faf5..1ab503390 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +20,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; @@ -29,11 +30,11 @@ public interface AssetInformationMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetIds") - public List getSpecificAssetIds(); + public List getSpecificAssetIds(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetIds") - public void setSpecificAssetIds(List specificAssetIds); + public void setSpecificAssetIds(List specificAssetIds); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java index ab98d6027..6d9a72164 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +17,7 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -36,7 +37,7 @@ public interface QualifierMixin { void setType(String type); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueType") - void setType(DataTypeDefXSD valueType); + void setType(DataTypeDefXsd valueType); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") void setValue(String value); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java index 0af6f1b47..ef49d195c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +17,7 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; @@ -28,5 +29,5 @@ public interface ResourceMixin { public String getPath(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "contentType") - public DataTypeDefXSD getContentType(); + public DataTypeDefXsd getContentType(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java index bd95e887b..cbad40cc0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +21,8 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.AASSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; @@ -48,14 +49,14 @@ public interface SubmodelElementListMixin { public void setSemanticIdListElement(Reference semanticIdListElement); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "typeValueListElement") - public AASSubmodelElements getTypeValueListElement(); + public AasSubmodelElements getTypeValueListElement(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "typeValueListElement") - public void setTypeValueListElement(AASSubmodelElements typeValueListElement); + public void setTypeValueListElement(AasSubmodelElements typeValueListElement); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueTypeListElement") - public DataTypeDefXSD getValueTypeListElement(); + public DataTypeDefXsd getValueTypeListElement(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueTypeListElement") - public void setValueTypeListElement(DataTypeDefXSD valueTypeListElement); + public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); } diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java index 1e35f8981..6ca6b6c65 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +31,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; @@ -125,7 +126,7 @@ public void testMinimalOperationAgainstXsdSchema() throws SerializationException .value(new DefaultProperty.Builder() .idShort("inputProperty") .value("1") - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) .build()) .build()) @@ -137,7 +138,7 @@ public void testMinimalOperationAgainstXsdSchema() throws SerializationException @Test public void testGYear() throws SerializationException, SAXException { - Submodel submodel = new DefaultSubmodel.Builder().id("yearTestSm").submodelElements(new DefaultProperty.Builder().idShort("yearTestProp").valueType(DataTypeDefXSD.GYEAR).build()).build(); + Submodel submodel = new DefaultSubmodel.Builder().id("yearTestSm").submodelElements(new DefaultProperty.Builder().idShort("yearTestProp").valueType(DataTypeDefXsd.GYEAR).build()).build(); String xml = new XmlSerializer().write(new DefaultEnvironment.Builder().submodels(submodel).build()); Set errors = validateAgainstXsdSchema(xml); assertTrue(errors.isEmpty()); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AASSubmodelElements.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java similarity index 59% rename from model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AASSubmodelElements.java rename to model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java index 23009d63b..b5216b2d5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AASSubmodelElements.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,92 +23,92 @@ /** * Enumeration of all possible elements of a 'SubmodelElementList'. */ -@IRI("aas:AASSubmodelElements") -public enum AASSubmodelElements { +@IRI("aas:AasSubmodelElements") +public enum AasSubmodelElements { /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/AnnotatedRelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/AnnotatedRelationshipElement") ANNOTATED_RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/BasicEventElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/BasicEventElement") BASIC_EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/Blob") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Blob") BLOB, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/Capability") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Capability") CAPABILITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/DataElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/DataElement") DATA_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/Entity") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Entity") ENTITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/EventElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/EventElement") EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/File") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/File") FILE, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/MultiLanguageProperty") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/MultiLanguageProperty") MULTI_LANGUAGE_PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/Operation") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Operation") OPERATION, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/Property") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Property") PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/Range") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Range") RANGE, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/ReferenceElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/ReferenceElement") REFERENCE_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/RelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/RelationshipElement") RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/SubmodelElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElement") SUBMODEL_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/SubmodelElementCollection") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElementCollection") SUBMODEL_ELEMENT_COLLECTION, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/SubmodelElementList") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElementList") SUBMODEL_ELEMENT_LIST; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java index c50f75ab4..fe6b51a24 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -24,9 +25,9 @@ * Strings with language tags */ @KnownSubtypes({ - @KnownSubtypes.Type(value = LangStringDefinitionTypeIec61360.class), @KnownSubtypes.Type(value = LangStringPreferredNameTypeIec61360.class), @KnownSubtypes.Type(value = LangStringShortNameTypeIec61360.class), + @KnownSubtypes.Type(value = LangStringDefinitionTypeIec61360.class), @KnownSubtypes.Type(value = LangStringNameType.class), @KnownSubtypes.Type(value = LangStringTextType.class) }) diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java index e5c3ff60f..19390fc5c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,23 +30,23 @@ public interface AdministrativeInformation extends HasDataSpecification { /** - * The subject ID of the subject responsible for making the element. + * Version of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version * - * @return Returns the Reference for the property creator. + * @return Returns the String for the property version. */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/creator") - Reference getCreator(); + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") + String getVersion(); /** - * The subject ID of the subject responsible for making the element. + * Version of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version * - * @param creator desired value for the property creator. + * @param version desired value for the property version. */ - void setCreator(Reference creator); + void setVersion(String version); /** * Revision of the element. @@ -67,41 +68,41 @@ public interface AdministrativeInformation extends HasDataSpecification { void setRevision(String revision); /** - * Identifier of the template that guided the creation of the element. + * The subject ID of the subject responsible for making the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateID + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator * - * @return Returns the String for the property templateID. + * @return Returns the Reference for the property creator. */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateID") - String getTemplateID(); + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/creator") + Reference getCreator(); /** - * Identifier of the template that guided the creation of the element. + * The subject ID of the subject responsible for making the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateID + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator * - * @param templateID desired value for the property templateID. + * @param creator desired value for the property creator. */ - void setTemplateID(String templateID); + void setCreator(Reference creator); /** - * Version of the element. + * Identifier of the template that guided the creation of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId * - * @return Returns the String for the property version. + * @return Returns the String for the property templateId. */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") - String getVersion(); + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId") + String getTemplateId(); /** - * Version of the element. + * Identifier of the template that guided the creation of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId * - * @param version desired value for the property version. + * @param templateId desired value for the property templateId. */ - void setVersion(String version); + void setTemplateId(String templateId); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java index 841ea2032..788534fba 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java index 238314362..3e0b0b9cb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -30,42 +31,42 @@ public interface AssetAdministrationShell extends HasDataSpecification, Identifiable { /** - * Meta-information about the asset the AAS is representing. + * The reference to the AAS the AAS was derived from. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom * - * @return Returns the AssetInformation for the property assetInformation. + * @return Returns the Reference for the property derivedFrom. */ - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation") - AssetInformation getAssetInformation(); + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom") + Reference getDerivedFrom(); /** - * Meta-information about the asset the AAS is representing. + * The reference to the AAS the AAS was derived from. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom * - * @param assetInformation desired value for the property assetInformation. + * @param derivedFrom desired value for the property derivedFrom. */ - void setAssetInformation(AssetInformation assetInformation); + void setDerivedFrom(Reference derivedFrom); /** - * The reference to the AAS the AAS was derived from. + * Meta-information about the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation * - * @return Returns the Reference for the property derivedFrom. + * @return Returns the AssetInformation for the property assetInformation. */ - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom") - Reference getDerivedFrom(); + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation") + AssetInformation getAssetInformation(); /** - * The reference to the AAS the AAS was derived from. + * Meta-information about the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation * - * @param derivedFrom desired value for the property derivedFrom. + * @param assetInformation desired value for the property assetInformation. */ - void setDerivedFrom(Reference derivedFrom); + void setAssetInformation(AssetInformation assetInformation); /** * References to submodels of the AAS. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java index 517cb9db6..ae48cae15 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -50,83 +51,83 @@ public interface AssetInformation { void setAssetKind(AssetKind assetKind); /** - * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset - * under consideration as identified by 'globalAssetID'. + * Global identifier of the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType + * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId * - * @return Returns the String for the property assetType. + * @return Returns the String for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetType") - String getAssetType(); + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId") + String getGlobalAssetId(); /** - * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset - * under consideration as identified by 'globalAssetID'. + * Global identifier of the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType + * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId * - * @param assetType desired value for the property assetType. + * @param globalAssetId desired value for the property globalAssetId. */ - void setAssetType(String assetType); + void setGlobalAssetId(String globalAssetId); /** - * Thumbnail of the asset represented by the Asset Administration Shell. + * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial + * number etc. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail + * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds * - * @return Returns the Resource for the property defaultThumbnail. + * @return Returns the List of SpecificAssetIds for the property specificAssetIds. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") - Resource getDefaultThumbnail(); + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") + List getSpecificAssetIds(); /** - * Thumbnail of the asset represented by the Asset Administration Shell. + * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial + * number etc. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail + * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds * - * @param defaultThumbnail desired value for the property defaultThumbnail. + * @param specificAssetIds desired value for the property specificAssetIds. */ - void setDefaultThumbnail(Resource defaultThumbnail); + void setSpecificAssetIds(List specificAssetIds); /** - * Global identifier of the asset the AAS is representing. + * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset + * under consideration as identified by 'globalAssetId'. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetID + * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType * - * @return Returns the String for the property globalAssetID. + * @return Returns the String for the property assetType. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetID") - String getGlobalAssetID(); + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetType") + String getAssetType(); /** - * Global identifier of the asset the AAS is representing. + * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset + * under consideration as identified by 'globalAssetId'. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetID + * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType * - * @param globalAssetID desired value for the property globalAssetID. + * @param assetType desired value for the property assetType. */ - void setGlobalAssetID(String globalAssetID); + void setAssetType(String assetType); /** - * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial - * number etc. + * Thumbnail of the asset represented by the Asset Administration Shell. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail * - * @return Returns the List of SpecificAssetIDs for the property specificAssetIds. + * @return Returns the Resource for the property defaultThumbnail. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") - List getSpecificAssetIds(); + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") + Resource getDefaultThumbnail(); /** - * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial - * number etc. + * Thumbnail of the asset represented by the Asset Administration Shell. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail * - * @param specificAssetIds desired value for the property specificAssetIds. + * @param defaultThumbnail desired value for the property defaultThumbnail. */ - void setSpecificAssetIds(List specificAssetIds); + void setDefaultThumbnail(Resource defaultThumbnail); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java index 70ea05c93..74400ccd9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java index 2364f88f2..1dc3622d9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -28,6 +29,27 @@ }) public interface BasicEventElement extends EventElement { + /** + * Reference to the 'Referable', which defines the scope of the event. Can be + * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed + * + * @return Returns the Reference for the property observed. + */ + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/observed") + Reference getObserved(); + + /** + * Reference to the 'Referable', which defines the scope of the event. Can be + * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed + * + * @param observed desired value for the property observed. + */ + void setObserved(Reference observed); + /** * Direction of event. * @@ -48,42 +70,44 @@ public interface BasicEventElement extends EventElement { void setDirection(Direction direction); /** - * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). + * State of event. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state * - * @return Returns the String for the property lastUpdate. + * @return Returns the StateOfEvent for the property state. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate") - String getLastUpdate(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/state") + StateOfEvent getState(); /** - * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). + * State of event. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state * - * @param lastUpdate desired value for the property lastUpdate. + * @param state desired value for the property state. */ - void setLastUpdate(String lastUpdate); + void setState(StateOfEvent state); /** - * For input direction: not applicable. + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic * - * @return Returns the String for the property maxInterval. + * @return Returns the String for the property messageTopic. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval") - String getMaxInterval(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic") + String getMessageTopic(); /** - * For input direction: not applicable. + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic * - * @param maxInterval desired value for the property maxInterval. + * @param messageTopic desired value for the property messageTopic. */ - void setMaxInterval(String maxInterval); + void setMessageTopic(String messageTopic); /** * Information, which outer message infrastructure shall handle messages for the 'EventElement'. @@ -109,25 +133,23 @@ public interface BasicEventElement extends EventElement { void setMessageBroker(Reference messageBroker); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate * - * @return Returns the String for the property messageTopic. + * @return Returns the String for the property lastUpdate. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic") - String getMessageTopic(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate") + String getLastUpdate(); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate * - * @param messageTopic desired value for the property messageTopic. + * @param lastUpdate desired value for the property lastUpdate. */ - void setMessageTopic(String messageTopic); + void setLastUpdate(String lastUpdate); /** * For input direction, reports on the maximum frequency, the software entity behind the respective @@ -151,43 +173,22 @@ public interface BasicEventElement extends EventElement { void setMinInterval(String minInterval); /** - * Reference to the 'Referable', which defines the scope of the event. Can be - * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed - * - * @return Returns the Reference for the property observed. - */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/observed") - Reference getObserved(); - - /** - * Reference to the 'Referable', which defines the scope of the event. Can be - * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed - * - * @param observed desired value for the property observed. - */ - void setObserved(Reference observed); - - /** - * State of event. + * For input direction: not applicable. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval * - * @return Returns the StateOfEvent for the property state. + * @return Returns the String for the property maxInterval. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/state") - StateOfEvent getState(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval") + String getMaxInterval(); /** - * State of event. + * For input direction: not applicable. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval * - * @param state desired value for the property state. + * @param maxInterval desired value for the property maxInterval. */ - void setState(StateOfEvent state); + void setMaxInterval(String maxInterval); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java index 8ea957078..4d0e69a95 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -30,41 +31,41 @@ public interface Blob extends DataElement { /** - * Content type of the content of the 'Blob'. + * The value of the 'Blob' instance of a blob data element. * - * More information under https://admin-shell.io/aas/3/0/Blob/contentType + * More information under https://admin-shell.io/aas/3/0/Blob/value * - * @return Returns the String for the property contentType. + * @return Returns the byte[] for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/Blob/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/Blob/value") + byte[] getValue(); /** - * Content type of the content of the 'Blob'. + * The value of the 'Blob' instance of a blob data element. * - * More information under https://admin-shell.io/aas/3/0/Blob/contentType + * More information under https://admin-shell.io/aas/3/0/Blob/value * - * @param contentType desired value for the property contentType. + * @param value desired value for the property value. */ - void setContentType(String contentType); + void setValue(byte[] value); /** - * The value of the 'Blob' instance of a blob data element. + * Content type of the content of the 'Blob'. * - * More information under https://admin-shell.io/aas/3/0/Blob/value + * More information under https://admin-shell.io/aas/3/0/Blob/contentType * - * @return Returns the byte[] for the property value. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/Blob/value") - byte[] getValue(); + @IRI("https://admin-shell.io/aas/3/0/Blob/contentType") + String getContentType(); /** - * The value of the 'Blob' instance of a blob data element. + * Content type of the content of the 'Blob'. * - * More information under https://admin-shell.io/aas/3/0/Blob/value + * More information under https://admin-shell.io/aas/3/0/Blob/contentType * - * @param value desired value for the property value. + * @param contentType desired value for the property contentType. */ - void setValue(byte[] value); + void setContentType(String contentType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java index 26cb02ec6..de73e72cf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java index a18fe9266..f9837b1c0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -35,18 +36,18 @@ public interface ConceptDescription extends HasDataSpecification, Identifiable { * * More information under https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf * - * @return Returns the List of References for the property isCaseOf. + * @return Returns the List of References for the property isCaseOfs. */ @IRI("https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf") - List getIsCaseOf(); + List getIsCaseOfs(); /** * Reference to an external definition the concept is compatible to or was derived from. * * More information under https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf * - * @param isCaseOf desired value for the property isCaseOf. + * @param isCaseOfs desired value for the property isCaseOfs. */ - void setIsCaseOf(List isCaseOf); + void setIsCaseOfs(List isCaseOfs); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java index 3c848efab..4b2208252 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java index c6ba9d955..5c99e7daf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java index c0b5a1b18..48278c09a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -31,99 +32,80 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { /** - * Data Type - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType - * - * @return Returns the DataTypeIec61360 for the property dataType. - */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/dataType") - DataTypeIec61360 getDataType(); - - /** - * Data Type - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType - * - * @param dataType desired value for the property dataType. - */ - void setDataType(DataTypeIec61360 dataType); - - /** - * Definition in different languages + * Preferred name * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName * - * @return Returns the List of LangStringDefinitionTypeIEC61360s for the property definition. + * @return Returns the List of LangStringPreferredNameTypeIec61360s for the property preferredNames. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/definition") - List getDefinition(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName") + List getPreferredNames(); /** - * Definition in different languages + * Preferred name * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName * - * @param definition desired value for the property definition. + * @param preferredNames desired value for the property preferredNames. */ - void setDefinition(List definition); + void setPreferredNames(List preferredNames); /** - * Set of levels. + * Short name * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/levelType + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName * - * @return Returns the LevelType for the property levelType. + * @return Returns the List of LangStringShortNameTypeIec61360s for the property shortNames. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/levelType") - LevelType getLevelType(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName") + List getShortNames(); /** - * Set of levels. + * Short name * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/levelType + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName * - * @param levelType desired value for the property levelType. + * @param shortNames desired value for the property shortNames. */ - void setLevelType(LevelType levelType); + void setShortNames(List shortNames); /** - * Preferred name + * Unit * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit * - * @return Returns the List of LangStringPreferredNameTypeIEC61360s for the property preferredName. + * @return Returns the String for the property unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/preferredName") - List getPreferredName(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit") + String getUnit(); /** - * Preferred name + * Unit * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit * - * @param preferredName desired value for the property preferredName. + * @param unit desired value for the property unit. */ - void setPreferredName(List preferredName); + void setUnit(String unit); /** - * Short name + * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId * - * @return Returns the List of LangStringShortNameTypeIEC61360s for the property shortName. + * @return Returns the Reference for the property unitId. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/shortName") - List getShortName(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId") + Reference getUnitId(); /** - * Short name + * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId * - * @param shortName desired value for the property shortName. + * @param unitId desired value for the property unitId. */ - void setShortName(List shortName); + void setUnitId(Reference unitId); /** * Source of definition @@ -133,7 +115,7 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { * * @return Returns the String for the property sourceOfDefinition. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition") String getSourceOfDefinition(); /** @@ -153,7 +135,7 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { * * @return Returns the String for the property symbol. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol") String getSymbol(); /** @@ -166,61 +148,42 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { void setSymbol(String symbol); /** - * Unit - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit - * - * @return Returns the String for the property unit. - */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/unit") - String getUnit(); - - /** - * Unit - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit - * - * @param unit desired value for the property unit. - */ - void setUnit(String unit); - - /** - * Unique unit id + * Data Type * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitID + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType * - * @return Returns the Reference for the property unitID. + * @return Returns the DataTypeIec61360 for the property dataType. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/unitID") - Reference getUnitID(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType") + DataTypeIec61360 getDataType(); /** - * Unique unit id + * Data Type * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitID + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType * - * @param unitID desired value for the property unitID. + * @param dataType desired value for the property dataType. */ - void setUnitID(Reference unitID); + void setDataType(DataTypeIec61360 dataType); /** - * Value + * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition * - * @return Returns the String for the property value. + * @return Returns the List of LangStringDefinitionTypeIec61360s for the property definitions. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/value") - String getValue(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition") + List getDefinitions(); /** - * Value + * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition * - * @param value desired value for the property value. + * @param definitions desired value for the property definitions. */ - void setValue(String value); + void setDefinitions(List definitions); /** * Value Format @@ -229,7 +192,7 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { * * @return Returns the String for the property valueFormat. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat") String getValueFormat(); /** @@ -248,7 +211,7 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { * * @return Returns the ValueList for the property valueList. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList") ValueList getValueList(); /** @@ -260,4 +223,42 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { */ void setValueList(ValueList valueList); + /** + * Value + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value + * + * @return Returns the String for the property value. + */ + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value") + String getValue(); + + /** + * Value + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value + * + * @param value desired value for the property value. + */ + void setValue(String value); + + /** + * Set of levels. + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType + * + * @return Returns the LevelType for the property levelType. + */ + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType") + LevelType getLevelType(); + + /** + * Set of levels. + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType + * + * @param levelType desired value for the property levelType. + */ + void setLevelType(LevelType levelType); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXSD.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXSD.java deleted file mode 100644 index 7452b2596..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXSD.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - - -/** - * Enumeration listing all XSD anySimpleTypes - */ -@IRI("aas:DataTypeDefXSD") -public enum DataTypeDefXSD { - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/AnyUri") - ANY_URI, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Base64Binary") - BASE64BINARY, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Boolean") - BOOLEAN, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Byte") - BYTE, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Date") - DATE, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/DateTime") - DATE_TIME, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Decimal") - DECIMAL, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Double") - DOUBLE, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Duration") - DURATION, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Float") - FLOAT, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/GDay") - GDAY, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/GMonth") - GMONTH, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/GMonthDay") - GMONTH_DAY, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/GYear") - GYEAR, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/GYearMonth") - GYEAR_MONTH, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/HexBinary") - HEX_BINARY, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Int") - INT, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Integer") - INTEGER, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Long") - LONG, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/NegativeInteger") - NEGATIVE_INTEGER, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/NonNegativeInteger") - NON_NEGATIVE_INTEGER, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/NonPositiveInteger") - NON_POSITIVE_INTEGER, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/PositiveInteger") - POSITIVE_INTEGER, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Short") - SHORT, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/String") - STRING, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Time") - TIME, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/UnsignedByte") - UNSIGNED_BYTE, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/UnsignedInt") - UNSIGNED_INT, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/UnsignedLong") - UNSIGNED_LONG, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/UnsignedShort") - UNSIGNED_SHORT; - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java index a77873cda..91e2768a5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -21,129 +22,129 @@ /** */ -@IRI("aas:DataTypeIEC61360") +@IRI("aas:DataTypeIec61360") public enum DataTypeIec61360 { /** * values containing the content of a file. Values may be binaries. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Blob") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Blob") BLOB, /** * values representing truth of logic or Boolean algebra (TRUE, FALSE) */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Boolean") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Boolean") BOOLEAN, /** * values containing a calendar date, conformant to ISO 8601:2004 Format yyyy-mm-dd Example from IEC * 61360-1:2017: "1999-05-31" is the [DATE] representation of: "31 May 1999". */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Date") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Date") DATE, /** * values containing an address to a file. The values are of type URI and can represent an absolute * or relative path. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/File") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/File") FILE, /** * Values containing string with any sequence of characters, using the syntax of HTML5 (see W3C * Recommendation 28:2014) */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Html") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Html") HTML, /** * values containing values of type INTEGER but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/IntegerCount") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerCount") INTEGER_COUNT, /** * values containing values of type INTEGER that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/IntegerCurrency") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerCurrency") INTEGER_CURRENCY, /** * values containing values that are measure of type INTEGER. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/IntegerMeasure") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerMeasure") INTEGER_MEASURE, /** * values conforming to ISO/IEC 11179 series global identifier sequences */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Irdi") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Irdi") IRDI, /** * values containing values of type STRING conformant to Rfc 3987 */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Iri") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Iri") IRI, /** * values containing values of type rational */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Rational") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Rational") RATIONAL, /** * values containing values of type rational. In addition such a value comes with a physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/RationalMeasure") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RationalMeasure") RATIONAL_MEASURE, /** * values containing numbers that can be written as a terminating or non-terminating decimal; a * rational or irrational number but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/RealCount") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealCount") REAL_COUNT, /** * values containing values of type REAL that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/RealCurrency") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealCurrency") REAL_CURRENCY, /** * values containing values that are measures of type REAL. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/RealMeasure") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealMeasure") REAL_MEASURE, /** * values consisting of sequence of characters but cannot be translated into other languages */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/String") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/String") STRING, /** * values containing string but shall be represented as different string in different languages */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/StringTranslatable") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/StringTranslatable") STRING_TRANSLATABLE, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Time") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Time") TIME, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Timestamp") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Timestamp") TIMESTAMP; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java index 9a556a503..471cd52f5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java index 5be85af48..a698dd362 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java index 17c09503a..5ac6854f6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,6 +30,27 @@ }) public interface Entity extends SubmodelElement { + /** + * Describes statements applicable to the entity by a set of submodel elements, typically with a + * qualified value. + * + * More information under https://admin-shell.io/aas/3/0/Entity/statements + * + * @return Returns the List of SubmodelElements for the property statements. + */ + @IRI("https://admin-shell.io/aas/3/0/Entity/statements") + List getStatements(); + + /** + * Describes statements applicable to the entity by a set of submodel elements, typically with a + * qualified value. + * + * More information under https://admin-shell.io/aas/3/0/Entity/statements + * + * @param statements desired value for the property statements. + */ + void setStatements(List statements); + /** * Describes whether the entity is a co-managed entity or a self-managed entity. * @@ -51,21 +73,21 @@ public interface Entity extends SubmodelElement { /** * Global identifier of the asset the entity is representing. * - * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetID + * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetId * - * @return Returns the String for the property globalAssetID. + * @return Returns the String for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetID") - String getGlobalAssetID(); + @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetId") + String getGlobalAssetId(); /** * Global identifier of the asset the entity is representing. * - * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetID + * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetId * - * @param globalAssetID desired value for the property globalAssetID. + * @param globalAssetId desired value for the property globalAssetId. */ - void setGlobalAssetID(String globalAssetID); + void setGlobalAssetId(String globalAssetId); /** * Reference to a specific asset ID representing a supplementary identifier of the asset represented @@ -73,10 +95,10 @@ public interface Entity extends SubmodelElement { * * More information under https://admin-shell.io/aas/3/0/Entity/specificAssetIds * - * @return Returns the List of SpecificAssetIDs for the property specificAssetIds. + * @return Returns the List of SpecificAssetIds for the property specificAssetIds. */ @IRI("https://admin-shell.io/aas/3/0/Entity/specificAssetIds") - List getSpecificAssetIds(); + List getSpecificAssetIds(); /** * Reference to a specific asset ID representing a supplementary identifier of the asset represented @@ -86,27 +108,6 @@ public interface Entity extends SubmodelElement { * * @param specificAssetIds desired value for the property specificAssetIds. */ - void setSpecificAssetIds(List specificAssetIds); - - /** - * Describes statements applicable to the entity by a set of submodel elements, typically with a - * qualified value. - * - * More information under https://admin-shell.io/aas/3/0/Entity/statements - * - * @return Returns the List of SubmodelElements for the property statements. - */ - @IRI("https://admin-shell.io/aas/3/0/Entity/statements") - List getStatements(); - - /** - * Describes statements applicable to the entity by a set of submodel elements, typically with a - * qualified value. - * - * More information under https://admin-shell.io/aas/3/0/Entity/statements - * - * @param statements desired value for the property statements. - */ - void setStatements(List statements); + void setSpecificAssetIds(List specificAssetIds); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java index 5fec4fe06..875c8dfb4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java index 5485872b9..92d8c964e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -49,41 +50,41 @@ public interface Environment { void setAssetAdministrationShells(List assetAdministrationShells); /** - * Concept description + * Submodel * - * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions + * More information under https://admin-shell.io/aas/3/0/Environment/submodels * - * @return Returns the List of ConceptDescriptions for the property conceptDescriptions. + * @return Returns the List of Submodels for the property submodels. */ - @IRI("https://admin-shell.io/aas/3/0/Environment/conceptDescriptions") - List getConceptDescriptions(); + @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") + List getSubmodels(); /** - * Concept description + * Submodel * - * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions + * More information under https://admin-shell.io/aas/3/0/Environment/submodels * - * @param conceptDescriptions desired value for the property conceptDescriptions. + * @param submodels desired value for the property submodels. */ - void setConceptDescriptions(List conceptDescriptions); + void setSubmodels(List submodels); /** - * Submodel + * Concept description * - * More information under https://admin-shell.io/aas/3/0/Environment/submodels + * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions * - * @return Returns the List of Submodels for the property submodels. + * @return Returns the List of ConceptDescriptions for the property conceptDescriptions. */ - @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") - List getSubmodels(); + @IRI("https://admin-shell.io/aas/3/0/Environment/conceptDescriptions") + List getConceptDescriptions(); /** - * Submodel + * Concept description * - * More information under https://admin-shell.io/aas/3/0/Environment/submodels + * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions * - * @param submodels desired value for the property submodels. + * @param conceptDescriptions desired value for the property conceptDescriptions. */ - void setSubmodels(List submodels); + void setConceptDescriptions(List conceptDescriptions); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java index 02818c712..074938c82 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java index f971df611..3e99c1c30 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,120 +30,122 @@ public interface EventPayload { /** - * Reference to the referable, which defines the scope of the event. + * Reference to the source event element, including identification of 'AssetAdministrationShell', + * 'Submodel', 'SubmodelElement''s. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference + * More information under https://admin-shell.io/aas/3/0/EventPayload/source * - * @return Returns the Reference for the property observableReference. + * @return Returns the Reference for the property source. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") - Reference getObservableReference(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") + Reference getSource(); /** - * Reference to the referable, which defines the scope of the event. + * Reference to the source event element, including identification of 'AssetAdministrationShell', + * 'Submodel', 'SubmodelElement''s. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference + * More information under https://admin-shell.io/aas/3/0/EventPayload/source * - * @param observableReference desired value for the property observableReference. + * @param source desired value for the property source. */ - void setObservableReference(Reference observableReference); + void setSource(Reference source); /** - * 'semanticID' of the referable which defines the scope of the event, if available. + * 'semanticId' of the source event element, if available * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticID + * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId * - * @return Returns the Reference for the property observableSemanticID. + * @return Returns the Reference for the property sourceSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticID") - Reference getObservableSemanticID(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId") + Reference getSourceSemanticId(); /** - * 'semanticID' of the referable which defines the scope of the event, if available. + * 'semanticId' of the source event element, if available * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticID + * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId * - * @param observableSemanticID desired value for the property observableSemanticID. + * @param sourceSemanticId desired value for the property sourceSemanticId. */ - void setObservableSemanticID(Reference observableSemanticID); + void setSourceSemanticId(Reference sourceSemanticId); /** - * Event specific payload. + * Reference to the referable, which defines the scope of the event. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/payload + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference * - * @return Returns the byte[] for the property payload. + * @return Returns the Reference for the property observableReference. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") - byte[] getPayload(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") + Reference getObservableReference(); /** - * Event specific payload. + * Reference to the referable, which defines the scope of the event. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/payload + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference * - * @param payload desired value for the property payload. + * @param observableReference desired value for the property observableReference. */ - void setPayload(byte[] payload); + void setObservableReference(Reference observableReference); /** - * Reference to the source event element, including identification of 'AssetAdministrationShell', - * 'Submodel', 'SubmodelElement''s. + * 'semanticId' of the referable which defines the scope of the event, if available. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/source + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId * - * @return Returns the Reference for the property source. + * @return Returns the Reference for the property observableSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") - Reference getSource(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId") + Reference getObservableSemanticId(); /** - * Reference to the source event element, including identification of 'AssetAdministrationShell', - * 'Submodel', 'SubmodelElement''s. + * 'semanticId' of the referable which defines the scope of the event, if available. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/source + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId * - * @param source desired value for the property source. + * @param observableSemanticId desired value for the property observableSemanticId. */ - void setSource(Reference source); + void setObservableSemanticId(Reference observableSemanticId); /** - * 'semanticID' of the source event element, if available + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticID + * More information under https://admin-shell.io/aas/3/0/EventPayload/topic * - * @return Returns the Reference for the property sourceSemanticID. + * @return Returns the String for the property topic. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticID") - Reference getSourceSemanticID(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") + String getTopic(); /** - * 'semanticID' of the source event element, if available + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticID + * More information under https://admin-shell.io/aas/3/0/EventPayload/topic * - * @param sourceSemanticID desired value for the property sourceSemanticID. + * @param topic desired value for the property topic. */ - void setSourceSemanticID(Reference sourceSemanticID); + void setTopic(String topic); /** * Subject, who/which initiated the creation. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectID + * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectId * - * @return Returns the Reference for the property subjectID. + * @return Returns the Reference for the property subjectId. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectID") - Reference getSubjectID(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectId") + Reference getSubjectId(); /** * Subject, who/which initiated the creation. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectID + * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectId * - * @param subjectID desired value for the property subjectID. + * @param subjectId desired value for the property subjectId. */ - void setSubjectID(Reference subjectID); + void setSubjectId(Reference subjectId); /** * Timestamp in UTC, when this event was triggered. @@ -164,24 +167,22 @@ public interface EventPayload { void setTimeStamp(String timeStamp); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Event specific payload. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/topic + * More information under https://admin-shell.io/aas/3/0/EventPayload/payload * - * @return Returns the String for the property topic. + * @return Returns the byte[] for the property payload. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") - String getTopic(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") + byte[] getPayload(); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Event specific payload. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/topic + * More information under https://admin-shell.io/aas/3/0/EventPayload/payload * - * @param topic desired value for the property topic. + * @param payload desired value for the property payload. */ - void setTopic(String topic); + void setPayload(byte[] payload); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java index 9638fe412..07f6b1eec 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -49,23 +50,23 @@ public interface Extension extends HasSemantics { void setName(String name); /** - * Reference to an element the extension refers to. + * Type of the value of the extension. * - * More information under https://admin-shell.io/aas/3/0/Extension/refersTo + * More information under https://admin-shell.io/aas/3/0/Extension/valueType * - * @return Returns the List of References for the property refersTo. + * @return Returns the DataTypeDefXsd for the property valueType. */ - @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") - List getRefersTo(); + @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") + DataTypeDefXsd getValueType(); /** - * Reference to an element the extension refers to. + * Type of the value of the extension. * - * More information under https://admin-shell.io/aas/3/0/Extension/refersTo + * More information under https://admin-shell.io/aas/3/0/Extension/valueType * - * @param refersTo desired value for the property refersTo. + * @param valueType desired value for the property valueType. */ - void setRefersTo(List refersTo); + void setValueType(DataTypeDefXsd valueType); /** * Value of the extension @@ -87,22 +88,22 @@ public interface Extension extends HasSemantics { void setValue(String value); /** - * Type of the value of the extension. + * Reference to an element the extension refers to. * - * More information under https://admin-shell.io/aas/3/0/Extension/valueType + * More information under https://admin-shell.io/aas/3/0/Extension/refersTo * - * @return Returns the DataTypeDefXSD for the property valueType. + * @return Returns the List of References for the property refersTos. */ - @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") - DataTypeDefXSD getValueType(); + @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") + List getRefersTos(); /** - * Type of the value of the extension. + * Reference to an element the extension refers to. * - * More information under https://admin-shell.io/aas/3/0/Extension/valueType + * More information under https://admin-shell.io/aas/3/0/Extension/refersTo * - * @param valueType desired value for the property valueType. + * @param refersTos desired value for the property refersTos. */ - void setValueType(DataTypeDefXSD valueType); + void setRefersTos(List refersTos); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java index 6bf0dfc6c..0640b0862 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,41 +30,41 @@ public interface File extends DataElement { /** - * Content type of the content of the file. + * Path and name of the referenced file (with file extension). * - * More information under https://admin-shell.io/aas/3/0/File/contentType + * More information under https://admin-shell.io/aas/3/0/File/value * - * @return Returns the String for the property contentType. + * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/File/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/File/value") + String getValue(); /** - * Content type of the content of the file. + * Path and name of the referenced file (with file extension). * - * More information under https://admin-shell.io/aas/3/0/File/contentType + * More information under https://admin-shell.io/aas/3/0/File/value * - * @param contentType desired value for the property contentType. + * @param value desired value for the property value. */ - void setContentType(String contentType); + void setValue(String value); /** - * Path and name of the referenced file (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/File/value + * More information under https://admin-shell.io/aas/3/0/File/contentType * - * @return Returns the String for the property value. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/File/value") - String getValue(); + @IRI("https://admin-shell.io/aas/3/0/File/contentType") + String getContentType(); /** - * Path and name of the referenced file (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/File/value + * More information under https://admin-shell.io/aas/3/0/File/contentType * - * @param value desired value for the property value. + * @param contentType desired value for the property contentType. */ - void setValue(String value); + void setContentType(String contentType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java index c266eda1c..511c51ce5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -26,8 +27,8 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = AdministrativeInformation.class), @KnownSubtypes.Type(value = AssetAdministrationShell.class), - @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = ConceptDescription.class), + @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class) }) public interface HasDataSpecification { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java index 4da4a2342..624ff047b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java index 420fed252..9a4bb07ca 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java index a5933022c..12e336f11 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -24,7 +25,7 @@ * Element that can have a semantic definition plus some supplemental semantic definitions. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = SpecificAssetID.class), + @KnownSubtypes.Type(value = SpecificAssetId.class), @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class), @KnownSubtypes.Type(value = Extension.class), @@ -36,22 +37,22 @@ public interface HasSemantics { * Identifier of the semantic definition of the element. It is called semantic ID of the element or * also main semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticID + * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticId * - * @return Returns the Reference for the property semanticID. + * @return Returns the Reference for the property semanticId. */ - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - Reference getSemanticID(); + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + Reference getSemanticId(); /** * Identifier of the semantic definition of the element. It is called semantic ID of the element or * also main semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticID + * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticId * - * @param semanticID desired value for the property semanticID. + * @param semanticId desired value for the property semanticId. */ - void setSemanticID(Reference semanticID); + void setSemanticId(Reference semanticId); /** * Identifier of a supplemental semantic definition of the element. It is called supplemental diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java index 325a3d6d8..0f328c7d1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java index e58033a6a..c91f83277 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java index c08fef3b8..fd44ac144 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java index a2153c56c..0e53dde47 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java index 510fa9ff7..c28a05bbb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java index 970690271..12de5f4d9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java index dfa79c706..fecf969e6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java index dc960b950..2fffe3cd8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java index 36ca14e5b..df6a1ac15 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,25 +30,6 @@ }) public interface LevelType { - /** - * Maximum of the value - * - * More information under https://admin-shell.io/aas/3/0/LevelType/max - * - * @return Returns the boolean for the property max. - */ - @IRI("https://admin-shell.io/aas/3/0/LevelType/max") - boolean getMax(); - - /** - * Maximum of the value - * - * More information under https://admin-shell.io/aas/3/0/LevelType/max - * - * @param max desired value for the property max. - */ - void setMax(boolean max); - /** * Minimum of the value * @@ -105,4 +87,23 @@ public interface LevelType { */ void setTyp(boolean typ); + /** + * Maximum of the value + * + * More information under https://admin-shell.io/aas/3/0/LevelType/max + * + * @return Returns the boolean for the property max. + */ + @IRI("https://admin-shell.io/aas/3/0/LevelType/max") + boolean getMax(); + + /** + * Maximum of the value + * + * More information under https://admin-shell.io/aas/3/0/LevelType/max + * + * @param max desired value for the property max. + */ + void setMax(boolean max); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java index 070e48af7..50aba3530 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java index e2ca85aa4..d828bec39 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -34,37 +35,37 @@ public interface MultiLanguageProperty extends DataElement { * * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/value * - * @return Returns the List of LangStringTextTypes for the property value. + * @return Returns the List of LangStringTextTypes for the property values. */ @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/value") - List getValue(); + List getValues(); /** * The value of the property instance. * * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/value * - * @param value desired value for the property value. + * @param values desired value for the property values. */ - void setValue(List value); + void setValues(List values); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueID + * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId * - * @return Returns the Reference for the property valueID. + * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueID") - Reference getValueID(); + @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId") + Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueID + * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId * - * @param valueID desired value for the property valueID. + * @param valueId desired value for the property valueId. */ - void setValueID(Reference valueID); + void setValueId(Reference valueId); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java index 18bb33559..17a2ea927 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,25 +30,6 @@ }) public interface Operation extends SubmodelElement { - /** - * Parameter that is input and output of the operation. - * - * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables - * - * @return Returns the List of OperationVariables for the property inoutputVariables. - */ - @IRI("https://admin-shell.io/aas/3/0/Operation/inoutputVariables") - List getInoutputVariables(); - - /** - * Parameter that is input and output of the operation. - * - * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables - * - * @param inoutputVariables desired value for the property inoutputVariables. - */ - void setInoutputVariables(List inoutputVariables); - /** * Input parameter of the operation. * @@ -86,4 +68,23 @@ public interface Operation extends SubmodelElement { */ void setOutputVariables(List outputVariables); + /** + * Parameter that is input and output of the operation. + * + * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables + * + * @return Returns the List of OperationVariables for the property inoutputVariables. + */ + @IRI("https://admin-shell.io/aas/3/0/Operation/inoutputVariables") + List getInoutputVariables(); + + /** + * Parameter that is input and output of the operation. + * + * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables + * + * @param inoutputVariables desired value for the property inoutputVariables. + */ + void setInoutputVariables(List inoutputVariables); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java index 7b5cf13d6..d62fa0440 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java index 13a195fb3..7df12e7ef 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -28,6 +29,25 @@ }) public interface Property extends DataElement { + /** + * Data type of the value + * + * More information under https://admin-shell.io/aas/3/0/Property/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/Property/valueType") + DataTypeDefXsd getValueType(); + + /** + * Data type of the value + * + * More information under https://admin-shell.io/aas/3/0/Property/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + /** * The value of the property instance. * @@ -50,39 +70,20 @@ public interface Property extends DataElement { /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Property/valueID + * More information under https://admin-shell.io/aas/3/0/Property/valueId * - * @return Returns the Reference for the property valueID. + * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/Property/valueID") - Reference getValueID(); + @IRI("https://admin-shell.io/aas/3/0/Property/valueId") + Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Property/valueID + * More information under https://admin-shell.io/aas/3/0/Property/valueId * - * @param valueID desired value for the property valueID. - */ - void setValueID(Reference valueID); - - /** - * Data type of the value - * - * More information under https://admin-shell.io/aas/3/0/Property/valueType - * - * @return Returns the DataTypeDefXSD for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/Property/valueType") - DataTypeDefXSD getValueType(); - - /** - * Data type of the value - * - * More information under https://admin-shell.io/aas/3/0/Property/valueType - * - * @param valueType desired value for the property valueType. + * @param valueId desired value for the property valueId. */ - void setValueType(DataTypeDefXSD valueType); + void setValueId(Reference valueId); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java index c7dcf966d..da02ca695 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java index d78e990a8..624d79ff3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -67,6 +68,25 @@ public interface Qualifier extends HasSemantics { */ void setType(String type); + /** + * Data type of the qualifier value. + * + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") + DataTypeDefXsd getValueType(); + + /** + * Data type of the qualifier value. + * + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + /** * The qualifier value is the value of the qualifier. * @@ -89,39 +109,20 @@ public interface Qualifier extends HasSemantics { /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueID + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueId * - * @return Returns the Reference for the property valueID. + * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueID") - Reference getValueID(); + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueId") + Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueID + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueId * - * @param valueID desired value for the property valueID. - */ - void setValueID(Reference valueID); - - /** - * Data type of the qualifier value. - * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType - * - * @return Returns the DataTypeDefXSD for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") - DataTypeDefXSD getValueType(); - - /** - * Data type of the qualifier value. - * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType - * - * @param valueType desired value for the property valueType. + * @param valueId desired value for the property valueId. */ - void setValueType(DataTypeDefXSD valueType); + void setValueId(Reference valueId); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java index 776c50f89..844a14308 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -26,7 +27,7 @@ public enum QualifierKind { /** - * qualifies the semantic definition the element is referring to ('semanticID') + * qualifies the semantic definition the element is referring to ('semanticId') */ @IRI("https://admin-shell.io/aas/3/0/QualifierKind/ConceptQualifier") CONCEPT_QUALIFIER, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java index c9d70b9eb..1ff17790c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,23 +30,23 @@ public interface Range extends DataElement { /** - * The maximum value of the range. + * Data type of the min und max * - * More information under https://admin-shell.io/aas/3/0/Range/max + * More information under https://admin-shell.io/aas/3/0/Range/valueType * - * @return Returns the String for the property max. + * @return Returns the DataTypeDefXsd for the property valueType. */ - @IRI("https://admin-shell.io/aas/3/0/Range/max") - String getMax(); + @IRI("https://admin-shell.io/aas/3/0/Range/valueType") + DataTypeDefXsd getValueType(); /** - * The maximum value of the range. + * Data type of the min und max * - * More information under https://admin-shell.io/aas/3/0/Range/max + * More information under https://admin-shell.io/aas/3/0/Range/valueType * - * @param max desired value for the property max. + * @param valueType desired value for the property valueType. */ - void setMax(String max); + void setValueType(DataTypeDefXsd valueType); /** * The minimum value of the range. @@ -67,22 +68,22 @@ public interface Range extends DataElement { void setMin(String min); /** - * Data type of the min und max + * The maximum value of the range. * - * More information under https://admin-shell.io/aas/3/0/Range/valueType + * More information under https://admin-shell.io/aas/3/0/Range/max * - * @return Returns the DataTypeDefXSD for the property valueType. + * @return Returns the String for the property max. */ - @IRI("https://admin-shell.io/aas/3/0/Range/valueType") - DataTypeDefXSD getValueType(); + @IRI("https://admin-shell.io/aas/3/0/Range/max") + String getMax(); /** - * Data type of the min und max + * The maximum value of the range. * - * More information under https://admin-shell.io/aas/3/0/Range/valueType + * More information under https://admin-shell.io/aas/3/0/Range/max * - * @param valueType desired value for the property valueType. + * @param max desired value for the property max. */ - void setValueType(DataTypeDefXSD valueType); + void setMax(String max); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java index b8a84a829..f85391a54 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -24,8 +25,8 @@ * An element that is referable by its 'idShort'. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = Identifiable.class), - @KnownSubtypes.Type(value = SubmodelElement.class) + @KnownSubtypes.Type(value = SubmodelElement.class), + @KnownSubtypes.Type(value = Identifiable.class) }) public interface Referable extends HasExtensions { @@ -51,62 +52,62 @@ public interface Referable extends HasExtensions { void setCategory(String category); /** - * Description or comments on the element. + * In case of identifiables this attribute is a short name of the element. In case of referable this + * ID is an identifying string of the element within its name space. * - * More information under https://admin-shell.io/aas/3/0/Referable/description + * More information under https://admin-shell.io/aas/3/0/Referable/idShort * - * @return Returns the List of LangStringTextTypes for the property description. + * @return Returns the String for the property idShort. */ - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - List getDescription(); + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + String getIdShort(); /** - * Description or comments on the element. + * In case of identifiables this attribute is a short name of the element. In case of referable this + * ID is an identifying string of the element within its name space. * - * More information under https://admin-shell.io/aas/3/0/Referable/description + * More information under https://admin-shell.io/aas/3/0/Referable/idShort * - * @param description desired value for the property description. + * @param idShort desired value for the property idShort. */ - void setDescription(List description); + void setIdShort(String idShort); /** * Display name. Can be provided in several languages. * * More information under https://admin-shell.io/aas/3/0/Referable/displayName * - * @return Returns the List of LangStringNameTypes for the property displayName. + * @return Returns the List of LangStringNameTypes for the property displayNames. */ @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - List getDisplayName(); + List getDisplayNames(); /** * Display name. Can be provided in several languages. * * More information under https://admin-shell.io/aas/3/0/Referable/displayName * - * @param displayName desired value for the property displayName. + * @param displayNames desired value for the property displayNames. */ - void setDisplayName(List displayName); + void setDisplayNames(List displayNames); /** - * In case of identifiables this attribute is a short name of the element. In case of referable this - * ID is an identifying string of the element within its name space. + * Description or comments on the element. * - * More information under https://admin-shell.io/aas/3/0/Referable/idShort + * More information under https://admin-shell.io/aas/3/0/Referable/description * - * @return Returns the String for the property idShort. + * @return Returns the List of LangStringTextTypes for the property descriptions. */ - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - String getIdShort(); + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + List getDescriptions(); /** - * In case of identifiables this attribute is a short name of the element. In case of referable this - * ID is an identifying string of the element within its name space. + * Description or comments on the element. * - * More information under https://admin-shell.io/aas/3/0/Referable/idShort + * More information under https://admin-shell.io/aas/3/0/Referable/description * - * @param idShort desired value for the property idShort. + * @param descriptions desired value for the property descriptions. */ - void setIdShort(String idShort); + void setDescriptions(List descriptions); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java index e338f7e63..2aa779da6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -30,60 +31,60 @@ public interface Reference { /** - * Unique references in their name space. + * Type of the reference. * - * More information under https://admin-shell.io/aas/3/0/Reference/keys + * More information under https://admin-shell.io/aas/3/0/Reference/type * - * @return Returns the List of Keys for the property keys. + * @return Returns the ReferenceTypes for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/Reference/keys") - List getKeys(); + @IRI("https://admin-shell.io/aas/3/0/Reference/type") + ReferenceTypes getType(); /** - * Unique references in their name space. + * Type of the reference. * - * More information under https://admin-shell.io/aas/3/0/Reference/keys + * More information under https://admin-shell.io/aas/3/0/Reference/type * - * @param keys desired value for the property keys. + * @param type desired value for the property type. */ - void setKeys(List keys); + void setType(ReferenceTypes type); /** - * 'semanticID' of the referenced model element ('type' = 'ModelReference'). + * 'semanticId' of the referenced model element ('type' = 'ModelReference'). * - * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticID + * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticId * - * @return Returns the Reference for the property referredSemanticID. + * @return Returns the Reference for the property referredSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticID") - Reference getReferredSemanticID(); + @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticId") + Reference getReferredSemanticId(); /** - * 'semanticID' of the referenced model element ('type' = 'ModelReference'). + * 'semanticId' of the referenced model element ('type' = 'ModelReference'). * - * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticID + * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticId * - * @param referredSemanticID desired value for the property referredSemanticID. + * @param referredSemanticId desired value for the property referredSemanticId. */ - void setReferredSemanticID(Reference referredSemanticID); + void setReferredSemanticId(Reference referredSemanticId); /** - * Type of the reference. + * Unique references in their name space. * - * More information under https://admin-shell.io/aas/3/0/Reference/type + * More information under https://admin-shell.io/aas/3/0/Reference/keys * - * @return Returns the ReferenceTypes for the property type. + * @return Returns the List of Keys for the property keys. */ - @IRI("https://admin-shell.io/aas/3/0/Reference/type") - ReferenceTypes getType(); + @IRI("https://admin-shell.io/aas/3/0/Reference/keys") + List getKeys(); /** - * Type of the reference. + * Unique references in their name space. * - * More information under https://admin-shell.io/aas/3/0/Reference/type + * More information under https://admin-shell.io/aas/3/0/Reference/keys * - * @param type desired value for the property type. + * @param keys desired value for the property keys. */ - void setType(ReferenceTypes type); + void setKeys(List keys); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java index f94d3b5f9..95fe8bd7e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java index 6182c32e0..305a50ee9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java index ab0b90430..4caefc472 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java index 78e144ece..5c01c0149 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -30,41 +31,41 @@ public interface Resource { /** - * Content type of the content of the file. + * Path and name of the resource (with file extension). * - * More information under https://admin-shell.io/aas/3/0/Resource/contentType + * More information under https://admin-shell.io/aas/3/0/Resource/path * - * @return Returns the String for the property contentType. + * @return Returns the String for the property path. */ - @IRI("https://admin-shell.io/aas/3/0/Resource/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/Resource/path") + String getPath(); /** - * Content type of the content of the file. + * Path and name of the resource (with file extension). * - * More information under https://admin-shell.io/aas/3/0/Resource/contentType + * More information under https://admin-shell.io/aas/3/0/Resource/path * - * @param contentType desired value for the property contentType. + * @param path desired value for the property path. */ - void setContentType(String contentType); + void setPath(String path); /** - * Path and name of the resource (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/Resource/path + * More information under https://admin-shell.io/aas/3/0/Resource/contentType * - * @return Returns the String for the property path. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/Resource/path") - String getPath(); + @IRI("https://admin-shell.io/aas/3/0/Resource/contentType") + String getContentType(); /** - * Path and name of the resource (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/Resource/path + * More information under https://admin-shell.io/aas/3/0/Resource/contentType * - * @param path desired value for the property path. + * @param contentType desired value for the property contentType. */ - void setPath(String path); + void setContentType(String contentType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetID.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetID.java deleted file mode 100644 index fd90bddd3..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetID.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetID; - - -/** - * A specific asset ID describes a generic supplementary identifying attribute of the asset. - */ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultSpecificAssetID.class) -}) -public interface SpecificAssetID extends HasSemantics { - - /** - * The (external) subject the key belongs to or has meaning to. - * - * More information under https://admin-shell.io/aas/3/0/SpecificAssetID/externalSubjectID - * - * @return Returns the Reference for the property externalSubjectID. - */ - @IRI("https://admin-shell.io/aas/3/0/SpecificAssetID/externalSubjectID") - Reference getExternalSubjectID(); - - /** - * The (external) subject the key belongs to or has meaning to. - * - * More information under https://admin-shell.io/aas/3/0/SpecificAssetID/externalSubjectID - * - * @param externalSubjectID desired value for the property externalSubjectID. - */ - void setExternalSubjectID(Reference externalSubjectID); - - /** - * Name of the identifier - * - * More information under https://admin-shell.io/aas/3/0/SpecificAssetID/name - * - * @return Returns the String for the property name. - */ - @IRI("https://admin-shell.io/aas/3/0/SpecificAssetID/name") - String getName(); - - /** - * Name of the identifier - * - * More information under https://admin-shell.io/aas/3/0/SpecificAssetID/name - * - * @param name desired value for the property name. - */ - void setName(String name); - - /** - * The value of the specific asset identifier with the corresponding name. - * - * More information under https://admin-shell.io/aas/3/0/SpecificAssetID/value - * - * @return Returns the String for the property value. - */ - @IRI("https://admin-shell.io/aas/3/0/SpecificAssetID/value") - String getValue(); - - /** - * The value of the specific asset identifier with the corresponding name. - * - * More information under https://admin-shell.io/aas/3/0/SpecificAssetID/value - * - * @param value desired value for the property value. - */ - void setValue(String value); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java index 67ec72fe8..c976edd7a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java index 132c85b2d..eeffb4150 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -27,7 +28,7 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultSubmodel.class) }) -public interface Submodel extends HasDataSpecification, Identifiable, HasSemantics, HasKind, Qualifiable { +public interface Submodel extends HasDataSpecification, HasKind, HasSemantics, Identifiable, Qualifiable { /** * A submodel consists of zero or more submodel elements. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java index 8e9f1af77..c18a4f6bb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -23,15 +24,15 @@ * A submodel element is an element suitable for the description and differentiation of assets. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = RelationshipElement.class), @KnownSubtypes.Type(value = DataElement.class), - @KnownSubtypes.Type(value = EventElement.class), @KnownSubtypes.Type(value = Capability.class), @KnownSubtypes.Type(value = Entity.class), + @KnownSubtypes.Type(value = EventElement.class), @KnownSubtypes.Type(value = Operation.class), + @KnownSubtypes.Type(value = RelationshipElement.class), @KnownSubtypes.Type(value = SubmodelElementCollection.class), @KnownSubtypes.Type(value = SubmodelElementList.class) }) -public interface SubmodelElement extends HasDataSpecification, HasSemantics, Referable, Qualifiable { +public interface SubmodelElement extends HasDataSpecification, HasSemantics, Qualifiable, Referable { } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java index ccfffd58b..67c357f26 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -18,7 +19,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import java.util.Collection; +import java.util.List; /** @@ -35,18 +36,18 @@ public interface SubmodelElementCollection extends SubmodelElement { * * More information under https://admin-shell.io/aas/3/0/SubmodelElementCollection/value * - * @return Returns the Collection of SubmodelElements for the property value. + * @return Returns the List of SubmodelElements for the property values. */ @IRI("https://admin-shell.io/aas/3/0/SubmodelElementCollection/value") - Collection getValue(); + List getValues(); /** * Submodel element contained in the collection. * * More information under https://admin-shell.io/aas/3/0/SubmodelElementCollection/value * - * @param value desired value for the property value. + * @param values desired value for the property values. */ - void setValue(Collection value); + void setValues(List values); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java index f83b4eb55..7d5895e6e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -53,31 +54,31 @@ public interface SubmodelElementList extends SubmodelElement { /** * Semantic ID the submodel elements contained in the list match to. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIDListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement * - * @return Returns the Reference for the property semanticIDListElement. + * @return Returns the Reference for the property semanticIdListElement. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIDListElement") - Reference getSemanticIDListElement(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement") + Reference getSemanticIdListElement(); /** * Semantic ID the submodel elements contained in the list match to. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIDListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement * - * @param semanticIDListElement desired value for the property semanticIDListElement. + * @param semanticIdListElement desired value for the property semanticIdListElement. */ - void setSemanticIDListElement(Reference semanticIDListElement); + void setSemanticIdListElement(Reference semanticIdListElement); /** * The submodel element type of the submodel elements contained in the list. * * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement * - * @return Returns the AASSubmodelElements for the property typeValueListElement. + * @return Returns the AasSubmodelElements for the property typeValueListElement. */ @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement") - AASSubmodelElements getTypeValueListElement(); + AasSubmodelElements getTypeValueListElement(); /** * The submodel element type of the submodel elements contained in the list. @@ -86,44 +87,44 @@ public interface SubmodelElementList extends SubmodelElement { * * @param typeValueListElement desired value for the property typeValueListElement. */ - void setTypeValueListElement(AASSubmodelElements typeValueListElement); + void setTypeValueListElement(AasSubmodelElements typeValueListElement); /** - * Submodel element contained in the list. + * The value type of the submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement * - * @return Returns the List of SubmodelElements for the property value. + * @return Returns the DataTypeDefXsd for the property valueTypeListElement. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") - List getValue(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") + DataTypeDefXsd getValueTypeListElement(); /** - * Submodel element contained in the list. + * The value type of the submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement * - * @param value desired value for the property value. + * @param valueTypeListElement desired value for the property valueTypeListElement. */ - void setValue(List value); + void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); /** - * The value type of the submodel element contained in the list. + * Submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value * - * @return Returns the DataTypeDefXSD for the property valueTypeListElement. + * @return Returns the List of SubmodelElements for the property values. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") - DataTypeDefXSD getValueTypeListElement(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") + List getValues(); /** - * The value type of the submodel element contained in the list. + * Submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value * - * @param valueTypeListElement desired value for the property valueTypeListElement. + * @param values desired value for the property values. */ - void setValueTypeListElement(DataTypeDefXSD valueTypeListElement); + void setValues(List values); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java index 3fa7f75ce..d5e66885c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java index 8b432070b..426ff7b51 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -30,7 +31,7 @@ public interface ValueReferencePair { /** - * The value of the referenced concept definition of the value in 'valueID'. + * The value of the referenced concept definition of the value in 'valueId'. * * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/value * @@ -40,7 +41,7 @@ public interface ValueReferencePair { String getValue(); /** - * The value of the referenced concept definition of the value in 'valueID'. + * The value of the referenced concept definition of the value in 'valueId'. * * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/value * @@ -51,20 +52,20 @@ public interface ValueReferencePair { /** * Global unique id of the value. * - * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueID + * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueId * - * @return Returns the Reference for the property valueID. + * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueID") - Reference getValueID(); + @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueId") + Reference getValueId(); /** * Global unique id of the value. * - * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueID + * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueId * - * @param valueID desired value for the property valueID. + * @param valueId desired value for the property valueId. */ - void setValueID(Reference valueID); + void setValueId(Reference valueId); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java index a16de81f0..3a6ada117 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java index 14a7ca309..b7e0c47c4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java index 283f216a7..519f45bdb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java index 25ccb9399..88fefd0bc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -25,13 +26,13 @@ public abstract class AdministrativeInformationBuilder { /** - * This function allows setting a value for creator + * This function allows setting a value for version * - * @param creator desired value to be set - * @return Builder object with new value for creator + * @param version desired value to be set + * @return Builder object with new value for version */ - public B creator(Reference creator) { - getBuildingInstance().setCreator(creator); + public B version(String version) { + getBuildingInstance().setVersion(version); return getSelf(); } @@ -47,24 +48,24 @@ public B revision(String revision) { } /** - * This function allows setting a value for templateID + * This function allows setting a value for creator * - * @param templateID desired value to be set - * @return Builder object with new value for templateID + * @param creator desired value to be set + * @return Builder object with new value for creator */ - public B templateID(String templateID) { - getBuildingInstance().setTemplateID(templateID); + public B creator(Reference creator) { + getBuildingInstance().setCreator(creator); return getSelf(); } /** - * This function allows setting a value for version + * This function allows setting a value for templateId * - * @param version desired value to be set - * @return Builder object with new value for version + * @param templateId desired value to be set + * @return Builder object with new value for templateId */ - public B version(String version) { - getBuildingInstance().setVersion(version); + public B templateId(String templateId) { + getBuildingInstance().setTemplateId(templateId); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java index 663bd819f..6dd02e7d3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -89,13 +90,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -121,6 +122,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -133,57 +156,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -208,26 +231,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java index 45b103666..2015b9c28 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -23,24 +24,24 @@ public abstract class AssetAdministrationShellBuilder { /** - * This function allows setting a value for assetInformation + * This function allows setting a value for derivedFrom * - * @param assetInformation desired value to be set - * @return Builder object with new value for assetInformation + * @param derivedFrom desired value to be set + * @return Builder object with new value for derivedFrom */ - public B assetInformation(AssetInformation assetInformation) { - getBuildingInstance().setAssetInformation(assetInformation); + public B derivedFrom(Reference derivedFrom) { + getBuildingInstance().setDerivedFrom(derivedFrom); return getSelf(); } /** - * This function allows setting a value for derivedFrom + * This function allows setting a value for assetInformation * - * @param derivedFrom desired value to be set - * @return Builder object with new value for derivedFrom + * @param assetInformation desired value to be set + * @return Builder object with new value for assetInformation */ - public B derivedFrom(Reference derivedFrom) { - getBuildingInstance().setDerivedFrom(derivedFrom); + public B assetInformation(AssetInformation assetInformation) { + getBuildingInstance().setAssetInformation(assetInformation); return getSelf(); } @@ -122,57 +123,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java index cb3798301..3794191d6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -17,7 +18,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import java.util.List; @@ -37,57 +38,57 @@ public B assetKind(AssetKind assetKind) { } /** - * This function allows setting a value for assetType + * This function allows setting a value for globalAssetId * - * @param assetType desired value to be set - * @return Builder object with new value for assetType + * @param globalAssetId desired value to be set + * @return Builder object with new value for globalAssetId */ - public B assetType(String assetType) { - getBuildingInstance().setAssetType(assetType); + public B globalAssetId(String globalAssetId) { + getBuildingInstance().setGlobalAssetId(globalAssetId); return getSelf(); } /** - * This function allows setting a value for defaultThumbnail + * This function allows setting a value for specificAssetIds * - * @param defaultThumbnail desired value to be set - * @return Builder object with new value for defaultThumbnail + * @param specificAssetIds desired value to be set + * @return Builder object with new value for specificAssetIds */ - public B defaultThumbnail(Resource defaultThumbnail) { - getBuildingInstance().setDefaultThumbnail(defaultThumbnail); + public B specificAssetIds(List specificAssetIds) { + getBuildingInstance().setSpecificAssetIds(specificAssetIds); return getSelf(); } /** - * This function allows setting a value for globalAssetID + * This function allows adding a value to the List specificAssetIds * - * @param globalAssetID desired value to be set - * @return Builder object with new value for globalAssetID + * @param specificAssetIds desired value to be added + * @return Builder object with new value for specificAssetIds */ - public B globalAssetID(String globalAssetID) { - getBuildingInstance().setGlobalAssetID(globalAssetID); + public B specificAssetIds(SpecificAssetId specificAssetIds) { + getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); return getSelf(); } /** - * This function allows setting a value for specificAssetIds + * This function allows setting a value for assetType * - * @param specificAssetIds desired value to be set - * @return Builder object with new value for specificAssetIds + * @param assetType desired value to be set + * @return Builder object with new value for assetType */ - public B specificAssetIds(List specificAssetIds) { - getBuildingInstance().setSpecificAssetIds(specificAssetIds); + public B assetType(String assetType) { + getBuildingInstance().setAssetType(assetType); return getSelf(); } /** - * This function allows adding a value to the List specificAssetIds + * This function allows setting a value for defaultThumbnail * - * @param specificAssetIds desired value to be added - * @return Builder object with new value for specificAssetIds + * @param defaultThumbnail desired value to be set + * @return Builder object with new value for defaultThumbnail */ - public B specificAssetIds(SpecificAssetID specificAssetIds) { - getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); + public B defaultThumbnail(Resource defaultThumbnail) { + getBuildingInstance().setDefaultThumbnail(defaultThumbnail); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java index 01edbf0a3..353bf806d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,6 +23,17 @@ public abstract class BasicEventElementBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for observed + * + * @param observed desired value to be set + * @return Builder object with new value for observed + */ + public B observed(Reference observed) { + getBuildingInstance().setObserved(observed); + return getSelf(); + } + /** * This function allows setting a value for direction * @@ -34,24 +46,24 @@ public B direction(Direction direction) { } /** - * This function allows setting a value for lastUpdate + * This function allows setting a value for state * - * @param lastUpdate desired value to be set - * @return Builder object with new value for lastUpdate + * @param state desired value to be set + * @return Builder object with new value for state */ - public B lastUpdate(String lastUpdate) { - getBuildingInstance().setLastUpdate(lastUpdate); + public B state(StateOfEvent state) { + getBuildingInstance().setState(state); return getSelf(); } /** - * This function allows setting a value for maxInterval + * This function allows setting a value for messageTopic * - * @param maxInterval desired value to be set - * @return Builder object with new value for maxInterval + * @param messageTopic desired value to be set + * @return Builder object with new value for messageTopic */ - public B maxInterval(String maxInterval) { - getBuildingInstance().setMaxInterval(maxInterval); + public B messageTopic(String messageTopic) { + getBuildingInstance().setMessageTopic(messageTopic); return getSelf(); } @@ -67,13 +79,13 @@ public B messageBroker(Reference messageBroker) { } /** - * This function allows setting a value for messageTopic + * This function allows setting a value for lastUpdate * - * @param messageTopic desired value to be set - * @return Builder object with new value for messageTopic + * @param lastUpdate desired value to be set + * @return Builder object with new value for lastUpdate */ - public B messageTopic(String messageTopic) { - getBuildingInstance().setMessageTopic(messageTopic); + public B lastUpdate(String lastUpdate) { + getBuildingInstance().setLastUpdate(lastUpdate); return getSelf(); } @@ -89,24 +101,13 @@ public B minInterval(String minInterval) { } /** - * This function allows setting a value for observed - * - * @param observed desired value to be set - * @return Builder object with new value for observed - */ - public B observed(Reference observed) { - getBuildingInstance().setObserved(observed); - return getSelf(); - } - - /** - * This function allows setting a value for state + * This function allows setting a value for maxInterval * - * @param state desired value to be set - * @return Builder object with new value for state + * @param maxInterval desired value to be set + * @return Builder object with new value for maxInterval */ - public B state(StateOfEvent state) { - getBuildingInstance().setState(state); + public B maxInterval(String maxInterval) { + getBuildingInstance().setMaxInterval(maxInterval); return getSelf(); } @@ -133,13 +134,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -165,6 +166,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -177,57 +200,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -252,26 +275,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java index 43f20de00..b59c42e61 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,24 +23,24 @@ public abstract class BlobBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for contentType + * This function allows setting a value for value * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param value desired value to be set + * @return Builder object with new value for value */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B value(byte[] value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for value + * This function allows setting a value for contentType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B value(byte[] value) { - getBuildingInstance().setValue(value); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } @@ -66,13 +67,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -98,6 +99,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -110,57 +133,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -185,26 +208,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java index 7e27dad1f..ce013e25b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java index f62d73756..9fd0aea26 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -44,13 +45,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -76,6 +77,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -88,57 +111,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -163,26 +186,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java index 65e871bb3..590b49285 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -23,24 +24,24 @@ public abstract class ConceptDescriptionBuilder { /** - * This function allows setting a value for isCaseOf + * This function allows setting a value for isCaseOfs * - * @param isCaseOf desired value to be set - * @return Builder object with new value for isCaseOf + * @param isCaseOfs desired value to be set + * @return Builder object with new value for isCaseOfs */ - public B isCaseOf(List isCaseOf) { - getBuildingInstance().setIsCaseOf(isCaseOf); + public B isCaseOfs(List isCaseOfs) { + getBuildingInstance().setIsCaseOfs(isCaseOfs); return getSelf(); } /** - * This function allows adding a value to the List isCaseOf + * This function allows adding a value to the List isCaseOfs * * @param isCaseOf desired value to be added - * @return Builder object with new value for isCaseOf + * @return Builder object with new value for isCaseOfs */ public B isCaseOf(Reference isCaseOf) { - getBuildingInstance().getIsCaseOf().add(isCaseOf); + getBuildingInstance().getIsCaseOfs().add(isCaseOf); return getSelf(); } @@ -100,57 +101,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java index d02d832fe..dab3a6b43 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -23,90 +24,68 @@ public abstract class DataSpecificationIec61360Builder { /** - * This function allows setting a value for dataType + * This function allows setting a value for preferredNames * - * @param dataType desired value to be set - * @return Builder object with new value for dataType + * @param preferredNames desired value to be set + * @return Builder object with new value for preferredNames */ - public B dataType(DataTypeIec61360 dataType) { - getBuildingInstance().setDataType(dataType); - return getSelf(); - } - - /** - * This function allows setting a value for definition - * - * @param definition desired value to be set - * @return Builder object with new value for definition - */ - public B definition(List definition) { - getBuildingInstance().setDefinition(definition); - return getSelf(); - } - - /** - * This function allows adding a value to the List definition - * - * @param definition desired value to be added - * @return Builder object with new value for definition - */ - public B definition(LangStringDefinitionTypeIec61360 definition) { - getBuildingInstance().getDefinition().add(definition); + public B preferredNames(List preferredNames) { + getBuildingInstance().setPreferredNames(preferredNames); return getSelf(); } /** - * This function allows setting a value for levelType + * This function allows adding a value to the List preferredNames * - * @param levelType desired value to be set - * @return Builder object with new value for levelType + * @param preferredName desired value to be added + * @return Builder object with new value for preferredNames */ - public B levelType(LevelType levelType) { - getBuildingInstance().setLevelType(levelType); + public B preferredName(LangStringPreferredNameTypeIec61360 preferredName) { + getBuildingInstance().getPreferredNames().add(preferredName); return getSelf(); } /** - * This function allows setting a value for preferredName + * This function allows setting a value for shortNames * - * @param preferredName desired value to be set - * @return Builder object with new value for preferredName + * @param shortNames desired value to be set + * @return Builder object with new value for shortNames */ - public B preferredName(List preferredName) { - getBuildingInstance().setPreferredName(preferredName); + public B shortNames(List shortNames) { + getBuildingInstance().setShortNames(shortNames); return getSelf(); } /** - * This function allows adding a value to the List preferredName + * This function allows adding a value to the List shortNames * - * @param preferredName desired value to be added - * @return Builder object with new value for preferredName + * @param shortName desired value to be added + * @return Builder object with new value for shortNames */ - public B preferredName(LangStringPreferredNameTypeIec61360 preferredName) { - getBuildingInstance().getPreferredName().add(preferredName); + public B shortName(LangStringShortNameTypeIec61360 shortName) { + getBuildingInstance().getShortNames().add(shortName); return getSelf(); } /** - * This function allows setting a value for shortName + * This function allows setting a value for unit * - * @param shortName desired value to be set - * @return Builder object with new value for shortName + * @param unit desired value to be set + * @return Builder object with new value for unit */ - public B shortName(List shortName) { - getBuildingInstance().setShortName(shortName); + public B unit(String unit) { + getBuildingInstance().setUnit(unit); return getSelf(); } /** - * This function allows adding a value to the List shortName + * This function allows setting a value for unitId * - * @param shortName desired value to be added - * @return Builder object with new value for shortName + * @param unitId desired value to be set + * @return Builder object with new value for unitId */ - public B shortName(LangStringShortNameTypeIec61360 shortName) { - getBuildingInstance().getShortName().add(shortName); + public B unitId(Reference unitId) { + getBuildingInstance().setUnitId(unitId); return getSelf(); } @@ -133,35 +112,35 @@ public B symbol(String symbol) { } /** - * This function allows setting a value for unit + * This function allows setting a value for dataType * - * @param unit desired value to be set - * @return Builder object with new value for unit + * @param dataType desired value to be set + * @return Builder object with new value for dataType */ - public B unit(String unit) { - getBuildingInstance().setUnit(unit); + public B dataType(DataTypeIec61360 dataType) { + getBuildingInstance().setDataType(dataType); return getSelf(); } /** - * This function allows setting a value for unitID + * This function allows setting a value for definitions * - * @param unitID desired value to be set - * @return Builder object with new value for unitID + * @param definitions desired value to be set + * @return Builder object with new value for definitions */ - public B unitID(Reference unitID) { - getBuildingInstance().setUnitID(unitID); + public B definitions(List definitions) { + getBuildingInstance().setDefinitions(definitions); return getSelf(); } /** - * This function allows setting a value for value + * This function allows adding a value to the List definitions * - * @param value desired value to be set - * @return Builder object with new value for value + * @param definition desired value to be added + * @return Builder object with new value for definitions */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B definition(LangStringDefinitionTypeIec61360 definition) { + getBuildingInstance().getDefinitions().add(definition); return getSelf(); } @@ -187,4 +166,26 @@ public B valueList(ValueList valueList) { return getSelf(); } + /** + * This function allows setting a value for value + * + * @param value desired value to be set + * @return Builder object with new value for value + */ + public B value(String value) { + getBuildingInstance().setValue(value); + return getSelf(); + } + + /** + * This function allows setting a value for levelType + * + * @param levelType desired value to be set + * @return Builder object with new value for levelType + */ + public B levelType(LevelType levelType) { + getBuildingInstance().setLevelType(levelType); + return getSelf(); + } + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java index f88b3561e..583f538af 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java index 92e516e17..616dad950 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -21,6 +22,28 @@ public abstract class EntityBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for statements + * + * @param statements desired value to be set + * @return Builder object with new value for statements + */ + public B statements(List statements) { + getBuildingInstance().setStatements(statements); + return getSelf(); + } + + /** + * This function allows adding a value to the List statements + * + * @param statements desired value to be added + * @return Builder object with new value for statements + */ + public B statements(SubmodelElement statements) { + getBuildingInstance().getStatements().add(statements); + return getSelf(); + } + /** * This function allows setting a value for entityType * @@ -33,13 +56,13 @@ public B entityType(EntityType entityType) { } /** - * This function allows setting a value for globalAssetID + * This function allows setting a value for globalAssetId * - * @param globalAssetID desired value to be set - * @return Builder object with new value for globalAssetID + * @param globalAssetId desired value to be set + * @return Builder object with new value for globalAssetId */ - public B globalAssetID(String globalAssetID) { - getBuildingInstance().setGlobalAssetID(globalAssetID); + public B globalAssetId(String globalAssetId) { + getBuildingInstance().setGlobalAssetId(globalAssetId); return getSelf(); } @@ -49,7 +72,7 @@ public B globalAssetID(String globalAssetID) { * @param specificAssetIds desired value to be set * @return Builder object with new value for specificAssetIds */ - public B specificAssetIds(List specificAssetIds) { + public B specificAssetIds(List specificAssetIds) { getBuildingInstance().setSpecificAssetIds(specificAssetIds); return getSelf(); } @@ -60,33 +83,11 @@ public B specificAssetIds(List specificAssetIds) { * @param specificAssetIds desired value to be added * @return Builder object with new value for specificAssetIds */ - public B specificAssetIds(SpecificAssetID specificAssetIds) { + public B specificAssetIds(SpecificAssetId specificAssetIds) { getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); return getSelf(); } - /** - * This function allows setting a value for statements - * - * @param statements desired value to be set - * @return Builder object with new value for statements - */ - public B statements(List statements) { - getBuildingInstance().setStatements(statements); - return getSelf(); - } - - /** - * This function allows adding a value to the List statements - * - * @param statements desired value to be added - * @return Builder object with new value for statements - */ - public B statements(SubmodelElement statements) { - getBuildingInstance().getStatements().add(statements); - return getSelf(); - } - /** * This function allows setting a value for embeddedDataSpecifications * @@ -110,13 +111,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -142,6 +143,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -154,57 +177,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -229,26 +252,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java index d33b72b90..633cf775c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -47,46 +48,46 @@ public B assetAdministrationShells(AssetAdministrationShell assetAdministrationS } /** - * This function allows setting a value for conceptDescriptions + * This function allows setting a value for submodels * - * @param conceptDescriptions desired value to be set - * @return Builder object with new value for conceptDescriptions + * @param submodels desired value to be set + * @return Builder object with new value for submodels */ - public B conceptDescriptions(List conceptDescriptions) { - getBuildingInstance().setConceptDescriptions(conceptDescriptions); + public B submodels(List submodels) { + getBuildingInstance().setSubmodels(submodels); return getSelf(); } /** - * This function allows adding a value to the List conceptDescriptions + * This function allows adding a value to the List submodels * - * @param conceptDescriptions desired value to be added - * @return Builder object with new value for conceptDescriptions + * @param submodels desired value to be added + * @return Builder object with new value for submodels */ - public B conceptDescriptions(ConceptDescription conceptDescriptions) { - getBuildingInstance().getConceptDescriptions().add(conceptDescriptions); + public B submodels(Submodel submodels) { + getBuildingInstance().getSubmodels().add(submodels); return getSelf(); } /** - * This function allows setting a value for submodels + * This function allows setting a value for conceptDescriptions * - * @param submodels desired value to be set - * @return Builder object with new value for submodels + * @param conceptDescriptions desired value to be set + * @return Builder object with new value for conceptDescriptions */ - public B submodels(List submodels) { - getBuildingInstance().setSubmodels(submodels); + public B conceptDescriptions(List conceptDescriptions) { + getBuildingInstance().setConceptDescriptions(conceptDescriptions); return getSelf(); } /** - * This function allows adding a value to the List submodels + * This function allows adding a value to the List conceptDescriptions * - * @param submodels desired value to be added - * @return Builder object with new value for submodels + * @param conceptDescriptions desired value to be added + * @return Builder object with new value for conceptDescriptions */ - public B submodels(Submodel submodels) { - getBuildingInstance().getSubmodels().add(submodels); + public B conceptDescriptions(ConceptDescription conceptDescriptions) { + getBuildingInstance().getConceptDescriptions().add(conceptDescriptions); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java index d00833379..6aeaad75b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,68 +23,68 @@ public abstract class EventPayloadBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for observableReference + * This function allows setting a value for source * - * @param observableReference desired value to be set - * @return Builder object with new value for observableReference + * @param source desired value to be set + * @return Builder object with new value for source */ - public B observableReference(Reference observableReference) { - getBuildingInstance().setObservableReference(observableReference); + public B source(Reference source) { + getBuildingInstance().setSource(source); return getSelf(); } /** - * This function allows setting a value for observableSemanticID + * This function allows setting a value for sourceSemanticId * - * @param observableSemanticID desired value to be set - * @return Builder object with new value for observableSemanticID + * @param sourceSemanticId desired value to be set + * @return Builder object with new value for sourceSemanticId */ - public B observableSemanticID(Reference observableSemanticID) { - getBuildingInstance().setObservableSemanticID(observableSemanticID); + public B sourceSemanticId(Reference sourceSemanticId) { + getBuildingInstance().setSourceSemanticId(sourceSemanticId); return getSelf(); } /** - * This function allows setting a value for payload + * This function allows setting a value for observableReference * - * @param payload desired value to be set - * @return Builder object with new value for payload + * @param observableReference desired value to be set + * @return Builder object with new value for observableReference */ - public B payload(byte[] payload) { - getBuildingInstance().setPayload(payload); + public B observableReference(Reference observableReference) { + getBuildingInstance().setObservableReference(observableReference); return getSelf(); } /** - * This function allows setting a value for source + * This function allows setting a value for observableSemanticId * - * @param source desired value to be set - * @return Builder object with new value for source + * @param observableSemanticId desired value to be set + * @return Builder object with new value for observableSemanticId */ - public B source(Reference source) { - getBuildingInstance().setSource(source); + public B observableSemanticId(Reference observableSemanticId) { + getBuildingInstance().setObservableSemanticId(observableSemanticId); return getSelf(); } /** - * This function allows setting a value for sourceSemanticID + * This function allows setting a value for topic * - * @param sourceSemanticID desired value to be set - * @return Builder object with new value for sourceSemanticID + * @param topic desired value to be set + * @return Builder object with new value for topic */ - public B sourceSemanticID(Reference sourceSemanticID) { - getBuildingInstance().setSourceSemanticID(sourceSemanticID); + public B topic(String topic) { + getBuildingInstance().setTopic(topic); return getSelf(); } /** - * This function allows setting a value for subjectID + * This function allows setting a value for subjectId * - * @param subjectID desired value to be set - * @return Builder object with new value for subjectID + * @param subjectId desired value to be set + * @return Builder object with new value for subjectId */ - public B subjectID(Reference subjectID) { - getBuildingInstance().setSubjectID(subjectID); + public B subjectId(Reference subjectId) { + getBuildingInstance().setSubjectId(subjectId); return getSelf(); } @@ -99,13 +100,13 @@ public B timeStamp(String timeStamp) { } /** - * This function allows setting a value for topic + * This function allows setting a value for payload * - * @param topic desired value to be set - * @return Builder object with new value for topic + * @param payload desired value to be set + * @return Builder object with new value for payload */ - public B topic(String topic) { - getBuildingInstance().setTopic(topic); + public B payload(byte[] payload) { + getBuildingInstance().setPayload(payload); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java index 57cf35007..801912796 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java index bff2490ca..0ec24c7d3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,7 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Extension; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -35,57 +36,57 @@ public B name(String name) { } /** - * This function allows setting a value for refersTo + * This function allows setting a value for valueType * - * @param refersTo desired value to be set - * @return Builder object with new value for refersTo + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B refersTo(List refersTo) { - getBuildingInstance().setRefersTo(refersTo); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } /** - * This function allows adding a value to the List refersTo + * This function allows setting a value for value * - * @param refersTo desired value to be added - * @return Builder object with new value for refersTo + * @param value desired value to be set + * @return Builder object with new value for value */ - public B refersTo(Reference refersTo) { - getBuildingInstance().getRefersTo().add(refersTo); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for value + * This function allows setting a value for refersTos * - * @param value desired value to be set - * @return Builder object with new value for value + * @param refersTos desired value to be set + * @return Builder object with new value for refersTos */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B refersTos(List refersTos) { + getBuildingInstance().setRefersTos(refersTos); return getSelf(); } /** - * This function allows setting a value for valueType + * This function allows adding a value to the List refersTos * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param refersTo desired value to be added + * @return Builder object with new value for refersTos */ - public B valueType(DataTypeDefXSD valueType) { - getBuildingInstance().setValueType(valueType); + public B refersTo(Reference refersTo) { + getBuildingInstance().getRefersTos().add(refersTo); return getSelf(); } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java index 347317d65..fd6722b88 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,24 +23,24 @@ public abstract class FileBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for contentType + * This function allows setting a value for value * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param value desired value to be set + * @return Builder object with new value for value */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for value + * This function allows setting a value for contentType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } @@ -66,13 +67,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -98,6 +99,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -110,57 +133,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -185,26 +208,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java index f04e9a96c..1b9ca58d6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java index 29b8d3f92..1cde475ec 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java index 8b541147d..daf8ebf61 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java index dedd6c541..ad320aab3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java index 697ef25fc..c15ba46bd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java index b84b045d8..5ce64c49e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java index 48246a400..4e763ab8d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -20,17 +21,6 @@ public abstract class LevelTypeBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for max - * - * @param max desired value to be set - * @return Builder object with new value for max - */ - public B max(boolean max) { - getBuildingInstance().setMax(max); - return getSelf(); - } - /** * This function allows setting a value for min * @@ -63,4 +53,15 @@ public B typ(boolean typ) { getBuildingInstance().setTyp(typ); return getSelf(); } + + /** + * This function allows setting a value for max + * + * @param max desired value to be set + * @return Builder object with new value for max + */ + public B max(boolean max) { + getBuildingInstance().setMax(max); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java index ac14d8c29..d5b2c1905 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -23,35 +24,35 @@ public abstract class MultiLanguagePropertyBuilder { /** - * This function allows setting a value for value + * This function allows setting a value for values * - * @param value desired value to be set - * @return Builder object with new value for value + * @param values desired value to be set + * @return Builder object with new value for values */ - public B value(List value) { - getBuildingInstance().setValue(value); + public B values(List values) { + getBuildingInstance().setValues(values); return getSelf(); } /** - * This function allows adding a value to the List value + * This function allows adding a value to the List values * * @param value desired value to be added - * @return Builder object with new value for value + * @return Builder object with new value for values */ public B value(LangStringTextType value) { - getBuildingInstance().getValue().add(value); + getBuildingInstance().getValues().add(value); return getSelf(); } /** - * This function allows setting a value for valueID + * This function allows setting a value for valueId * - * @param valueID desired value to be set - * @return Builder object with new value for valueID + * @param valueId desired value to be set + * @return Builder object with new value for valueId */ - public B valueID(Reference valueID) { - getBuildingInstance().setValueID(valueID); + public B valueId(Reference valueId) { + getBuildingInstance().setValueId(valueId); return getSelf(); } @@ -78,13 +79,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -110,6 +111,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -122,57 +145,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -197,26 +220,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java index 767c3bd8e..bcec85472 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -21,28 +22,6 @@ public abstract class OperationBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for inoutputVariables - * - * @param inoutputVariables desired value to be set - * @return Builder object with new value for inoutputVariables - */ - public B inoutputVariables(List inoutputVariables) { - getBuildingInstance().setInoutputVariables(inoutputVariables); - return getSelf(); - } - - /** - * This function allows adding a value to the List inoutputVariables - * - * @param inoutputVariables desired value to be added - * @return Builder object with new value for inoutputVariables - */ - public B inoutputVariables(OperationVariable inoutputVariables) { - getBuildingInstance().getInoutputVariables().add(inoutputVariables); - return getSelf(); - } - /** * This function allows setting a value for inputVariables * @@ -87,6 +66,28 @@ public B outputVariables(OperationVariable outputVariables) { return getSelf(); } + /** + * This function allows setting a value for inoutputVariables + * + * @param inoutputVariables desired value to be set + * @return Builder object with new value for inoutputVariables + */ + public B inoutputVariables(List inoutputVariables) { + getBuildingInstance().setInoutputVariables(inoutputVariables); + return getSelf(); + } + + /** + * This function allows adding a value to the List inoutputVariables + * + * @param inoutputVariables desired value to be added + * @return Builder object with new value for inoutputVariables + */ + public B inoutputVariables(OperationVariable inoutputVariables) { + getBuildingInstance().getInoutputVariables().add(inoutputVariables); + return getSelf(); + } + /** * This function allows setting a value for embeddedDataSpecifications * @@ -110,13 +111,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -142,6 +143,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -154,57 +177,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -229,26 +252,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java index 790ee3960..6f429d8d8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java index 234ebf561..0bd67baa7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,35 +23,35 @@ public abstract class PropertyBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for value + * This function allows setting a value for valueType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } /** - * This function allows setting a value for valueID + * This function allows setting a value for value * - * @param valueID desired value to be set - * @return Builder object with new value for valueID + * @param value desired value to be set + * @return Builder object with new value for value */ - public B valueID(Reference valueID) { - getBuildingInstance().setValueID(valueID); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for valueType + * This function allows setting a value for valueId * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param valueId desired value to be set + * @return Builder object with new value for valueId */ - public B valueType(DataTypeDefXSD valueType) { - getBuildingInstance().setValueType(valueType); + public B valueId(Reference valueId) { + getBuildingInstance().setValueId(valueId); return getSelf(); } @@ -77,13 +78,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -109,6 +110,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -121,57 +144,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -196,26 +219,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java index ed8646d44..4eeb6a010 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,7 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -47,46 +48,46 @@ public B type(String type) { } /** - * This function allows setting a value for value + * This function allows setting a value for valueType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } /** - * This function allows setting a value for valueID + * This function allows setting a value for value * - * @param valueID desired value to be set - * @return Builder object with new value for valueID + * @param value desired value to be set + * @return Builder object with new value for value */ - public B valueID(Reference valueID) { - getBuildingInstance().setValueID(valueID); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for valueType + * This function allows setting a value for valueId * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param valueId desired value to be set + * @return Builder object with new value for valueId */ - public B valueType(DataTypeDefXSD valueType) { - getBuildingInstance().setValueType(valueType); + public B valueId(Reference valueId) { + getBuildingInstance().setValueId(valueId); return getSelf(); } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java index f265d1700..1bf999673 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,13 +23,13 @@ public abstract class RangeBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for max + * This function allows setting a value for valueType * - * @param max desired value to be set - * @return Builder object with new value for max + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B max(String max) { - getBuildingInstance().setMax(max); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } @@ -44,13 +45,13 @@ public B min(String min) { } /** - * This function allows setting a value for valueType + * This function allows setting a value for max * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param max desired value to be set + * @return Builder object with new value for max */ - public B valueType(DataTypeDefXSD valueType) { - getBuildingInstance().setValueType(valueType); + public B max(String max) { + getBuildingInstance().setMax(max); return getSelf(); } @@ -77,13 +78,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -109,6 +110,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -121,57 +144,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -196,26 +219,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java index 734afc5dc..3142190f5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -24,46 +25,46 @@ public abstract class ReferenceBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for keys + * This function allows setting a value for type * - * @param keys desired value to be set - * @return Builder object with new value for keys + * @param type desired value to be set + * @return Builder object with new value for type */ - public B keys(List keys) { - getBuildingInstance().setKeys(keys); + public B type(ReferenceTypes type) { + getBuildingInstance().setType(type); return getSelf(); } /** - * This function allows adding a value to the List keys + * This function allows setting a value for referredSemanticId * - * @param keys desired value to be added - * @return Builder object with new value for keys + * @param referredSemanticId desired value to be set + * @return Builder object with new value for referredSemanticId */ - public B keys(Key keys) { - getBuildingInstance().getKeys().add(keys); + public B referredSemanticId(Reference referredSemanticId) { + getBuildingInstance().setReferredSemanticId(referredSemanticId); return getSelf(); } /** - * This function allows setting a value for referredSemanticID + * This function allows setting a value for keys * - * @param referredSemanticID desired value to be set - * @return Builder object with new value for referredSemanticID + * @param keys desired value to be set + * @return Builder object with new value for keys */ - public B referredSemanticID(Reference referredSemanticID) { - getBuildingInstance().setReferredSemanticID(referredSemanticID); + public B keys(List keys) { + getBuildingInstance().setKeys(keys); return getSelf(); } /** - * This function allows setting a value for type + * This function allows adding a value to the List keys * - * @param type desired value to be set - * @return Builder object with new value for type + * @param keys desired value to be added + * @return Builder object with new value for keys */ - public B type(ReferenceTypes type) { - getBuildingInstance().setType(type); + public B keys(Key keys) { + getBuildingInstance().getKeys().add(keys); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java index 35af6b641..cf3587b09 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -56,13 +57,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -88,6 +89,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -100,57 +123,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -175,26 +198,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java index 40079a339..ee8ffa434 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -67,13 +68,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -99,6 +100,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -111,57 +134,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -186,26 +209,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java index 94a8f727e..f7c03b676 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -21,24 +22,24 @@ public abstract class ResourceBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for contentType + * This function allows setting a value for path * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param path desired value to be set + * @return Builder object with new value for path */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B path(String path) { + getBuildingInstance().setPath(path); return getSelf(); } /** - * This function allows setting a value for path + * This function allows setting a value for contentType * - * @param path desired value to be set - * @return Builder object with new value for path + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B path(String path) { - getBuildingInstance().setPath(path); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIDBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIDBuilder.java deleted file mode 100644 index 4db2e0991..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIDBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; - -import java.util.List; - - -public abstract class SpecificAssetIDBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for externalSubjectID - * - * @param externalSubjectID desired value to be set - * @return Builder object with new value for externalSubjectID - */ - public B externalSubjectID(Reference externalSubjectID) { - getBuildingInstance().setExternalSubjectID(externalSubjectID); - return getSelf(); - } - - /** - * This function allows setting a value for name - * - * @param name desired value to be set - * @return Builder object with new value for name - */ - public B name(String name) { - getBuildingInstance().setName(name); - return getSelf(); - } - - /** - * This function allows setting a value for value - * - * @param value desired value to be set - * @return Builder object with new value for value - */ - public B value(String value) { - getBuildingInstance().setValue(value); - return getSelf(); - } - - /** - * This function allows setting a value for semanticID - * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID - */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java index 583367d60..c8fff70dc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -66,79 +67,79 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for administration + * This function allows setting a value for kind * - * @param administration desired value to be set - * @return Builder object with new value for administration + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B administration(AdministrativeInformation administration) { - getBuildingInstance().setAdministration(administration); + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows setting a value for id + * This function allows setting a value for semanticId * - * @param id desired value to be set - * @return Builder object with new value for id + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B id(String id) { - getBuildingInstance().setId(id); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for supplementalSemanticIds * - * @param category desired value to be set - * @return Builder object with new value for category + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); return getSelf(); } /** - * This function allows setting a value for description + * This function allows adding a value to the List supplementalSemanticIds * - * @param description desired value to be set - * @return Builder object with new value for description + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for administration * - * @param description desired value to be added - * @return Builder object with new value for description + * @param administration desired value to be set + * @return Builder object with new value for administration */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows setting a value for id * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param id desired value to be set + * @return Builder object with new value for id */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B id(String id) { + getBuildingInstance().setId(id); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for category * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param category desired value to be set + * @return Builder object with new value for category */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } @@ -154,68 +155,68 @@ public B idShort(String idShort) { } /** - * This function allows setting a value for extensions + * This function allows setting a value for displayNames * - * @param extensions desired value to be set - * @return Builder object with new value for extensions + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows adding a value to the List extensions + * This function allows adding a value to the List displayNames * - * @param extensions desired value to be added - * @return Builder object with new value for extensions + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows setting a value for semanticID + * This function allows setting a value for descriptions * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for supplementalSemanticIds + * This function allows adding a value to the List descriptions * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } /** - * This function allows adding a value to the List supplementalSemanticIds + * This function allows setting a value for extensions * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds + * @param extensions desired value to be set + * @return Builder object with new value for extensions */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); return getSelf(); } /** - * This function allows setting a value for kind + * This function allows adding a value to the List extensions * - * @param kind desired value to be set - * @return Builder object with new value for kind + * @param extensions desired value to be added + * @return Builder object with new value for extensions */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java index 44b318ea5..7a97d7a7f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -16,7 +17,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.*; -import java.util.Collection; import java.util.List; @@ -24,24 +24,24 @@ public abstract class SubmodelElementCollectionBuilder { /** - * This function allows setting a value for value + * This function allows setting a value for values * - * @param value desired value to be set - * @return Builder object with new value for value + * @param values desired value to be set + * @return Builder object with new value for values */ - public B value(Collection value) { - getBuildingInstance().setValue(value); + public B values(List values) { + getBuildingInstance().setValues(values); return getSelf(); } /** - * This function allows adding a value to the List value + * This function allows adding a value to the List values * * @param value desired value to be added - * @return Builder object with new value for value + * @return Builder object with new value for values */ public B value(SubmodelElement value) { - getBuildingInstance().getValue().add(value); + getBuildingInstance().getValues().add(value); return getSelf(); } @@ -68,13 +68,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -100,6 +100,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -112,57 +134,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -187,26 +209,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java index c81241e0a..a346c19ef 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -34,13 +35,13 @@ public B orderRelevant(boolean orderRelevant) { } /** - * This function allows setting a value for semanticIDListElement + * This function allows setting a value for semanticIdListElement * - * @param semanticIDListElement desired value to be set - * @return Builder object with new value for semanticIDListElement + * @param semanticIdListElement desired value to be set + * @return Builder object with new value for semanticIdListElement */ - public B semanticIDListElement(Reference semanticIDListElement) { - getBuildingInstance().setSemanticIDListElement(semanticIDListElement); + public B semanticIdListElement(Reference semanticIdListElement) { + getBuildingInstance().setSemanticIdListElement(semanticIdListElement); return getSelf(); } @@ -50,41 +51,41 @@ public B semanticIDListElement(Reference semanticIDListElement) { * @param typeValueListElement desired value to be set * @return Builder object with new value for typeValueListElement */ - public B typeValueListElement(AASSubmodelElements typeValueListElement) { + public B typeValueListElement(AasSubmodelElements typeValueListElement) { getBuildingInstance().setTypeValueListElement(typeValueListElement); return getSelf(); } /** - * This function allows setting a value for value + * This function allows setting a value for valueTypeListElement * - * @param value desired value to be set - * @return Builder object with new value for value + * @param valueTypeListElement desired value to be set + * @return Builder object with new value for valueTypeListElement */ - public B value(List value) { - getBuildingInstance().setValue(value); + public B valueTypeListElement(DataTypeDefXsd valueTypeListElement) { + getBuildingInstance().setValueTypeListElement(valueTypeListElement); return getSelf(); } /** - * This function allows adding a value to the List value + * This function allows setting a value for values * - * @param value desired value to be added - * @return Builder object with new value for value + * @param values desired value to be set + * @return Builder object with new value for values */ - public B value(SubmodelElement value) { - getBuildingInstance().getValue().add(value); + public B values(List values) { + getBuildingInstance().setValues(values); return getSelf(); } /** - * This function allows setting a value for valueTypeListElement + * This function allows adding a value to the List values * - * @param valueTypeListElement desired value to be set - * @return Builder object with new value for valueTypeListElement + * @param value desired value to be added + * @return Builder object with new value for values */ - public B valueTypeListElement(DataTypeDefXSD valueTypeListElement) { - getBuildingInstance().setValueTypeListElement(valueTypeListElement); + public B value(SubmodelElement value) { + getBuildingInstance().getValues().add(value); return getSelf(); } @@ -111,13 +112,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -143,6 +144,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -155,57 +178,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -230,26 +253,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java index 3cc977501..524a25820 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java index a3589053e..bd24f1053 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -34,13 +35,13 @@ public B value(String value) { } /** - * This function allows setting a value for valueID + * This function allows setting a value for valueId * - * @param valueID desired value to be set - * @return Builder object with new value for valueID + * @param valueId desired value to be set + * @return Builder object with new value for valueId */ - public B valueID(Reference valueID) { - getBuildingInstance().setValueID(valueID); + public B valueId(Reference valueId) { + getBuildingInstance().setValueId(valueId); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java index 236a00239..dd9bbe22e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -41,8 +42,8 @@ public class DefaultAdministrativeInformation implements AdministrativeInformati @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/revision") protected String revision; - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateID") - protected String templateID; + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId") + protected String templateId; @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") protected String version; @@ -50,16 +51,14 @@ public class DefaultAdministrativeInformation implements AdministrativeInformati @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - public DefaultAdministrativeInformation() { - - } + public DefaultAdministrativeInformation() {} @Override public int hashCode() { - return Objects.hash(this.creator, + return Objects.hash(this.version, this.revision, - this.templateID, - this.version, + this.creator, + this.templateId, this.embeddedDataSpecifications); } @@ -73,22 +72,22 @@ public boolean equals(Object obj) { return false; } else { DefaultAdministrativeInformation other = (DefaultAdministrativeInformation) obj; - return Objects.equals(this.creator, other.creator) && + return Objects.equals(this.version, other.version) && Objects.equals(this.revision, other.revision) && - Objects.equals(this.templateID, other.templateID) && - Objects.equals(this.version, other.version) && + Objects.equals(this.creator, other.creator) && + Objects.equals(this.templateId, other.templateId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); } } @Override - public Reference getCreator() { - return creator; + public String getVersion() { + return version; } @Override - public void setCreator(Reference creator) { - this.creator = creator; + public void setVersion(String version) { + this.version = version; } @Override @@ -102,23 +101,23 @@ public void setRevision(String revision) { } @Override - public String getTemplateID() { - return templateID; + public Reference getCreator() { + return creator; } @Override - public void setTemplateID(String templateID) { - this.templateID = templateID; + public void setCreator(Reference creator) { + this.creator = creator; } @Override - public String getVersion() { - return version; + public String getTemplateId() { + return templateId; } @Override - public void setVersion(String version) { - this.version = version; + public void setTemplateId(String templateId) { + this.templateId = templateId; } @Override @@ -131,6 +130,16 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } + public String toString() { + return String.format( + "DefaultAdministrativeInformation (" + "version=%s," + + "revision=%s," + + "creator=%s," + + "templateId=%s," + + ")", + this.version, this.revision, this.creator, this.templateId); + } + /** * This builder class can be used to construct a DefaultAdministrativeInformation bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java index 722d4ab26..8a4f964a8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -43,8 +44,8 @@ public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshi @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -56,10 +57,10 @@ public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshi protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; @@ -70,9 +71,7 @@ public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshi @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") protected Reference second; - public DefaultAnnotatedRelationshipElement() { - - } + public DefaultAnnotatedRelationshipElement() {} @Override public int hashCode() { @@ -80,14 +79,14 @@ public int hashCode() { this.first, this.second, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -104,14 +103,14 @@ public boolean equals(Object obj) { Objects.equals(this.first, other.first) && Objects.equals(this.second, other.second) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @@ -156,13 +155,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -175,6 +174,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -186,33 +195,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -225,14 +234,11 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultAnnotatedRelationshipElement (" + "annotations=%s," + + ")", + this.annotations); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java index f9d5a7d03..13bc5b590 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,21 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetAdministrationShellBuilder; + import java.util.ArrayList; import java.util.List; import java.util.Objects; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetAdministrationShellBuilder; - /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell @@ -64,29 +58,28 @@ public class DefaultAssetAdministrationShell implements AssetAdministrationShell protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultAssetAdministrationShell() { - } + public DefaultAssetAdministrationShell() {} @Override public int hashCode() { - return Objects.hash(this.assetInformation, - this.derivedFrom, + return Objects.hash(this.derivedFrom, + this.assetInformation, this.submodels, this.embeddedDataSpecifications, this.administration, this.id, this.category, - this.description, - this.displayName, this.idShort, + this.displayNames, + this.descriptions, this.extensions); } @@ -100,38 +93,38 @@ public boolean equals(Object obj) { return false; } else { DefaultAssetAdministrationShell other = (DefaultAssetAdministrationShell) obj; - return Objects.equals(this.assetInformation, other.assetInformation) && - Objects.equals(this.derivedFrom, other.derivedFrom) && + return Objects.equals(this.derivedFrom, other.derivedFrom) && + Objects.equals(this.assetInformation, other.assetInformation) && Objects.equals(this.submodels, other.submodels) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && Objects.equals(this.extensions, other.extensions); } } @Override - public AssetInformation getAssetInformation() { - return assetInformation; + public Reference getDerivedFrom() { + return derivedFrom; } @Override - public void setAssetInformation(AssetInformation assetInformation) { - this.assetInformation = assetInformation; + public void setDerivedFrom(Reference derivedFrom) { + this.derivedFrom = derivedFrom; } @Override - public Reference getDerivedFrom() { - return derivedFrom; + public AssetInformation getAssetInformation() { + return assetInformation; } @Override - public void setDerivedFrom(Reference derivedFrom) { - this.derivedFrom = derivedFrom; + public void setAssetInformation(AssetInformation assetInformation) { + this.assetInformation = assetInformation; } @Override @@ -185,33 +178,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -224,6 +217,15 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + public String toString() { + return String.format( + "DefaultAssetAdministrationShell (" + "derivedFrom=%s," + + "assetInformation=%s," + + "submodels=%s," + + ")", + this.derivedFrom, this.assetInformation, this.submodels); + } + /** * This builder class can be used to construct a DefaultAssetAdministrationShell bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java index ade88005b..eaaeff408 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -17,7 +18,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetInformationBuilder; @@ -45,23 +46,21 @@ public class DefaultAssetInformation implements AssetInformation { @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") protected Resource defaultThumbnail; - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetID") - protected String globalAssetID; + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId") + protected String globalAssetId; @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") - protected List specificAssetIds = new ArrayList<>(); + protected List specificAssetIds = new ArrayList<>(); - public DefaultAssetInformation() { - - } + public DefaultAssetInformation() {} @Override public int hashCode() { return Objects.hash(this.assetKind, + this.globalAssetId, + this.specificAssetIds, this.assetType, - this.defaultThumbnail, - this.globalAssetID, - this.specificAssetIds); + this.defaultThumbnail); } @Override @@ -75,10 +74,10 @@ public boolean equals(Object obj) { } else { DefaultAssetInformation other = (DefaultAssetInformation) obj; return Objects.equals(this.assetKind, other.assetKind) && + Objects.equals(this.globalAssetId, other.globalAssetId) && + Objects.equals(this.specificAssetIds, other.specificAssetIds) && Objects.equals(this.assetType, other.assetType) && - Objects.equals(this.defaultThumbnail, other.defaultThumbnail) && - Objects.equals(this.globalAssetID, other.globalAssetID) && - Objects.equals(this.specificAssetIds, other.specificAssetIds); + Objects.equals(this.defaultThumbnail, other.defaultThumbnail); } } @@ -93,43 +92,54 @@ public void setAssetKind(AssetKind assetKind) { } @Override - public String getAssetType() { - return assetType; + public String getGlobalAssetId() { + return globalAssetId; } @Override - public void setAssetType(String assetType) { - this.assetType = assetType; + public void setGlobalAssetId(String globalAssetId) { + this.globalAssetId = globalAssetId; } @Override - public Resource getDefaultThumbnail() { - return defaultThumbnail; + public List getSpecificAssetIds() { + return specificAssetIds; } @Override - public void setDefaultThumbnail(Resource defaultThumbnail) { - this.defaultThumbnail = defaultThumbnail; + public void setSpecificAssetIds(List specificAssetIds) { + this.specificAssetIds = specificAssetIds; } @Override - public String getGlobalAssetID() { - return globalAssetID; + public String getAssetType() { + return assetType; } @Override - public void setGlobalAssetID(String globalAssetID) { - this.globalAssetID = globalAssetID; + public void setAssetType(String assetType) { + this.assetType = assetType; } @Override - public List getSpecificAssetIds() { - return specificAssetIds; + public Resource getDefaultThumbnail() { + return defaultThumbnail; } @Override - public void setSpecificAssetIds(List specificAssetIds) { - this.specificAssetIds = specificAssetIds; + public void setDefaultThumbnail(Resource defaultThumbnail) { + this.defaultThumbnail = defaultThumbnail; + } + + public String toString() { + return String.format( + "DefaultAssetInformation (" + "assetKind=%s," + + "globalAssetId=%s," + + "specificAssetIds=%s," + + "assetType=%s," + + "defaultThumbnail=%s," + + ")", + this.assetKind, this.globalAssetId, this.specificAssetIds, this.assetType, this.defaultThumbnail); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java index 035a2c7b0..d7fda6b91 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -62,8 +63,8 @@ public class DefaultBasicEventElement implements BasicEventElement { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -75,37 +76,35 @@ public class DefaultBasicEventElement implements BasicEventElement { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultBasicEventElement() { - - } + public DefaultBasicEventElement() {} @Override public int hashCode() { - return Objects.hash(this.direction, - this.lastUpdate, - this.maxInterval, - this.messageBroker, + return Objects.hash(this.observed, + this.direction, + this.state, this.messageTopic, + this.messageBroker, + this.lastUpdate, this.minInterval, - this.observed, - this.state, + this.maxInterval, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -118,26 +117,36 @@ public boolean equals(Object obj) { return false; } else { DefaultBasicEventElement other = (DefaultBasicEventElement) obj; - return Objects.equals(this.direction, other.direction) && - Objects.equals(this.lastUpdate, other.lastUpdate) && - Objects.equals(this.maxInterval, other.maxInterval) && - Objects.equals(this.messageBroker, other.messageBroker) && + return Objects.equals(this.observed, other.observed) && + Objects.equals(this.direction, other.direction) && + Objects.equals(this.state, other.state) && Objects.equals(this.messageTopic, other.messageTopic) && + Objects.equals(this.messageBroker, other.messageBroker) && + Objects.equals(this.lastUpdate, other.lastUpdate) && Objects.equals(this.minInterval, other.minInterval) && - Objects.equals(this.observed, other.observed) && - Objects.equals(this.state, other.state) && + Objects.equals(this.maxInterval, other.maxInterval) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } + @Override + public Reference getObserved() { + return observed; + } + + @Override + public void setObserved(Reference observed) { + this.observed = observed; + } + @Override public Direction getDirection() { return direction; @@ -149,23 +158,23 @@ public void setDirection(Direction direction) { } @Override - public String getLastUpdate() { - return lastUpdate; + public StateOfEvent getState() { + return state; } @Override - public void setLastUpdate(String lastUpdate) { - this.lastUpdate = lastUpdate; + public void setState(StateOfEvent state) { + this.state = state; } @Override - public String getMaxInterval() { - return maxInterval; + public String getMessageTopic() { + return messageTopic; } @Override - public void setMaxInterval(String maxInterval) { - this.maxInterval = maxInterval; + public void setMessageTopic(String messageTopic) { + this.messageTopic = messageTopic; } @Override @@ -179,13 +188,13 @@ public void setMessageBroker(Reference messageBroker) { } @Override - public String getMessageTopic() { - return messageTopic; + public String getLastUpdate() { + return lastUpdate; } @Override - public void setMessageTopic(String messageTopic) { - this.messageTopic = messageTopic; + public void setLastUpdate(String lastUpdate) { + this.lastUpdate = lastUpdate; } @Override @@ -199,23 +208,13 @@ public void setMinInterval(String minInterval) { } @Override - public Reference getObserved() { - return observed; - } - - @Override - public void setObserved(Reference observed) { - this.observed = observed; - } - - @Override - public StateOfEvent getState() { - return state; + public String getMaxInterval() { + return maxInterval; } @Override - public void setState(StateOfEvent state) { - this.state = state; + public void setMaxInterval(String maxInterval) { + this.maxInterval = maxInterval; } @Override @@ -229,13 +228,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -248,6 +247,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -259,33 +268,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -298,14 +307,19 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultBasicEventElement (" + "observed=%s," + + "direction=%s," + + "state=%s," + + "messageTopic=%s," + + "messageBroker=%s," + + "lastUpdate=%s," + + "minInterval=%s," + + "maxInterval=%s," + + ")", + this.observed, this.direction, this.state, this.messageTopic, this.messageBroker, this.lastUpdate, this.minInterval, + this.maxInterval); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index bcb565022..7bf8f2a70 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -46,8 +47,8 @@ public class DefaultBlob implements Blob { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -59,31 +60,29 @@ public class DefaultBlob implements Blob { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultBlob() { - - } + public DefaultBlob() {} @Override public int hashCode() { - return Objects.hash(this.contentType, - Arrays.hashCode(this.value), + return Objects.hash(Arrays.hashCode(this.value), + this.contentType, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -96,38 +95,38 @@ public boolean equals(Object obj) { return false; } else { DefaultBlob other = (DefaultBlob) obj; - return Objects.equals(this.contentType, other.contentType) && - Arrays.equals(this.value, other.value) && + return Arrays.equals(this.value, other.value) && + Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getContentType() { - return contentType; + public byte[] getValue() { + return value; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setValue(byte[] value) { + this.value = value; } @Override - public byte[] getValue() { - return value; + public String getContentType() { + return contentType; } @Override - public void setValue(byte[] value) { - this.value = value; + public void setContentType(String contentType) { + this.contentType = contentType; } @Override @@ -141,13 +140,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -160,6 +159,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -171,33 +180,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -210,14 +219,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultBlob (" + "value=%s," + + "contentType=%s," + + ")", + this.value, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java index 77c89e298..4f7a63e40 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -39,8 +40,8 @@ public class DefaultCapability implements Capability { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -52,29 +53,27 @@ public class DefaultCapability implements Capability { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultCapability() { - - } + public DefaultCapability() {} @Override public int hashCode() { return Objects.hash(this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -88,14 +87,14 @@ public boolean equals(Object obj) { } else { DefaultCapability other = (DefaultCapability) obj; return Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @@ -110,13 +109,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -129,6 +128,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -140,33 +149,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -179,14 +188,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } + public String toString() { + return String.format( + "DefaultCapability (" + + ")" - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + ); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java index 558778b24..62a5cb678 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -34,7 +35,7 @@ public class DefaultConceptDescription implements ConceptDescription { @IRI("https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf") - protected List isCaseOf = new ArrayList<>(); + protected List isCaseOfs = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); @@ -52,28 +53,26 @@ public class DefaultConceptDescription implements ConceptDescription { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultConceptDescription() { - - } + public DefaultConceptDescription() {} @Override public int hashCode() { - return Objects.hash(this.isCaseOf, + return Objects.hash(this.isCaseOfs, this.embeddedDataSpecifications, this.administration, this.id, this.category, - this.description, - this.displayName, this.idShort, + this.displayNames, + this.descriptions, this.extensions); } @@ -87,26 +86,26 @@ public boolean equals(Object obj) { return false; } else { DefaultConceptDescription other = (DefaultConceptDescription) obj; - return Objects.equals(this.isCaseOf, other.isCaseOf) && + return Objects.equals(this.isCaseOfs, other.isCaseOfs) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && Objects.equals(this.extensions, other.extensions); } } @Override - public List getIsCaseOf() { - return isCaseOf; + public List getIsCaseOfs() { + return isCaseOfs; } @Override - public void setIsCaseOf(List isCaseOf) { - this.isCaseOf = isCaseOf; + public void setIsCaseOfs(List isCaseOfs) { + this.isCaseOfs = isCaseOfs; } @Override @@ -150,33 +149,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -189,6 +188,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + public String toString() { + return String.format( + "DefaultConceptDescription (" + "isCaseOfs=%s," + + ")", + this.isCaseOfs); + } + /** * This builder class can be used to construct a DefaultConceptDescription bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java index 168d88f21..799f3cee9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -31,63 +32,61 @@ * lists conformant to IEC 61360. */ -@IRI("aas:DataSpecificationIEC61360") +@IRI("aas:DataSpecificationIec61360") public class DefaultDataSpecificationIec61360 implements DataSpecificationIec61360 { - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/dataType") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType") protected DataTypeIec61360 dataType; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/definition") - protected List definition = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition") + protected List definitions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/levelType") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType") protected LevelType levelType; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/preferredName") - protected List preferredName = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName") + protected List preferredNames = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/shortName") - protected List shortName = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName") + protected List shortNames = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition") protected String sourceOfDefinition; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol") protected String symbol; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/unit") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit") protected String unit; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/unitID") - protected Reference unitID; + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId") + protected Reference unitId; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/value") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat") protected String valueFormat; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList") protected ValueList valueList; - public DefaultDataSpecificationIec61360() { - - } + public DefaultDataSpecificationIec61360() {} @Override public int hashCode() { - return Objects.hash(this.dataType, - this.definition, - this.levelType, - this.preferredName, - this.shortName, + return Objects.hash(this.preferredNames, + this.shortNames, + this.unit, + this.unitId, this.sourceOfDefinition, this.symbol, - this.unit, - this.unitID, - this.value, + this.dataType, + this.definitions, this.valueFormat, - this.valueList); + this.valueList, + this.value, + this.levelType); } @Override @@ -100,69 +99,59 @@ public boolean equals(Object obj) { return false; } else { DefaultDataSpecificationIec61360 other = (DefaultDataSpecificationIec61360) obj; - return Objects.equals(this.dataType, other.dataType) && - Objects.equals(this.definition, other.definition) && - Objects.equals(this.levelType, other.levelType) && - Objects.equals(this.preferredName, other.preferredName) && - Objects.equals(this.shortName, other.shortName) && + return Objects.equals(this.preferredNames, other.preferredNames) && + Objects.equals(this.shortNames, other.shortNames) && + Objects.equals(this.unit, other.unit) && + Objects.equals(this.unitId, other.unitId) && Objects.equals(this.sourceOfDefinition, other.sourceOfDefinition) && Objects.equals(this.symbol, other.symbol) && - Objects.equals(this.unit, other.unit) && - Objects.equals(this.unitID, other.unitID) && - Objects.equals(this.value, other.value) && + Objects.equals(this.dataType, other.dataType) && + Objects.equals(this.definitions, other.definitions) && Objects.equals(this.valueFormat, other.valueFormat) && - Objects.equals(this.valueList, other.valueList); + Objects.equals(this.valueList, other.valueList) && + Objects.equals(this.value, other.value) && + Objects.equals(this.levelType, other.levelType); } } @Override - public DataTypeIec61360 getDataType() { - return dataType; - } - - @Override - public void setDataType(DataTypeIec61360 dataType) { - this.dataType = dataType; - } - - @Override - public List getDefinition() { - return definition; + public List getPreferredNames() { + return preferredNames; } @Override - public void setDefinition(List definition) { - this.definition = definition; + public void setPreferredNames(List preferredNames) { + this.preferredNames = preferredNames; } @Override - public LevelType getLevelType() { - return levelType; + public List getShortNames() { + return shortNames; } @Override - public void setLevelType(LevelType levelType) { - this.levelType = levelType; + public void setShortNames(List shortNames) { + this.shortNames = shortNames; } @Override - public List getPreferredName() { - return preferredName; + public String getUnit() { + return unit; } @Override - public void setPreferredName(List preferredName) { - this.preferredName = preferredName; + public void setUnit(String unit) { + this.unit = unit; } @Override - public List getShortName() { - return shortName; + public Reference getUnitId() { + return unitId; } @Override - public void setShortName(List shortName) { - this.shortName = shortName; + public void setUnitId(Reference unitId) { + this.unitId = unitId; } @Override @@ -186,33 +175,23 @@ public void setSymbol(String symbol) { } @Override - public String getUnit() { - return unit; - } - - @Override - public void setUnit(String unit) { - this.unit = unit; - } - - @Override - public Reference getUnitID() { - return unitID; + public DataTypeIec61360 getDataType() { + return dataType; } @Override - public void setUnitID(Reference unitID) { - this.unitID = unitID; + public void setDataType(DataTypeIec61360 dataType) { + this.dataType = dataType; } @Override - public String getValue() { - return value; + public List getDefinitions() { + return definitions; } @Override - public void setValue(String value) { - this.value = value; + public void setDefinitions(List definitions) { + this.definitions = definitions; } @Override @@ -235,6 +214,45 @@ public void setValueList(ValueList valueList) { this.valueList = valueList; } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + + @Override + public LevelType getLevelType() { + return levelType; + } + + @Override + public void setLevelType(LevelType levelType) { + this.levelType = levelType; + } + + public String toString() { + return String.format( + "DefaultDataSpecificationIec61360 (" + "preferredNames=%s," + + "shortNames=%s," + + "unit=%s," + + "unitId=%s," + + "sourceOfDefinition=%s," + + "symbol=%s," + + "dataType=%s," + + "definitions=%s," + + "valueFormat=%s," + + "valueList=%s," + + "value=%s," + + "levelType=%s," + + ")", + this.preferredNames, this.shortNames, this.unit, this.unitId, this.sourceOfDefinition, this.symbol, this.dataType, + this.definitions, this.valueFormat, this.valueList, this.value, this.levelType); + } + /** * This builder class can be used to construct a DefaultDataSpecificationIec61360 bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java index 4d3135579..093108949 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -39,9 +40,7 @@ public class DefaultEmbeddedDataSpecification implements EmbeddedDataSpecificati @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent") protected DataSpecificationContent dataSpecificationContent; - public DefaultEmbeddedDataSpecification() { - - } + public DefaultEmbeddedDataSpecification() {} @Override public int hashCode() { @@ -84,6 +83,14 @@ public void setDataSpecificationContent(DataSpecificationContent dataSpecificati this.dataSpecificationContent = dataSpecificationContent; } + public String toString() { + return String.format( + "DefaultEmbeddedDataSpecification (" + "dataSpecification=%s," + + "dataSpecificationContent=%s," + + ")", + this.dataSpecification, this.dataSpecificationContent); + } + /** * This builder class can be used to construct a DefaultEmbeddedDataSpecification bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java index e3a75f9a8..f049cb13f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -35,11 +36,11 @@ public class DefaultEntity implements Entity { @IRI("https://admin-shell.io/aas/3/0/Entity/entityType") protected EntityType entityType; - @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetID") - protected String globalAssetID; + @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetId") + protected String globalAssetId; @IRI("https://admin-shell.io/aas/3/0/Entity/specificAssetIds") - protected List specificAssetIds = new ArrayList<>(); + protected List specificAssetIds = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Entity/statements") protected List statements = new ArrayList<>(); @@ -50,8 +51,8 @@ public class DefaultEntity implements Entity { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -63,33 +64,31 @@ public class DefaultEntity implements Entity { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultEntity() { - - } + public DefaultEntity() {} @Override public int hashCode() { - return Objects.hash(this.entityType, - this.globalAssetID, + return Objects.hash(this.statements, + this.entityType, + this.globalAssetId, this.specificAssetIds, - this.statements, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -102,60 +101,60 @@ public boolean equals(Object obj) { return false; } else { DefaultEntity other = (DefaultEntity) obj; - return Objects.equals(this.entityType, other.entityType) && - Objects.equals(this.globalAssetID, other.globalAssetID) && + return Objects.equals(this.statements, other.statements) && + Objects.equals(this.entityType, other.entityType) && + Objects.equals(this.globalAssetId, other.globalAssetId) && Objects.equals(this.specificAssetIds, other.specificAssetIds) && - Objects.equals(this.statements, other.statements) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public EntityType getEntityType() { - return entityType; + public List getStatements() { + return statements; } @Override - public void setEntityType(EntityType entityType) { - this.entityType = entityType; + public void setStatements(List statements) { + this.statements = statements; } @Override - public String getGlobalAssetID() { - return globalAssetID; + public EntityType getEntityType() { + return entityType; } @Override - public void setGlobalAssetID(String globalAssetID) { - this.globalAssetID = globalAssetID; + public void setEntityType(EntityType entityType) { + this.entityType = entityType; } @Override - public List getSpecificAssetIds() { - return specificAssetIds; + public String getGlobalAssetId() { + return globalAssetId; } @Override - public void setSpecificAssetIds(List specificAssetIds) { - this.specificAssetIds = specificAssetIds; + public void setGlobalAssetId(String globalAssetId) { + this.globalAssetId = globalAssetId; } @Override - public List getStatements() { - return statements; + public List getSpecificAssetIds() { + return specificAssetIds; } @Override - public void setStatements(List statements) { - this.statements = statements; + public void setSpecificAssetIds(List specificAssetIds) { + this.specificAssetIds = specificAssetIds; } @Override @@ -169,13 +168,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -188,6 +187,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -199,33 +208,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -238,14 +247,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultEntity (" + "statements=%s," + + "entityType=%s," + + "globalAssetId=%s," + + "specificAssetIds=%s," + + ")", + this.statements, this.entityType, this.globalAssetId, this.specificAssetIds); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java index ae4b92b96..53367b728 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -44,15 +45,13 @@ public class DefaultEnvironment implements Environment { @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") protected List submodels = new ArrayList<>(); - public DefaultEnvironment() { - - } + public DefaultEnvironment() {} @Override public int hashCode() { return Objects.hash(this.assetAdministrationShells, - this.conceptDescriptions, - this.submodels); + this.submodels, + this.conceptDescriptions); } @Override @@ -66,8 +65,8 @@ public boolean equals(Object obj) { } else { DefaultEnvironment other = (DefaultEnvironment) obj; return Objects.equals(this.assetAdministrationShells, other.assetAdministrationShells) && - Objects.equals(this.conceptDescriptions, other.conceptDescriptions) && - Objects.equals(this.submodels, other.submodels); + Objects.equals(this.submodels, other.submodels) && + Objects.equals(this.conceptDescriptions, other.conceptDescriptions); } } @@ -82,23 +81,32 @@ public void setAssetAdministrationShells(List assetAdm } @Override - public List getConceptDescriptions() { - return conceptDescriptions; + public List getSubmodels() { + return submodels; } @Override - public void setConceptDescriptions(List conceptDescriptions) { - this.conceptDescriptions = conceptDescriptions; + public void setSubmodels(List submodels) { + this.submodels = submodels; } @Override - public List getSubmodels() { - return submodels; + public List getConceptDescriptions() { + return conceptDescriptions; } @Override - public void setSubmodels(List submodels) { - this.submodels = submodels; + public void setConceptDescriptions(List conceptDescriptions) { + this.conceptDescriptions = conceptDescriptions; + } + + public String toString() { + return String.format( + "DefaultEnvironment (" + "assetAdministrationShells=%s," + + "submodels=%s," + + "conceptDescriptions=%s," + + ")", + this.assetAdministrationShells, this.submodels, this.conceptDescriptions); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java index b775a8922..49453f922 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -35,8 +36,8 @@ public class DefaultEventPayload implements EventPayload { @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") protected Reference observableReference; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticID") - protected Reference observableSemanticID; + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId") + protected Reference observableSemanticId; @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") protected byte[] payload; @@ -44,11 +45,11 @@ public class DefaultEventPayload implements EventPayload { @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") protected Reference source; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticID") - protected Reference sourceSemanticID; + @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId") + protected Reference sourceSemanticId; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectID") - protected Reference subjectID; + @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectId") + protected Reference subjectId; @IRI("https://admin-shell.io/aas/3/0/EventPayload/timeStamp") protected String timeStamp; @@ -56,20 +57,18 @@ public class DefaultEventPayload implements EventPayload { @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") protected String topic; - public DefaultEventPayload() { - - } + public DefaultEventPayload() {} @Override public int hashCode() { - return Objects.hash(this.observableReference, - this.observableSemanticID, - Arrays.hashCode(this.payload), - this.source, - this.sourceSemanticID, - this.subjectID, + return Objects.hash(this.source, + this.sourceSemanticId, + this.observableReference, + this.observableSemanticId, + this.topic, + this.subjectId, this.timeStamp, - this.topic); + Arrays.hashCode(this.payload)); } @Override @@ -82,75 +81,75 @@ public boolean equals(Object obj) { return false; } else { DefaultEventPayload other = (DefaultEventPayload) obj; - return Objects.equals(this.observableReference, other.observableReference) && - Objects.equals(this.observableSemanticID, other.observableSemanticID) && - Arrays.equals(this.payload, other.payload) && - Objects.equals(this.source, other.source) && - Objects.equals(this.sourceSemanticID, other.sourceSemanticID) && - Objects.equals(this.subjectID, other.subjectID) && + return Objects.equals(this.source, other.source) && + Objects.equals(this.sourceSemanticId, other.sourceSemanticId) && + Objects.equals(this.observableReference, other.observableReference) && + Objects.equals(this.observableSemanticId, other.observableSemanticId) && + Objects.equals(this.topic, other.topic) && + Objects.equals(this.subjectId, other.subjectId) && Objects.equals(this.timeStamp, other.timeStamp) && - Objects.equals(this.topic, other.topic); + Arrays.equals(this.payload, other.payload); } } @Override - public Reference getObservableReference() { - return observableReference; + public Reference getSource() { + return source; } @Override - public void setObservableReference(Reference observableReference) { - this.observableReference = observableReference; + public void setSource(Reference source) { + this.source = source; } @Override - public Reference getObservableSemanticID() { - return observableSemanticID; + public Reference getSourceSemanticId() { + return sourceSemanticId; } @Override - public void setObservableSemanticID(Reference observableSemanticID) { - this.observableSemanticID = observableSemanticID; + public void setSourceSemanticId(Reference sourceSemanticId) { + this.sourceSemanticId = sourceSemanticId; } @Override - public byte[] getPayload() { - return payload; + public Reference getObservableReference() { + return observableReference; } @Override - public void setPayload(byte[] payload) { - this.payload = payload; + public void setObservableReference(Reference observableReference) { + this.observableReference = observableReference; } @Override - public Reference getSource() { - return source; + public Reference getObservableSemanticId() { + return observableSemanticId; } @Override - public void setSource(Reference source) { - this.source = source; + public void setObservableSemanticId(Reference observableSemanticId) { + this.observableSemanticId = observableSemanticId; } @Override - public Reference getSourceSemanticID() { - return sourceSemanticID; + public String getTopic() { + return topic; } @Override - public void setSourceSemanticID(Reference sourceSemanticID) { - this.sourceSemanticID = sourceSemanticID; + public void setTopic(String topic) { + this.topic = topic; } @Override - public Reference getSubjectID() { - return subjectID; + public Reference getSubjectId() { + return subjectId; } @Override - public void setSubjectID(Reference subjectID) { - this.subjectID = subjectID; + public void setSubjectId(Reference subjectId) { + this.subjectId = subjectId; } @Override @@ -164,13 +163,28 @@ public void setTimeStamp(String timeStamp) { } @Override - public String getTopic() { - return topic; + public byte[] getPayload() { + return payload; } @Override - public void setTopic(String topic) { - this.topic = topic; + public void setPayload(byte[] payload) { + this.payload = payload; + } + + public String toString() { + return String.format( + "DefaultEventPayload (" + "source=%s," + + "sourceSemanticId=%s," + + "observableReference=%s," + + "observableSemanticId=%s," + + "topic=%s," + + "subjectId=%s," + + "timeStamp=%s," + + "payload=%s," + + ")", + this.source, this.sourceSemanticId, this.observableReference, this.observableSemanticId, this.topic, this.subjectId, + this.timeStamp, this.payload); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java index 7f0212ad5..60f3a99bf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,7 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Extension; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; @@ -38,31 +39,29 @@ public class DefaultExtension implements Extension { protected String name; @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") - protected List refersTo = new ArrayList<>(); + protected List refersTos = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Extension/value") protected String value; @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") - protected DataTypeDefXSD valueType; + protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - public DefaultExtension() { - - } + public DefaultExtension() {} @Override public int hashCode() { return Objects.hash(this.name, - this.refersTo, - this.value, this.valueType, - this.semanticID, + this.value, + this.refersTos, + this.semanticId, this.supplementalSemanticIds); } @@ -77,10 +76,10 @@ public boolean equals(Object obj) { } else { DefaultExtension other = (DefaultExtension) obj; return Objects.equals(this.name, other.name) && - Objects.equals(this.refersTo, other.refersTo) && - Objects.equals(this.value, other.value) && Objects.equals(this.valueType, other.valueType) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.value, other.value) && + Objects.equals(this.refersTos, other.refersTos) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } } @@ -96,13 +95,13 @@ public void setName(String name) { } @Override - public List getRefersTo() { - return refersTo; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setRefersTo(List refersTo) { - this.refersTo = refersTo; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override @@ -116,23 +115,23 @@ public void setValue(String value) { } @Override - public DataTypeDefXSD getValueType() { - return valueType; + public List getRefersTos() { + return refersTos; } @Override - public void setValueType(DataTypeDefXSD valueType) { - this.valueType = valueType; + public void setRefersTos(List refersTos) { + this.refersTos = refersTos; } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -145,6 +144,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + public String toString() { + return String.format( + "DefaultExtension (" + "name=%s," + + "valueType=%s," + + "value=%s," + + "refersTos=%s," + + ")", + this.name, this.valueType, this.value, this.refersTos); + } + /** * This builder class can be used to construct a DefaultExtension bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java index 146fed567..908dbfbb0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -44,8 +45,8 @@ public class DefaultFile implements File { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -57,31 +58,29 @@ public class DefaultFile implements File { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultFile() { - - } + public DefaultFile() {} @Override public int hashCode() { - return Objects.hash(this.contentType, - this.value, + return Objects.hash(this.value, + this.contentType, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -94,38 +93,38 @@ public boolean equals(Object obj) { return false; } else { DefaultFile other = (DefaultFile) obj; - return Objects.equals(this.contentType, other.contentType) && - Objects.equals(this.value, other.value) && + return Objects.equals(this.value, other.value) && + Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getContentType() { - return contentType; + public String getValue() { + return value; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setValue(String value) { + this.value = value; } @Override - public String getValue() { - return value; + public String getContentType() { + return contentType; } @Override - public void setValue(String value) { - this.value = value; + public void setContentType(String contentType) { + this.contentType = contentType; } @Override @@ -139,13 +138,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -158,6 +157,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -169,33 +178,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -208,14 +217,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultFile (" + "value=%s," + + "contentType=%s," + + ")", + this.value, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java index d098f2840..a5be28afe 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -37,9 +38,7 @@ public class DefaultKey implements Key { @IRI("https://admin-shell.io/aas/3/0/Key/value") protected String value; - public DefaultKey() { - - } + public DefaultKey() {} @Override public int hashCode() { @@ -82,6 +81,14 @@ public void setValue(String value) { this.value = value; } + public String toString() { + return String.format( + "DefaultKey (" + "type=%s," + + "value=%s," + + ")", + this.type, this.value); + } + /** * This builder class can be used to construct a DefaultKey bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java index ed0a94c2f..da15bb1e0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,11 +15,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringDefinitionTypeIec61360Builder; import java.util.Objects; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; /** @@ -28,7 +29,7 @@ * String with length 1023 maximum and minimum 1 characters and with language tags */ -@IRI("aas:LangStringDefinitionTypeIEC61360") +@IRI("aas:LangStringDefinitionTypeIec61360") public class DefaultLangStringDefinitionTypeIec61360 implements LangStringDefinitionTypeIec61360 { @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/language") @@ -37,9 +38,7 @@ public class DefaultLangStringDefinitionTypeIec61360 implements LangStringDefini @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/text") protected String text; - public DefaultLangStringDefinitionTypeIec61360() { - - } + public DefaultLangStringDefinitionTypeIec61360() {} @Override public int hashCode() { @@ -82,6 +81,14 @@ public void setText(String text) { this.text = text; } + public String toString() { + return String.format( + "DefaultLangStringDefinitionTypeIec61360 (" + + ")" + + ); + } + /** * This builder class can be used to construct a DefaultLangStringDefinitionTypeIec61360 bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java index 1d165b23d..39f6e1fe3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -36,9 +37,7 @@ public class DefaultLangStringNameType implements LangStringNameType { @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/text") protected String text; - public DefaultLangStringNameType() { - - } + public DefaultLangStringNameType() {} @Override public int hashCode() { @@ -81,6 +80,14 @@ public void setText(String text) { this.text = text; } + public String toString() { + return String.format( + "DefaultLangStringNameType (" + + ")" + + ); + } + /** * This builder class can be used to construct a DefaultLangStringNameType bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java index 6e60307a3..8e62a44e0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,11 +15,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringPreferredNameTypeIec61360Builder; import java.util.Objects; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; /** @@ -28,7 +29,7 @@ * String with length 255 maximum and minimum 1 characters and with language tags */ -@IRI("aas:LangStringPreferredNameTypeIEC61360") +@IRI("aas:LangStringPreferredNameTypeIec61360") public class DefaultLangStringPreferredNameTypeIec61360 implements LangStringPreferredNameTypeIec61360 { @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/language") @@ -37,9 +38,7 @@ public class DefaultLangStringPreferredNameTypeIec61360 implements LangStringPre @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/text") protected String text; - public DefaultLangStringPreferredNameTypeIec61360() { - - } + public DefaultLangStringPreferredNameTypeIec61360() {} @Override public int hashCode() { @@ -82,6 +81,14 @@ public void setText(String text) { this.text = text; } + public String toString() { + return String.format( + "DefaultLangStringPreferredNameTypeIec61360 (" + + ")" + + ); + } + /** * This builder class can be used to construct a DefaultLangStringPreferredNameTypeIec61360 bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java index adf213af1..9b718f90e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,11 +15,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringShortNameTypeIec61360Builder; import java.util.Objects; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360; /** @@ -28,7 +29,7 @@ * String with length 18 maximum and minimum 1 characters and with language tags */ -@IRI("aas:LangStringShortNameTypeIEC61360") +@IRI("aas:LangStringShortNameTypeIec61360") public class DefaultLangStringShortNameTypeIec61360 implements LangStringShortNameTypeIec61360 { @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/language") @@ -37,9 +38,7 @@ public class DefaultLangStringShortNameTypeIec61360 implements LangStringShortNa @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/text") protected String text; - public DefaultLangStringShortNameTypeIec61360() { - - } + public DefaultLangStringShortNameTypeIec61360() {} @Override public int hashCode() { @@ -82,6 +81,14 @@ public void setText(String text) { this.text = text; } + public String toString() { + return String.format( + "DefaultLangStringShortNameTypeIec61360 (" + + ")" + + ); + } + /** * This builder class can be used to construct a DefaultLangStringShortNameTypeIec61360 bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java index 90c243c77..ef6a0b75a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -36,9 +37,7 @@ public class DefaultLangStringTextType implements LangStringTextType { @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/text") protected String text; - public DefaultLangStringTextType() { - - } + public DefaultLangStringTextType() {} @Override public int hashCode() { @@ -81,6 +80,14 @@ public void setText(String text) { this.text = text; } + public String toString() { + return String.format( + "DefaultLangStringTextType (" + + ")" + + ); + } + /** * This builder class can be used to construct a DefaultLangStringTextType bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java index 5251649b3..667fa1098 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -43,16 +44,14 @@ public class DefaultLevelType implements LevelType { @IRI("https://admin-shell.io/aas/3/0/LevelType/typ") protected boolean typ; - public DefaultLevelType() { - - } + public DefaultLevelType() {} @Override public int hashCode() { - return Objects.hash(this.max, - this.min, + return Objects.hash(this.min, this.nom, - this.typ); + this.typ, + this.max); } @Override @@ -65,23 +64,13 @@ public boolean equals(Object obj) { return false; } else { DefaultLevelType other = (DefaultLevelType) obj; - return Objects.equals(this.max, other.max) && - Objects.equals(this.min, other.min) && + return Objects.equals(this.min, other.min) && Objects.equals(this.nom, other.nom) && - Objects.equals(this.typ, other.typ); + Objects.equals(this.typ, other.typ) && + Objects.equals(this.max, other.max); } } - @Override - public boolean getMax() { - return max; - } - - @Override - public void setMax(boolean max) { - this.max = max; - } - @Override public boolean getMin() { return min; @@ -112,6 +101,26 @@ public void setTyp(boolean typ) { this.typ = typ; } + @Override + public boolean getMax() { + return max; + } + + @Override + public void setMax(boolean max) { + this.max = max; + } + + public String toString() { + return String.format( + "DefaultLevelType (" + "min=%s," + + "nom=%s," + + "typ=%s," + + "max=%s," + + ")", + this.min, this.nom, this.typ, this.max); + } + /** * This builder class can be used to construct a DefaultLevelType bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java index 56f9cb8f7..27bf73690 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -38,17 +39,17 @@ public class DefaultMultiLanguageProperty implements MultiLanguageProperty { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/value") - protected List value = new ArrayList<>(); + protected List values = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueID") - protected Reference valueID; + @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId") + protected Reference valueId; @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); @@ -57,31 +58,29 @@ public class DefaultMultiLanguageProperty implements MultiLanguageProperty { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultMultiLanguageProperty() { - - } + public DefaultMultiLanguageProperty() {} @Override public int hashCode() { - return Objects.hash(this.value, - this.valueID, + return Objects.hash(this.values, + this.valueId, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -94,38 +93,38 @@ public boolean equals(Object obj) { return false; } else { DefaultMultiLanguageProperty other = (DefaultMultiLanguageProperty) obj; - return Objects.equals(this.value, other.value) && - Objects.equals(this.valueID, other.valueID) && + return Objects.equals(this.values, other.values) && + Objects.equals(this.valueId, other.valueId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public List getValue() { - return value; + public List getValues() { + return values; } @Override - public void setValue(List value) { - this.value = value; + public void setValues(List values) { + this.values = values; } @Override - public Reference getValueID() { - return valueID; + public Reference getValueId() { + return valueId; } @Override - public void setValueID(Reference valueID) { - this.valueID = valueID; + public void setValueId(Reference valueId) { + this.valueId = valueId; } @Override @@ -139,13 +138,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -158,6 +157,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -169,33 +178,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -208,14 +217,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultMultiLanguageProperty (" + "values=%s," + + "valueId=%s," + + ")", + this.values, this.valueId); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java index 51f9b021d..b4f359f66 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -38,8 +39,8 @@ public class DefaultOperation implements Operation { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -60,32 +61,30 @@ public class DefaultOperation implements Operation { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultOperation() { - - } + public DefaultOperation() {} @Override public int hashCode() { - return Objects.hash(this.inoutputVariables, - this.inputVariables, + return Objects.hash(this.inputVariables, this.outputVariables, + this.inoutputVariables, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -98,31 +97,21 @@ public boolean equals(Object obj) { return false; } else { DefaultOperation other = (DefaultOperation) obj; - return Objects.equals(this.inoutputVariables, other.inoutputVariables) && - Objects.equals(this.inputVariables, other.inputVariables) && + return Objects.equals(this.inputVariables, other.inputVariables) && Objects.equals(this.outputVariables, other.outputVariables) && + Objects.equals(this.inoutputVariables, other.inoutputVariables) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } - @Override - public List getInoutputVariables() { - return inoutputVariables; - } - - @Override - public void setInoutputVariables(List inoutputVariables) { - this.inoutputVariables = inoutputVariables; - } - @Override public List getInputVariables() { return inputVariables; @@ -143,6 +132,16 @@ public void setOutputVariables(List outputVariables) { this.outputVariables = outputVariables; } + @Override + public List getInoutputVariables() { + return inoutputVariables; + } + + @Override + public void setInoutputVariables(List inoutputVariables) { + this.inoutputVariables = inoutputVariables; + } + @Override public List getEmbeddedDataSpecifications() { return embeddedDataSpecifications; @@ -154,13 +153,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -173,6 +172,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -184,33 +193,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -223,14 +232,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultOperation (" + "inputVariables=%s," + + "outputVariables=%s," + + "inoutputVariables=%s," + + ")", + this.inputVariables, this.outputVariables, this.inoutputVariables); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java index 6ba755f0a..5d30e0263 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -66,6 +67,13 @@ public void setValue(SubmodelElement value) { this.value = value; } + public String toString() { + return String.format( + "DefaultOperationVariable (" + "value=%s," + + ")", + this.value); + } + /** * This builder class can be used to construct a DefaultOperationVariable bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java index 738f5723f..273ac55b9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -38,8 +39,8 @@ public class DefaultProperty implements Property { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -47,11 +48,11 @@ public class DefaultProperty implements Property { @IRI("https://admin-shell.io/aas/3/0/Property/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/Property/valueID") - protected Reference valueID; + @IRI("https://admin-shell.io/aas/3/0/Property/valueId") + protected Reference valueId; @IRI("https://admin-shell.io/aas/3/0/Property/valueType") - protected DataTypeDefXSD valueType; + protected DataTypeDefXsd valueType; @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); @@ -60,32 +61,30 @@ public class DefaultProperty implements Property { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultProperty() { - - } + public DefaultProperty() {} @Override public int hashCode() { - return Objects.hash(this.value, - this.valueID, - this.valueType, + return Objects.hash(this.valueType, + this.value, + this.valueId, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -98,49 +97,49 @@ public boolean equals(Object obj) { return false; } else { DefaultProperty other = (DefaultProperty) obj; - return Objects.equals(this.value, other.value) && - Objects.equals(this.valueID, other.valueID) && - Objects.equals(this.valueType, other.valueType) && + return Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.value, other.value) && + Objects.equals(this.valueId, other.valueId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getValue() { - return value; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setValue(String value) { - this.value = value; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override - public Reference getValueID() { - return valueID; + public String getValue() { + return value; } @Override - public void setValueID(Reference valueID) { - this.valueID = valueID; + public void setValue(String value) { + this.value = value; } @Override - public DataTypeDefXSD getValueType() { - return valueType; + public Reference getValueId() { + return valueId; } @Override - public void setValueType(DataTypeDefXSD valueType) { - this.valueType = valueType; + public void setValueId(Reference valueId) { + this.valueId = valueId; } @Override @@ -154,13 +153,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -173,6 +172,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -184,33 +193,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -223,14 +232,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultProperty (" + "valueType=%s," + + "value=%s," + + "valueId=%s," + + ")", + this.valueType, this.value, this.valueId); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java index fc1d46bb3..2bb2a7182 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,7 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -36,8 +37,8 @@ @IRI("aas:Qualifier") public class DefaultQualifier implements Qualifier { - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -51,24 +52,22 @@ public class DefaultQualifier implements Qualifier { @IRI("https://admin-shell.io/aas/3/0/Qualifier/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueID") - protected Reference valueID; + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueId") + protected Reference valueId; @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") - protected DataTypeDefXSD valueType; + protected DataTypeDefXsd valueType; - public DefaultQualifier() { - - } + public DefaultQualifier() {} @Override public int hashCode() { return Objects.hash(this.kind, this.type, - this.value, - this.valueID, this.valueType, - this.semanticID, + this.value, + this.valueId, + this.semanticId, this.supplementalSemanticIds); } @@ -84,10 +83,10 @@ public boolean equals(Object obj) { DefaultQualifier other = (DefaultQualifier) obj; return Objects.equals(this.kind, other.kind) && Objects.equals(this.type, other.type) && - Objects.equals(this.value, other.value) && - Objects.equals(this.valueID, other.valueID) && Objects.equals(this.valueType, other.valueType) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.value, other.value) && + Objects.equals(this.valueId, other.valueId) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } } @@ -113,43 +112,43 @@ public void setType(String type) { } @Override - public String getValue() { - return value; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setValue(String value) { - this.value = value; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override - public Reference getValueID() { - return valueID; + public String getValue() { + return value; } @Override - public void setValueID(Reference valueID) { - this.valueID = valueID; + public void setValue(String value) { + this.value = value; } @Override - public DataTypeDefXSD getValueType() { - return valueType; + public Reference getValueId() { + return valueId; } @Override - public void setValueType(DataTypeDefXSD valueType) { - this.valueType = valueType; + public void setValueId(Reference valueId) { + this.valueId = valueId; } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -162,6 +161,17 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + public String toString() { + return String.format( + "DefaultQualifier (" + "kind=%s," + + "type=%s," + + "valueType=%s," + + "value=%s," + + "valueId=%s," + + ")", + this.kind, this.type, this.valueType, this.value, this.valueId); + } + /** * This builder class can be used to construct a DefaultQualifier bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java index 18710604c..1e80d3426 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -38,8 +39,8 @@ public class DefaultRange implements Range { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -54,38 +55,36 @@ public class DefaultRange implements Range { protected String min; @IRI("https://admin-shell.io/aas/3/0/Range/valueType") - protected DataTypeDefXSD valueType; + protected DataTypeDefXsd valueType; @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultRange() { - - } + public DefaultRange() {} @Override public int hashCode() { - return Objects.hash(this.max, + return Objects.hash(this.valueType, this.min, - this.valueType, + this.max, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -98,29 +97,29 @@ public boolean equals(Object obj) { return false; } else { DefaultRange other = (DefaultRange) obj; - return Objects.equals(this.max, other.max) && + return Objects.equals(this.valueType, other.valueType) && Objects.equals(this.min, other.min) && - Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.max, other.max) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getMax() { - return max; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setMax(String max) { - this.max = max; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override @@ -134,13 +133,13 @@ public void setMin(String min) { } @Override - public DataTypeDefXSD getValueType() { - return valueType; + public String getMax() { + return max; } @Override - public void setValueType(DataTypeDefXSD valueType) { - this.valueType = valueType; + public void setMax(String max) { + this.max = max; } @Override @@ -154,13 +153,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -173,6 +172,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -184,33 +193,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -223,14 +232,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultRange (" + "valueType=%s," + + "min=%s," + + "max=%s," + + ")", + this.valueType, this.min, this.max); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java index 3817f9236..79d0f7a68 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -37,21 +38,19 @@ public class DefaultReference implements Reference { @IRI("https://admin-shell.io/aas/3/0/Reference/keys") protected List keys = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticID") - protected Reference referredSemanticID; + @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticId") + protected Reference referredSemanticId; @IRI("https://admin-shell.io/aas/3/0/Reference/type") protected ReferenceTypes type; - public DefaultReference() { - - } + public DefaultReference() {} @Override public int hashCode() { - return Objects.hash(this.keys, - this.referredSemanticID, - this.type); + return Objects.hash(this.type, + this.referredSemanticId, + this.keys); } @Override @@ -64,40 +63,49 @@ public boolean equals(Object obj) { return false; } else { DefaultReference other = (DefaultReference) obj; - return Objects.equals(this.keys, other.keys) && - Objects.equals(this.referredSemanticID, other.referredSemanticID) && - Objects.equals(this.type, other.type); + return Objects.equals(this.type, other.type) && + Objects.equals(this.referredSemanticId, other.referredSemanticId) && + Objects.equals(this.keys, other.keys); } } @Override - public List getKeys() { - return keys; + public ReferenceTypes getType() { + return type; } @Override - public void setKeys(List keys) { - this.keys = keys; + public void setType(ReferenceTypes type) { + this.type = type; } @Override - public Reference getReferredSemanticID() { - return referredSemanticID; + public Reference getReferredSemanticId() { + return referredSemanticId; } @Override - public void setReferredSemanticID(Reference referredSemanticID) { - this.referredSemanticID = referredSemanticID; + public void setReferredSemanticId(Reference referredSemanticId) { + this.referredSemanticId = referredSemanticId; } @Override - public ReferenceTypes getType() { - return type; + public List getKeys() { + return keys; } @Override - public void setType(ReferenceTypes type) { - this.type = type; + public void setKeys(List keys) { + this.keys = keys; + } + + public String toString() { + return String.format( + "DefaultReference (" + "type=%s," + + "referredSemanticId=%s," + + "keys=%s," + + ")", + this.type, this.referredSemanticId, this.keys); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java index 3b36d2062..032121dd0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -39,8 +40,8 @@ public class DefaultReferenceElement implements ReferenceElement { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -52,10 +53,10 @@ public class DefaultReferenceElement implements ReferenceElement { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; @@ -63,22 +64,20 @@ public class DefaultReferenceElement implements ReferenceElement { @IRI("https://admin-shell.io/aas/3/0/ReferenceElement/value") protected Reference value; - public DefaultReferenceElement() { - - } + public DefaultReferenceElement() {} @Override public int hashCode() { return Objects.hash(this.value, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -93,14 +92,14 @@ public boolean equals(Object obj) { DefaultReferenceElement other = (DefaultReferenceElement) obj; return Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @@ -125,13 +124,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -144,6 +143,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -155,33 +164,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -194,14 +203,11 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultReferenceElement (" + "value=%s," + + ")", + this.value); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java index 99bd400e0..df41bf9e7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -39,8 +40,8 @@ public class DefaultRelationshipElement implements RelationshipElement { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -52,10 +53,10 @@ public class DefaultRelationshipElement implements RelationshipElement { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; @@ -66,23 +67,21 @@ public class DefaultRelationshipElement implements RelationshipElement { @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") protected Reference second; - public DefaultRelationshipElement() { - - } + public DefaultRelationshipElement() {} @Override public int hashCode() { return Objects.hash(this.first, this.second, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -98,14 +97,14 @@ public boolean equals(Object obj) { return Objects.equals(this.first, other.first) && Objects.equals(this.second, other.second) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @@ -140,13 +139,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -159,6 +158,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -170,33 +179,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -209,14 +218,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultRelationshipElement (" + "first=%s," + + "second=%s," + + ")", + this.first, this.second); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java index 44b40cb2b..fa28ac29e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -37,14 +38,12 @@ public class DefaultResource implements Resource { @IRI("https://admin-shell.io/aas/3/0/Resource/path") protected String path; - public DefaultResource() { - - } + public DefaultResource() {} @Override public int hashCode() { - return Objects.hash(this.contentType, - this.path); + return Objects.hash(this.path, + this.contentType); } @Override @@ -57,29 +56,37 @@ public boolean equals(Object obj) { return false; } else { DefaultResource other = (DefaultResource) obj; - return Objects.equals(this.contentType, other.contentType) && - Objects.equals(this.path, other.path); + return Objects.equals(this.path, other.path) && + Objects.equals(this.contentType, other.contentType); } } @Override - public String getContentType() { - return contentType; + public String getPath() { + return path; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setPath(String path) { + this.path = path; } @Override - public String getPath() { - return path; + public String getContentType() { + return contentType; } @Override - public void setPath(String path) { - this.path = path; + public void setContentType(String contentType) { + this.contentType = contentType; + } + + public String toString() { + return String.format( + "DefaultResource (" + "path=%s," + + "contentType=%s," + + ")", + this.path, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetID.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetID.java deleted file mode 100644 index 5c35ffb9e..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetID.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.SpecificAssetIDBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID - * - * A specific asset ID describes a generic supplementary identifying attribute of the asset. - */ - -@IRI("aas:SpecificAssetID") -public class DefaultSpecificAssetID implements SpecificAssetID { - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/SpecificAssetID/externalSubjectID") - protected Reference externalSubjectID; - - @IRI("https://admin-shell.io/aas/3/0/SpecificAssetID/name") - protected String name; - - @IRI("https://admin-shell.io/aas/3/0/SpecificAssetID/value") - protected String value; - - public DefaultSpecificAssetID() { - - } - - @Override - public int hashCode() { - return Objects.hash(this.externalSubjectID, - this.name, - this.value, - this.semanticID, - this.supplementalSemanticIds); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultSpecificAssetID other = (DefaultSpecificAssetID) obj; - return Objects.equals(this.externalSubjectID, other.externalSubjectID) && - Objects.equals(this.name, other.name) && - Objects.equals(this.value, other.value) && - Objects.equals(this.semanticID, other.semanticID) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); - } - } - - @Override - public Reference getExternalSubjectID() { - return externalSubjectID; - } - - @Override - public void setExternalSubjectID(Reference externalSubjectID) { - this.externalSubjectID = externalSubjectID; - } - - @Override - public String getName() { - return name; - } - - @Override - public void setName(String name) { - this.name = name; - } - - @Override - public String getValue() { - return value; - } - - @Override - public void setValue(String value) { - this.value = value; - } - - @Override - public Reference getSemanticID() { - return semanticID; - } - - @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - /** - * This builder class can be used to construct a DefaultSpecificAssetID bean. - */ - public static class Builder extends SpecificAssetIDBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultSpecificAssetID newBuildingInstance() { - return new DefaultSpecificAssetID(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java index 17f582dc9..5ae55c885 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -41,8 +42,8 @@ public class DefaultSubmodel implements Submodel { @IRI("https://admin-shell.io/aas/3/0/HasKind/kind") protected ModellingKind kind; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -60,10 +61,10 @@ public class DefaultSubmodel implements Submodel { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; @@ -71,24 +72,22 @@ public class DefaultSubmodel implements Submodel { @IRI("https://admin-shell.io/aas/3/0/Submodel/submodelElements") protected List submodelElements = new ArrayList<>(); - public DefaultSubmodel() { - - } + public DefaultSubmodel() {} @Override public int hashCode() { return Objects.hash(this.submodelElements, this.embeddedDataSpecifications, + this.kind, + this.semanticId, + this.supplementalSemanticIds, this.administration, this.id, this.category, - this.description, - this.displayName, this.idShort, + this.displayNames, + this.descriptions, this.extensions, - this.semanticID, - this.supplementalSemanticIds, - this.kind, this.qualifiers); } @@ -104,16 +103,16 @@ public boolean equals(Object obj) { DefaultSubmodel other = (DefaultSubmodel) obj; return Objects.equals(this.submodelElements, other.submodelElements) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.kind, other.kind) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticID, other.semanticID) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && Objects.equals(this.qualifiers, other.qualifiers); } } @@ -139,103 +138,103 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public AdministrativeInformation getAdministration() { - return administration; + public ModellingKind getKind() { + return kind; } @Override - public void setAdministration(AdministrativeInformation administration) { - this.administration = administration; + public void setKind(ModellingKind kind) { + this.kind = kind; } @Override - public String getId() { - return id; + public Reference getSemanticId() { + return semanticId; } @Override - public void setId(String id) { - this.id = id; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override - public String getCategory() { - return category; + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; } @Override - public void setCategory(String category) { - this.category = category; + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; } @Override - public List getDescription() { - return description; + public AdministrativeInformation getAdministration() { + return administration; } @Override - public void setDescription(List description) { - this.description = description; + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; } @Override - public List getDisplayName() { - return displayName; + public String getId() { + return id; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setId(String id) { + this.id = id; } @Override - public String getIdShort() { - return idShort; + public String getCategory() { + return category; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setCategory(String category) { + this.category = category; } @Override - public List getExtensions() { - return extensions; + public String getIdShort() { + return idShort; } @Override - public void setExtensions(List extensions) { - this.extensions = extensions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public Reference getSemanticID() { - return semanticID; + public List getDisplayNames() { + return displayNames; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; + public List getDescriptions() { + return descriptions; } @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override - public ModellingKind getKind() { - return kind; + public List getExtensions() { + return extensions; } @Override - public void setKind(ModellingKind kind) { - this.kind = kind; + public void setExtensions(List extensions) { + this.extensions = extensions; } @Override @@ -248,6 +247,13 @@ public void setQualifiers(List qualifiers) { this.qualifiers = qualifiers; } + public String toString() { + return String.format( + "DefaultSubmodel (" + "submodelElements=%s," + + ")", + this.submodelElements); + } + /** * This builder class can be used to construct a DefaultSubmodel bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java index 2cb74847c..e321cce9a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -19,7 +20,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelElementCollectionBuilder; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Objects; @@ -41,8 +41,8 @@ public class DefaultSubmodelElementCollection implements SubmodelElementCollecti @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -54,33 +54,31 @@ public class DefaultSubmodelElementCollection implements SubmodelElementCollecti protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; @IRI("https://admin-shell.io/aas/3/0/SubmodelElementCollection/value") - protected Collection value = new ArrayList<>(); + protected List values = new ArrayList<>(); - public DefaultSubmodelElementCollection() { - - } + public DefaultSubmodelElementCollection() {} @Override public int hashCode() { - return Objects.hash(this.value, + return Objects.hash(this.values, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -93,27 +91,27 @@ public boolean equals(Object obj) { return false; } else { DefaultSubmodelElementCollection other = (DefaultSubmodelElementCollection) obj; - return Objects.equals(this.value, other.value) && + return Objects.equals(this.values, other.values) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public Collection getValue() { - return value; + public List getValues() { + return values; } @Override - public void setValue(Collection value) { - this.value = value; + public void setValues(List values) { + this.values = values; } @Override @@ -127,13 +125,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -146,6 +144,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -157,33 +165,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -196,14 +204,11 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultSubmodelElementCollection (" + "values=%s," + + ")", + this.values); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java index 745f21e17..bf6140f48 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -38,8 +39,8 @@ public class DefaultSubmodelElementList implements SubmodelElementList { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -51,10 +52,10 @@ public class DefaultSubmodelElementList implements SubmodelElementList { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; @@ -62,38 +63,36 @@ public class DefaultSubmodelElementList implements SubmodelElementList { @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant") protected boolean orderRelevant; - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIDListElement") - protected Reference semanticIDListElement; + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement") + protected Reference semanticIdListElement; @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement") - protected AASSubmodelElements typeValueListElement; + protected AasSubmodelElements typeValueListElement; @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") - protected List value = new ArrayList<>(); + protected List values = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") - protected DataTypeDefXSD valueTypeListElement; + protected DataTypeDefXsd valueTypeListElement; - public DefaultSubmodelElementList() { - - } + public DefaultSubmodelElementList() {} @Override public int hashCode() { return Objects.hash(this.orderRelevant, - this.semanticIDListElement, + this.semanticIdListElement, this.typeValueListElement, - this.value, this.valueTypeListElement, + this.values, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -107,19 +106,19 @@ public boolean equals(Object obj) { } else { DefaultSubmodelElementList other = (DefaultSubmodelElementList) obj; return Objects.equals(this.orderRelevant, other.orderRelevant) && - Objects.equals(this.semanticIDListElement, other.semanticIDListElement) && + Objects.equals(this.semanticIdListElement, other.semanticIdListElement) && Objects.equals(this.typeValueListElement, other.typeValueListElement) && - Objects.equals(this.value, other.value) && Objects.equals(this.valueTypeListElement, other.valueTypeListElement) && + Objects.equals(this.values, other.values) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @@ -134,43 +133,43 @@ public void setOrderRelevant(boolean orderRelevant) { } @Override - public Reference getSemanticIDListElement() { - return semanticIDListElement; + public Reference getSemanticIdListElement() { + return semanticIdListElement; } @Override - public void setSemanticIDListElement(Reference semanticIDListElement) { - this.semanticIDListElement = semanticIDListElement; + public void setSemanticIdListElement(Reference semanticIdListElement) { + this.semanticIdListElement = semanticIdListElement; } @Override - public AASSubmodelElements getTypeValueListElement() { + public AasSubmodelElements getTypeValueListElement() { return typeValueListElement; } @Override - public void setTypeValueListElement(AASSubmodelElements typeValueListElement) { + public void setTypeValueListElement(AasSubmodelElements typeValueListElement) { this.typeValueListElement = typeValueListElement; } @Override - public List getValue() { - return value; + public DataTypeDefXsd getValueTypeListElement() { + return valueTypeListElement; } @Override - public void setValue(List value) { - this.value = value; + public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement) { + this.valueTypeListElement = valueTypeListElement; } @Override - public DataTypeDefXSD getValueTypeListElement() { - return valueTypeListElement; + public List getValues() { + return values; } @Override - public void setValueTypeListElement(DataTypeDefXSD valueTypeListElement) { - this.valueTypeListElement = valueTypeListElement; + public void setValues(List values) { + this.values = values; } @Override @@ -184,13 +183,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -203,6 +202,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -214,33 +223,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -253,14 +262,15 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultSubmodelElementList (" + "orderRelevant=%s," + + "semanticIdListElement=%s," + + "typeValueListElement=%s," + + "valueTypeListElement=%s," + + "values=%s," + + ")", + this.orderRelevant, this.semanticIdListElement, this.typeValueListElement, this.valueTypeListElement, this.values); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java index a4c7d4236..be8669adf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -67,6 +68,13 @@ public void setValueReferencePairs(List valueReferencePairs) this.valueReferencePairs = valueReferencePairs; } + public String toString() { + return String.format( + "DefaultValueList (" + "valueReferencePairs=%s," + + ")", + this.valueReferencePairs); + } + /** * This builder class can be used to construct a DefaultValueList bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java index fbffa2f47..7464601a0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -35,17 +36,15 @@ public class DefaultValueReferencePair implements ValueReferencePair { @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueID") - protected Reference valueID; + @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueId") + protected Reference valueId; - public DefaultValueReferencePair() { - - } + public DefaultValueReferencePair() {} @Override public int hashCode() { return Objects.hash(this.value, - this.valueID); + this.valueId); } @Override @@ -59,7 +58,7 @@ public boolean equals(Object obj) { } else { DefaultValueReferencePair other = (DefaultValueReferencePair) obj; return Objects.equals(this.value, other.value) && - Objects.equals(this.valueID, other.valueID); + Objects.equals(this.valueId, other.valueId); } } @@ -74,13 +73,21 @@ public void setValue(String value) { } @Override - public Reference getValueID() { - return valueID; + public Reference getValueId() { + return valueId; } @Override - public void setValueID(Reference valueID) { - this.valueID = valueID; + public void setValueId(Reference valueId) { + this.valueId = valueId; + } + + public String toString() { + return String.format( + "DefaultValueReferencePair (" + "value=%s," + + "valueId=%s," + + ")", + this.value, this.valueId); } /** From d868f19d1f841033c7c4fd3fcc7fc4a4a9bf90f8 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 27 Jun 2023 16:04:29 +0200 Subject: [PATCH 02/59] Update dataformat-aasx project --- .../v3/dataformat/aasx/AASXDeserializer.java | 26 +++---- .../v3/dataformat/aasx/AASXSerializer.java | 75 +++++++++++++------ .../deserialization/AASXDeserializerTest.java | 8 +- .../aasx/deserialization/ValidationTest.java | 16 ++-- .../serialization/AASXSerializerTest.java | 17 +++-- .../src/test/resources/jsonExample.json | 2 +- 6 files changed, 87 insertions(+), 57 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index 5108b7bf9..0a3b4da65 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -33,7 +31,7 @@ import org.apache.poi.openxml4j.opc.PackagingURIHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; @@ -49,10 +47,8 @@ public class AASXDeserializer { private static final String XML_TYPE = "http://www.admin-shell.io/aasx/relationships/aas-spec"; private static final String AASX_ORIGIN = "/aasx/aasx-origin"; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - - private final XmlDeserializer deserializer; + private XmlDeserializer deserializer = new XmlDeserializer(); private Environment environment; private final OPCPackage aasxRoot; @@ -66,7 +62,6 @@ public class AASXDeserializer { */ public AASXDeserializer(InputStream inputStream) throws InvalidFormatException, IOException { aasxRoot = OPCPackage.open(inputStream); - this.deserializer = new XmlDeserializer(); } /** @@ -131,7 +126,7 @@ private String getXMLResourceString(OPCPackage aasxPackage) throws InvalidFormat // Read the content from the PackagePart InputStream stream = xmlPart.getInputStream(); StringWriter writer = new StringWriter(); - IOUtils.copy(stream, writer, DEFAULT_CHARSET); + IOUtils.copy(stream, writer, Serializer.DEFAULT_CHARSET); return writer.toString(); } @@ -139,7 +134,7 @@ private String getXMLResourceString(OPCPackage aasxPackage) throws InvalidFormat * Load the referenced filepaths in the submodels such as PDF, PNG files from * the package * - * @return a list of the folder name and folder path, the folder holds the files + * @return a map of the folder name and folder path, the folder holds the files * @throws IOException if creating input streams for aasx fails * @throws InvalidFormatException if aasx package format is invalid * @throws DeserializationException if deserialization of the serialized aas environment fails @@ -166,10 +161,15 @@ private List parseElements(Collection elements) { for (SubmodelElement element : elements) { if (element instanceof File) { File file = (File) element; - paths.add(file.getValue()); + // If the path contains a "://", we can assume, that the Path is a link to an + // other server + // e.g. http://localhost:8080/aasx/... + if (!file.getValue().contains("://")) { + paths.add(file.getValue()); + } } else if (element instanceof SubmodelElementCollection) { SubmodelElementCollection collection = (SubmodelElementCollection) element; - paths.addAll(parseElements(collection.getValues())); + paths.addAll(parseElements(collection.getValue())); } } return paths; @@ -193,7 +193,7 @@ public List getRelatedFiles() throws InvalidFormatException, IOExc } private InMemoryFile readFile(OPCPackage aasxRoot, String filePath) throws InvalidFormatException, IOException { - PackagePart part = aasxRoot.getPart(PackagingURIHelper.createPartName(AASXUtils.getPathFromURL(filePath))); + PackagePart part = aasxRoot.getPart(PackagingURIHelper.createPartName(filePath)); InputStream stream = part.getInputStream(); return new InMemoryFile(stream.readAllBytes(), filePath); } diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index 449be54c3..050dce41e 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,8 +18,6 @@ import java.io.IOException; import java.io.OutputStream; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -33,20 +31,18 @@ import org.apache.poi.openxml4j.opc.RelationshipSource; import org.apache.poi.openxml4j.opc.TargetMode; import org.apache.poi.openxml4j.opc.internal.MemoryPackagePart; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.File; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSerializer; - /** * This class can be used to generate an .aasx file from Metamodel Objects and * the Files referred to in the Submodels @@ -66,15 +62,12 @@ public class AASXSerializer { private static final String AASSUPPL_RELTYPE = "http://www.admin-shell.io/aasx/relationships/aas-suppl"; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - - private final XmlSerializer xmlSerializer; + private Serializer xmlSerializer = new XmlSerializer(); /** * Default constructor */ public AASXSerializer() { - this.xmlSerializer = new XmlSerializer(); } /** @@ -82,7 +75,7 @@ public AASXSerializer() { * * @param xmlSerializer a custom serializer used for serializing the aas environment */ - public AASXSerializer(XmlSerializer xmlSerializer) { + public AASXSerializer(Serializer xmlSerializer) { this.xmlSerializer = xmlSerializer; } @@ -109,7 +102,7 @@ public void write(Environment environment, Collection files, Outpu String xml = xmlSerializer.write(environment); // Save the XML to aasx/xml/content.xml - PackagePart xmlPart = createAASXPart(rootPackage, origin, XML_PATH, MIME_XML, AASSPEC_RELTYPE, xml.getBytes(DEFAULT_CHARSET)); + PackagePart xmlPart = createAASXPart(rootPackage, origin, XML_PATH, MIME_XML, AASSPEC_RELTYPE, xml.getBytes(Serializer.DEFAULT_CHARSET)); storeFilesInAASX(environment.getSubmodels(), files, rootPackage, xmlPart); @@ -125,11 +118,11 @@ public void write(Environment environment, Collection files, Outpu * @param xmlPart the Part the files should be related to */ private void storeFilesInAASX(List submodelList, Collection files, OPCPackage rootPackage, - PackagePart xmlPart) { + PackagePart xmlPart) { for (Submodel sm : submodelList) { for (File file : findFileElements(sm.getSubmodelElements())) { - String filePath = AASXUtils.getPathFromURL(file.getValue()); + String filePath = file.getValue(); try { InMemoryFile content = findFileByPath(files, filePath); logger.trace("Writing file '" + filePath + "' to .aasx."); @@ -203,7 +196,7 @@ private PackagePart createAASXPart(OPCPackage root, RelationshipSource relateTo, * @param content the content to be written to the part */ private void writeDataToPart(PackagePart part, byte[] content) { - try (OutputStream ostream = part.getOutputStream()) { + try (OutputStream ostream = part.getOutputStream();) { ostream.write(content); ostream.flush(); } catch (Exception e) { @@ -226,7 +219,7 @@ private Collection findFileElements(Collection elements) files.add((File) element); } else if (element instanceof SubmodelElementCollection) { // Recursive call to deal with SubmodelElementCollections - files.addAll(findFileElements(((SubmodelElementCollection) element).getValues())); + files.addAll(findFileElements(((SubmodelElementCollection) element).getValue())); } } @@ -252,7 +245,7 @@ private void prepareFilePaths(Collection submodels) { */ private InMemoryFile findFileByPath(Collection files, String path) { for (InMemoryFile file : files) { - if (AASXUtils.getPathFromURL(file.getPath()).equals(path)) { + if (preparePath(file.getPath()).equals(path)) { return file; } } @@ -260,17 +253,51 @@ private InMemoryFile findFileByPath(Collection files, String path) } /** - * Removes the serverpart from a path and ensures it starts with "file://" + * Removes the serverpart from a path and ensures it starts with a slash * * @param path the path to be prepared * @return the prepared path */ private String preparePath(String path) { - String newPath = AASXUtils.getPathFromURL(path); - if (!newPath.startsWith("file://")) { - newPath = "file://" + newPath; + String newPath = getPathFromURL(path); + if (!newPath.startsWith("/")) { + newPath = "/" + newPath; } return newPath; } + /** + * Gets the path from a URL e.g "http://localhost:8080/path/to/test.file" + * results in "/path/to/test.file" + * + * @param url + * @return the path from the URL + */ + private String getPathFromURL(String url) { + if (url == null) { + return null; + } + + if (url.contains("://")) { + + // Find the ":" and and remove the "http://" from the url + int index = url.indexOf(":") + 3; + url = url.substring(index); + + // Find the first "/" from the URL (now without the "http://") and remove + // everything before that + index = url.indexOf("/"); + url = url.substring(index); + + // Recursive call to deal with more than one server parts + // (e.g. basyx://127.0.0.1:6998//https://localhost/test/) + return getPathFromURL(url); + } else { + // Make sure the path has a / at the start + if (!url.startsWith("/")) { + url = "/" + url; + } + return url; + } + } } \ No newline at end of file diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java index 77425197e..465f8b8be 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,20 +48,19 @@ public class AASXDeserializerTest { @Test public void testRoundTrip() throws SerializationException, IOException, InvalidFormatException, DeserializationException, ParserConfigurationException, SAXException { - List fileList = new ArrayList<>(); byte[] operationManualContent = { 0, 1, 2, 3, 4 }; - InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); + InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "/aasx/OperatingManual.pdf"); fileList.add(inMemoryFile); File file = tempFolder.newFile("output.aasx"); - new AASXSerializer().write(AASSimple.createEnvironment(), fileList, new FileOutputStream(file)); + new AASXSerializer().write(AASSimple.ENVIRONMENT, fileList, new FileOutputStream(file)); InputStream in = new FileInputStream(file); AASXDeserializer deserializer = new AASXDeserializer(in); - assertEquals(AASSimple.createEnvironment(), deserializer.read()); + assertEquals(AASSimple.ENVIRONMENT, deserializer.read()); assertEquals(fileList, deserializer.getRelatedFiles()); } } diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java index 6b1622c43..5fe63adfb 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,17 +30,18 @@ import javax.xml.parsers.ParserConfigurationException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXValidator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.xml.sax.SAXException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; + public class ValidationTest { @Rule @@ -49,12 +51,12 @@ public class ValidationTest { public void validateXmlInsideAasx() throws SerializationException, IOException, InvalidFormatException, DeserializationException, ParserConfigurationException, SAXException { List fileList = new ArrayList<>(); byte[] operationManualContent = { 0, 1, 2, 3, 4 }; - InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); + InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "/aasx/OperatingManual.pdf"); fileList.add(inMemoryFile); File file = tempFolder.newFile("output.aasx"); - new AASXSerializer().write(AASSimple.createEnvironment(), fileList, new FileOutputStream(file)); + new AASXSerializer().write(AASSimple.ENVIRONMENT, fileList, new FileOutputStream(file)); InputStream in = new FileInputStream(file); AASXValidator v = new AASXValidator(in); diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java index cfce0d5c1..f3830bb2c 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,15 +41,15 @@ public class AASXSerializerTest { - private static final String XML_PATH_URI = "file:///aasx/xml/content.xml"; - private static final String ORIGIN_PATH_URI = "file:///aasx/aasx-origin"; + private static final String XML_PATH = "aasx/xml/content.xml"; + private static final String ORIGIN_PATH = "aasx/aasx-origin"; private List fileList = new ArrayList<>(); @Before public void setup() throws IOException { byte[] operationManualContent = { 0, 1, 2, 3, 4 }; - InMemoryFile file = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); + InMemoryFile file = new InMemoryFile(operationManualContent, "aasx/OperatingManual.pdf"); fileList.add(file); } @@ -61,7 +62,7 @@ public void testBuildAASX() throws IOException, TransformerException, ParserConf // This stream keeps the output of the AASXFactory only in memory ByteArrayOutputStream out = new ByteArrayOutputStream(); - new AASXSerializer().write(AASSimple.createEnvironment(), fileList, out); + new AASXSerializer().write(AASSimple.ENVIRONMENT, fileList, out); validateAASX(out); } @@ -73,7 +74,7 @@ private void validateAASX(ByteArrayOutputStream byteStream) throws IOException { ArrayList filePaths = new ArrayList<>(); while ((zipEntry = in.getNextEntry()) != null) { - if (zipEntry.getName().equals(XML_PATH_URI)) { + if (zipEntry.getName().equals(XML_PATH)) { // Read the first 5 bytes of the XML file to make sure it is in fact XML file // No further test of XML file necessary as XML-Converter is tested separately @@ -84,11 +85,11 @@ private void validateAASX(ByteArrayOutputStream byteStream) throws IOException { } // Write the paths of all files contained in the .aasx into filePaths - filePaths.add("file:///" + zipEntry.getName()); + filePaths.add(zipEntry.getName()); } - assertTrue(filePaths.contains(XML_PATH_URI)); - assertTrue(filePaths.contains(ORIGIN_PATH_URI)); + assertTrue(filePaths.contains(XML_PATH)); + assertTrue(filePaths.contains(ORIGIN_PATH)); // Check if all expected files are present // Needs to strip the first slash of the paths, as ZipEntry gives paths without diff --git a/dataformat-aasx/src/test/resources/jsonExample.json b/dataformat-aasx/src/test/resources/jsonExample.json index f6421ef44..26cd27970 100644 --- a/dataformat-aasx/src/test/resources/jsonExample.json +++ b/dataformat-aasx/src/test/resources/jsonExample.json @@ -192,7 +192,7 @@ }, "idShort": "DigitalFile_PDF", "mimeType": "application/pdf", - "value": "file:///aasx/OperatingManual.pdf" + "value": "/aasx/OperatingManual.pdf" } ] } From f339157ae8e09b8569098c371cffc3ca0977390e Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 27 Jun 2023 16:27:25 +0200 Subject: [PATCH 03/59] Update dataformat-core --- .../core/DataSpecificationInfo.java | 48 +++++++++++++++++++ .../aas4j/v3/model/TypedProperty.java | 2 + 2 files changed, 50 insertions(+) create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationInfo.java diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationInfo.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationInfo.java new file mode 100644 index 000000000..784b2d8e7 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationInfo.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +/** + * Class representing all information required for a (custom) data specification + */ +public class DataSpecificationInfo { + + private final Class type; + private final Reference reference; + private final String prefix; + + public DataSpecificationInfo(Class type, Reference reference, String prefix) { + this.type = type; + this.reference = reference; + this.prefix = prefix; + } + + public Class getType() { + return type; + } + + public Reference getReference() { + return reference; + } + + public String getPrefix() { + return prefix; + } +} diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java index dc5eed87f..748aa4bf9 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java @@ -15,6 +15,8 @@ */ package org.eclipse.digitaltwin.aas4j.v3.model; +import org.eclipse.digitaltwin.aas4j.v3.model.Property; + public interface TypedProperty extends Property { } From c62e54d8680c41c74602748462aa5956be12d540 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 29 Jun 2023 08:47:16 +0200 Subject: [PATCH 04/59] Update dataformat-core project --- .../dataformat/DeserializationException.java | 2 +- .../aas4j/v3/dataformat/Deserializer.java | 129 +++ .../v3/dataformat/SerializationException.java | 2 +- .../aas4j/v3/dataformat/Serializer.java | 119 +++ .../core/DataSpecificationManager.java | 108 +++ .../v3/dataformat/core/ReflectionHelper.java | 434 +++++++++ ...EmbeddedDataSpecificationDeserializer.java | 69 ++ .../deserialization/EnumDeserializer.java | 29 +- .../EmbeddedDataSpecificationSerializer.java | 85 ++ .../core/serialization/EnumSerializer.java | 68 +- .../v3/dataformat/core/util/AasUtils.java | 452 +++++++--- .../core/util/IdentifiableCollector.java | 69 ++ .../util/MostSpecificClassComparator.java | 36 + .../util/MostSpecificTypeTokenComparator.java | 37 + ...ssetAdministrationShellElementVisitor.java | 268 ++++++ ...ministrationShellElementWalkerVisitor.java | 271 ++++++ .../aas4j/v3/dataformat/mapping/Mapper.java | 27 + .../v3/dataformat/mapping/MappingContext.java | 40 + .../dataformat/mapping/MappingException.java | 32 + .../dataformat/mapping/MappingProvider.java | 136 +++ .../dataformat/mapping/SourceBasedMapper.java | 38 + .../dataformat/mapping/TargetBasedMapper.java | 38 + .../aas4j/v3/dataformat/core/AASFull.java | 840 +++++++++--------- .../aas4j/v3/dataformat/core/AASSimple.java | 185 ++-- .../v3/dataformat/core/AasUtilsTest.java | 52 ++ .../v3/dataformat/core/CustomProperty.java | 47 +- .../dataformat/core/EnumDeserializerTest.java | 72 +- .../dataformat/core/EnumSerializerTest.java | 73 +- 28 files changed, 2951 insertions(+), 807 deletions(-) create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java create mode 100644 dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java index 26e0f1868..f201050f7 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat; -@SuppressWarnings("serial") public class DeserializationException extends Exception { public DeserializationException(String msg) { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java new file mode 100644 index 000000000..fd5b0826c --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat; + +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.stream.Collectors; + +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; + +/** + * Generic deserializer interface to deserialize a given string, Outputstream or + * java.io.File into an instance of AssetAdministrationShellEnvironment + */ +public interface Deserializer { + + /** + * Default charset that will be used when no charset is specified + */ + Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + + /** + * Deserializes a given string into an instance of + * AssetAdministrationShellEnvironment + * + * @param value a string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + Environment read(String value) throws DeserializationException; + + /** + * Deserializes a given InputStream into an instance of + * AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * + * @param src an InputStream containing the string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + default Environment read(InputStream src) throws DeserializationException { + return read(src, DEFAULT_CHARSET); + } + + /** + * Deserializes a given InputStream into an instance of + * AssetAdministrationShellEnvironment using a given charset + * + * @param src An InputStream containing the string representation of the + * AssetAdministrationShellEnvironment + * @param charset the charset to use for deserialization + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + default Environment read(InputStream src, Charset charset) throws DeserializationException { + return read(new BufferedReader( + new InputStreamReader(src, charset)) + .lines() + .collect(Collectors.joining(System.lineSeparator()))); + } + + /** + * Deserializes a given File into an instance of + * AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * + * @param file A java.io.File containing the string representation of the + * AssetAdministrationShellEnvironment + * @param charset the charset to use for deserialization + * @return an instance of AssetAdministrationShellEnvironment + * @throws FileNotFoundException if file is not present + * @throws DeserializationException if deserialization fails + */ + default Environment read(java.io.File file, Charset charset) + throws FileNotFoundException, DeserializationException { + return read(new FileInputStream(file), charset); + } + + /** + * Deserializes a given File into an instance of + * AssetAdministrationShellEnvironment using a given charset + * + * @param file a java.io.File containing the string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws FileNotFoundException if the file is not present + * @throws DeserializationException if deserialization fails + */ + default Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { + return read(file, DEFAULT_CHARSET); + } + + /** + * Enables usage of custom implementation to be used for deserialization + * instead of default implementation, e.g. defining a custom implementation + * of the Submodel interface {@code class + * CustomSubmodel implements Submodel {}} and calling + * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will + * result in all instances of Submodel will be deserialized as + * CustomSubmodel. Subsequent class with the same aasInterface parameter + * will override the effects of all previous calls. + * + * @param the type of the interface to replace + * @param aasInterface the class of the interface to replace + * @param implementation the class implementing the interface that should be + * used for deserialization. + */ + void useImplementation(Class aasInterface, Class implementation); + +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java index 981d657cb..00ccc1b95 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat; -@SuppressWarnings("serial") public class SerializationException extends Exception { public SerializationException(String msg) { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java new file mode 100644 index 000000000..ef6fdbfb8 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat; + +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; + +/** + * Generic serializer interface to serialize an instance of + * AssetAdministrationShellEnvironment to a string, Outputstream or java.io.File + */ +public interface Serializer { + + /** + * Default charset that will be used when no charset is specified + */ + Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + + /** + * Serializes a given instance of AssetAdministrationShellEnvironment to + * string + * + * @param aasEnvironment the AssetAdministrationShellEnvironment to + * serialize + * @return the string representation of the environment + * @throws SerializationException if serialization fails + */ + String write(Environment aasEnvironment) throws SerializationException; + + /** + * Serializes a given instance of Environment to an + * OutputStream using DEFAULT_CHARSET + * + * @param out the Outputstream to serialize to + * @param aasEnvironment the Environment to + * serialize + * @throws IOException if writing to the stream fails + * @throws SerializationException if serialization fails + */ + default void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { + write(out, DEFAULT_CHARSET, aasEnvironment); + } + + /** + * Serializes a given instance of Environment to an + * OutputStream using given charset + * + * @param out the Outputstream to serialize to + * @param charset the Charset to use for serialization + * @param aasEnvironment the Environment to + * serialize + * @throws IOException if writing to the stream fails + * @throws SerializationException if serialization fails + */ + default void write(OutputStream out, Charset charset, Environment aasEnvironment) + throws IOException, SerializationException { + try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { + writer.write(write(aasEnvironment)); + } + } + + // Note that the AAS also defines a file class + /** + * Serializes a given instance of Environment to a + * java.io.File using DEFAULT_CHARSET + * + * @param file the java.io.File to serialize to + * @param charset the Charset to use for serialization + * @param aasEnvironment the Environment to + * serialize + * @throws FileNotFoundException if the fail does not exist + * @throws IOException if writing to the file fails + * @throws SerializationException if serialization fails + */ + default void write(java.io.File file, Charset charset, Environment aasEnvironment) + throws FileNotFoundException, IOException, SerializationException { + try (OutputStream out = new FileOutputStream(file)) { + write(out, charset, aasEnvironment); + } + } + + /** + * Serializes a given instance of Environment to a + * java.io.File using given charset + * + * @param file the java.io.File to serialize to + * @param aasEnvironment the Environment to + * serialize + * @throws FileNotFoundException if the fail does not exist + * @throws IOException if writing to the file fails + * @throws SerializationException if serialization fails + */ + default void write(java.io.File file, Environment aasEnvironment) + throws FileNotFoundException, IOException, SerializationException { + write(file, DEFAULT_CHARSET, aasEnvironment); + } + +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java new file mode 100644 index 000000000..0db3ae12a --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; +import java.util.Arrays; +import java.util.Objects; +import java.util.Optional; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import java.util.HashSet; +import java.util.Set; +import java.util.function.Predicate; + +/** + * This class is used to manage supported data specification templates. Each + * template is identified through a reference and a prefix and provides a + * corresponding Java class. + */ +public class DataSpecificationManager { + + public static final String PROP_DATA_SPECIFICATION = "dataSpecification"; + public static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationContent"; + public static final String DATA_SPECIFICATION_IEC61360_IRI = "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0"; + public static final String DATA_SPECIFICATION_IEC61360_PREFIX = "IEC"; + + private static final Set KNOWN_IMPLEMENTATIONS = new HashSet<>(Arrays.asList( + // new DataSpecificationInfo(DataSpecificationIEC61360.class, + // createGlobalIri(DATA_SPECIFICATION_IEC61360_IRI), + // DATA_SPECIFICATION_IEC61360_PREFIX) + )); + + /** + * Allows to register an additional data specification template + * + * @param dataSpecification Details of the data specification template to + * register + */ + public static void register(DataSpecificationInfo dataSpecification) { + KNOWN_IMPLEMENTATIONS.add(dataSpecification); + } + + private static Reference createGlobalIri(String iri) { + return new DefaultReference.Builder().keys(Arrays.asList( + new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value(iri).build())) + .build(); + } + + /** + * Returns a DataSpecificationInfo describing the data specification + * template implemented by the given class. If the class is unknown, null is + * returned. + * + * @param implementation type of the implementation class + * @return a DataSpecificationInfo describing the data specification + * template represented by the given class, or null if the implementation + * class does not represent any data specification + */ + public static DataSpecificationInfo getDataSpecification(Class implementation) { + DataSpecificationInfo result = getDataSpecification(x -> Objects.equals(x.getType(), implementation)); + if (result == null) { + result = getDataSpecification(x -> x.getType().isAssignableFrom(implementation)); + } + return result; + } + + /** + * Returns a DataSpecificationInfo describing the data specification + * template implemented by the given class. If the class is unknown, null is + * returned. + * + * @param reference Reference associated with the wanted data specficiation + * @return a DataSpecificationInfo describing the data specification + * template represented by the reference, or null if the reference does not + * represent any data specification + */ + public static DataSpecificationInfo getDataSpecification(Reference reference) { + return getDataSpecification(x -> AasUtils.sameAs(x.getReference(), reference)); + } + + private static DataSpecificationInfo getDataSpecification(Predicate filter) { + Optional exactMatch = KNOWN_IMPLEMENTATIONS.stream() + .filter(filter) + .findFirst(); + if (exactMatch.isPresent()) { + return exactMatch.get(); + } + return null; + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java new file mode 100644 index 000000000..a88291966 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java @@ -0,0 +1,434 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; + +import com.google.common.reflect.TypeToken; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.MostSpecificTypeTokenComparator; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import org.apache.commons.lang3.ClassUtils; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import io.github.classgraph.ClassGraph; +import io.github.classgraph.ClassInfo; +import io.github.classgraph.ClassInfoList; +import io.github.classgraph.ScanResult; + +/** + * Helper class to collect relevant data needed for + * ReflectionAnnotationIntrospector via reflection. + */ +public class ReflectionHelper { + + private static final Logger logger = LoggerFactory.getLogger(ReflectionHelper.class); + private static final String ROOT_PACKAGE_NAME = "org.eclipse.digitaltwin.aas4j.v3"; + /** + * Name of package where the generated model classes are defined + */ + public static final String MODEL_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".model"; + /** + * Name of package where the generated default implementation files are + * defined + */ + public static final String DEFAULT_IMPLEMENTATION_PACKAGE_NAME = MODEL_PACKAGE_NAME + ".impl"; + /** + * Name of package where the json mixins are defined. These mixins are + * automatically added to JsonSerializer and JsonDeserializer. + */ + public static final String JSON_MIXINS_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".dataformat.json.mixins"; + /** + * Name of package where the xml mixins are defined. These mixins are + * automatically added to XmlSerializer and XmlDeserializer. + */ + public static final String XML_MIXINS_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".dataformat.xml.mixins"; + /** + * Suffix that identifies a class as a mixin. + */ + public static final String MIXIN_SUFFIX = "Mixin"; + /** + * Prefix that defines a class as a default implementation + */ + public static final String DEFAULT_IMPLEMENTATION_PREFIX = "Default"; + /** + * Distinct root superclasses of which classify a class to include type + * information via the modelType property + */ + public static final Set> MODEL_TYPE_SUPERCLASSES = Set.of(Referable.class, DataSpecificationContent.class); + /** + * Expanded list of all classes that shall be annotated with the modelType + * property. + */ + public static final Set> TYPES_WITH_MODEL_TYPE; + /** + * Map of all interfaces and their subinterfaces defined in the + * MODEL_PACKAGE_NAME package. + */ + public static final Map, Set>> SUBTYPES; + /** + * List of all interfaces classes defined by the AAS. + */ + public static final Set INTERFACES; + /** + * Expanded list of all mixin classes defined in the + * JSON_MIXINS_PACKAGE_NAME package together with the corresponding class + * they should be applied to. + */ + public static final Map, Class> JSON_MIXINS; + /** + * Expanded list of all mixin classes defined in the XML_MIXINS_PACKAGE_NAME + * package together with the corresponding class they should be applied to. + */ + public static final Map, Class> XML_MIXINS; + /** + * Expanded list of all default implementations in the + * DEFAULT_IMPLEMENTATION_PACKAGE_NAME package together with the interface + * from the MODEL_PACKAGE_NAME package they are implementing. + */ + public static final List DEFAULT_IMPLEMENTATIONS; + /** + * List of interfaces from the MODEL_PACKAGE_NAME package that are known to + * not have any default implementation and therefore are excluded + * explicitely. + */ + public static final Set> INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION; + /** + * List of enums from the MODEL_PACKAGE_NAME package. + */ + public static final List> ENUMS; + + public static class ImplementationInfo { + + private final Class interfaceType; + private final Class implementationType; + + protected ImplementationInfo(Class interfaceType, Class implementationType) { + this.interfaceType = interfaceType; + this.implementationType = implementationType; + } + + public Class getInterfaceType() { + return interfaceType; + } + + public Class getImplementationType() { + return implementationType; + } + } + + /** + * Returns whether the given class is an interface and from within the + * MODEL_PACKAGE_NAME package + * + * @param type the class to check + * @return whether the given class is an interface and from within the + * MODEL_PACKAGE_NAME package + */ + public static boolean isModelInterface(Class type) { + return type.isInterface() && MODEL_PACKAGE_NAME.equals(type.getPackageName()); + } + + /** + * Returns whether the given class is a default implementation or not + * + * @param type the class to check + * @return whether the given class is a default implementation or not + */ + public static boolean isDefaultImplementation(Class type) { + return DEFAULT_IMPLEMENTATIONS.stream().anyMatch(x -> Objects.equals(x.getImplementationType(), type)); + } + + /** + * Returns whether the given interface has a default implementation or not + * + * @param interfaceType the interface to check + * @return whether the given interface has a default implementation or not + */ + public static boolean hasDefaultImplementation(Class interfaceType) { + return DEFAULT_IMPLEMENTATIONS.stream().anyMatch(x -> x.getInterfaceType().equals(interfaceType)); + } + + /** + * Returns the default implementation for an aas interface or null if the + * class is no aas interface or does not have default implementation + * + * @param interfaceType the interface to check + * @return the default implementation type for given interfaceType or null + * if the class is no aas interface or does not have default implementation + */ + public static Class getDefaultImplementation(Class interfaceType) { + if (isDefaultImplementation(interfaceType)) { + return interfaceType; + } + if (hasDefaultImplementation(interfaceType)) { + return DEFAULT_IMPLEMENTATIONS.stream() + .filter(x -> x.getInterfaceType().equals(interfaceType)) + .findFirst().get() + .getImplementationType(); + } + return null; + } + + /** + * Returns whether the given class is an interface from within the + * MODEL_PACKAGE_NAME package as well as a default implementation or not + * + * @param type the class to check + * @return whether the given class is an interface from within the + * MODEL_PACKAGE_NAME package as well as a default implementation or not + */ + public static boolean isModelInterfaceOrDefaultImplementation(Class type) { + return isModelInterface(type) || isDefaultImplementation(type); + } + + public static Class getAasInterface(Class type) { + Set> implementedAasInterfaces = getAasInterfaces(type); + if (implementedAasInterfaces.isEmpty()) { + return null; + } + if (implementedAasInterfaces.size() == 1) { + return implementedAasInterfaces.iterator().next(); + } + logger.warn("class '{}' implements more than one AAS interface, but only most specific one is returned", type.getName()); + return implementedAasInterfaces.stream().map(x -> TypeToken.of(x)) + .sorted(new MostSpecificTypeTokenComparator()) + .findFirst().get() + .getRawType(); + } + + public static Set> getAasInterfaces(Class type) { + Set> result = new HashSet<>(); + if (type != null) { + if (INTERFACES.contains(type)) { + result.add(type); + } + result.addAll(ClassUtils.getAllInterfaces(type).stream().filter(x -> INTERFACES.contains(x)).collect(Collectors.toSet())); + } + return result; + } + + /** + * Returns the AAS type information used for de-/serialization for a given + * class or null if type information should not be included + * + * @param clazz the class to find the type information for + * @return the type information for the given class or null if there is no + * type information or type information should not be included + */ + public static String getModelType(Class clazz) { + Class type = getMostSpecificTypeWithModelType(clazz); + if (type != null) { + return type.getSimpleName(); + } + for (Class interfaceClass : clazz.getInterfaces()) { + String result = getModelType(interfaceClass); + if (result != null) { + return result; + } + } + Class superClass = clazz.getSuperclass(); + if (superClass != null) { + return getModelType(superClass); + } + return null; + } + + /** + * Returns the most specific supertype that contains some AAS type + * information or null if there is none + * + * @param clazz the class to find the type for + * @return the most specific supertype of given class that contains some AAS + * type information or null if there is none + */ + public static Class getMostSpecificTypeWithModelType(Class clazz) { + if (clazz == null) { + return null; + } + return TYPES_WITH_MODEL_TYPE.stream() + .filter(x -> clazz.isInterface() ? x.equals(clazz) : x.isAssignableFrom(clazz)) + .sorted((Class o1, Class o2) -> { + // -1: o1 more special than o2 + // 0: o1 equals o2 or on same samelevel + // 1: o2 more special than o1 + if (o1.isAssignableFrom(o2)) { + if (o2.isAssignableFrom(o1)) { + return 0; + } + return 1; + } + if (o2.isAssignableFrom(o1)) { + return -1; + } + return 0; + }) + .findFirst() + .orElse(null); + } + + static { + ScanResult modelScan = new ClassGraph() + .enableClassInfo() + .acceptPackagesNonRecursive(MODEL_PACKAGE_NAME) + .scan(); + TYPES_WITH_MODEL_TYPE = scanModelTypes(modelScan); + SUBTYPES = scanSubtypes(modelScan); + JSON_MIXINS = scanMixins(modelScan, JSON_MIXINS_PACKAGE_NAME); + XML_MIXINS = scanMixins(modelScan, XML_MIXINS_PACKAGE_NAME); + DEFAULT_IMPLEMENTATIONS = scanDefaultImplementations(modelScan); + INTERFACES = scanAasInterfaces(); + ENUMS = modelScan.getAllEnums().loadClasses(Enum.class); + INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION = getInterfacesWithoutDefaultImplementation(modelScan); + } + + private static Set> getInterfacesWithoutDefaultImplementation(ScanResult modelScan) { + return modelScan.getAllInterfaces().loadClasses().stream() + .filter(x -> !hasDefaultImplementation(x)) + .collect(Collectors.toSet()); + } + + public static Set> getSuperTypes(Class clazz, boolean recursive) { + Set> result = SUBTYPES.entrySet().stream() + .filter(x -> x.getValue().contains(clazz)) + .map(x -> x.getKey()) + .collect(Collectors.toSet()); + if (recursive) { + result.addAll(result.stream() + .flatMap(x -> getSuperTypes(x, true).stream()) + .collect(Collectors.toSet())); + } + return result; + } + + private static List scanDefaultImplementations(ScanResult modelScan) { + ScanResult defaulImplementationScan = new ClassGraph() + .enableClassInfo() + .acceptPackagesNonRecursive(DEFAULT_IMPLEMENTATION_PACKAGE_NAME) + .scan(); + List defaultImplementations = new ArrayList<>(); + defaulImplementationScan.getAllClasses() + .filter(x -> x.getSimpleName().startsWith(DEFAULT_IMPLEMENTATION_PREFIX)) + .loadClasses() + .stream() + .forEach(x -> { + String interfaceName = x.getSimpleName().substring(DEFAULT_IMPLEMENTATION_PREFIX.length());// using conventions + ClassInfoList interfaceClassInfos = modelScan.getAllClasses().filter(y -> y.isInterface() && Objects.equals(y.getSimpleName(), interfaceName)); + if (interfaceClassInfos.isEmpty()) { + logger.warn("could not find interface realized by default implementation class '{}'", x.getSimpleName()); + } else { + Class implementedClass = interfaceClassInfos.get(0).loadClass(); + defaultImplementations.add(new ImplementationInfo(implementedClass, x)); + logger.debug("using default implementation class '{}' for interface '{}'", + x.getSimpleName(), + interfaceClassInfos.get(0).getName()); + + } + }); + return defaultImplementations; + } + + private static Set scanAasInterfaces() { + return DEFAULT_IMPLEMENTATIONS.stream().map(x -> x.interfaceType).collect(Collectors.toSet()); + } + + private static Map, Class> scanMixins(ScanResult modelScan, String packageName) { + ScanResult mixinScan = new ClassGraph() + .enableClassInfo() + .acceptPackagesNonRecursive(packageName) + .scan(); + Map, Class> mixins = new HashMap<>(); + mixinScan.getAllClasses() + .filter(x -> x.getSimpleName().endsWith(MIXIN_SUFFIX)) + .loadClasses() + .forEach(x -> { + String modelClassName = x.getSimpleName().substring(0, x.getSimpleName().length() - MIXIN_SUFFIX.length()); + ClassInfoList modelClassInfos = modelScan.getAllClasses().filter(y -> Objects.equals(y.getSimpleName(), modelClassName)); + if (modelClassInfos.isEmpty()) { + logger.warn("could not auto-resolve target class for mixin '{}'", x.getSimpleName()); + } else { + mixins.put(modelClassInfos.get(0).loadClass(), x); + logger.debug("using mixin '{}' for class '{}'", + x.getSimpleName(), + modelClassInfos.get(0).getName()); + } + }); + return mixins; + } + + private static Map, Set>> scanSubtypes(ScanResult modelScan) { + return modelScan.getAllInterfaces().stream() + .filter(ReflectionHelper::hasSubclass) + .collect(Collectors.toMap(ClassInfo::loadClass, ReflectionHelper::getSubclasses)); + } + + private static Set> getSubclasses(ClassInfo clazzInfo) { + return clazzInfo.getClassesImplementing() + .directOnly() + .filter(ClassInfo::isInterface) + .loadClasses() + .stream() + .collect(Collectors.toSet()); + } + + private static boolean hasSubclass(ClassInfo clazzInfo) { + return !getSubclasses(clazzInfo).isEmpty(); + } + + private static Set> scanModelTypes(ScanResult modelScan) { + Set> typesWithModelTypes; + typesWithModelTypes = MODEL_TYPE_SUPERCLASSES.stream() + .flatMap(x -> modelScan.getClassesImplementing(x.getName()).loadClasses().stream()) + .collect(Collectors.toSet()); + typesWithModelTypes.addAll(MODEL_TYPE_SUPERCLASSES); + return typesWithModelTypes; + } + + private ReflectionHelper() { + } + + /** + * Overrides empty list fields with null + * @param element + */ + public static void setEmptyListsToNull(Object element) { + + Field[] fields = element.getClass().getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + Field field = fields[i]; + field.setAccessible(true); + try { + if (field.getType().isAssignableFrom(List.class) && field.get(element)!=null && ((List) field.get(element)).isEmpty()) { + field.set(element, null); + } + } catch (IllegalAccessException e) { + // do nothing + } + field.setAccessible(false); + } + + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java new file mode 100644 index 000000000..64f8d4a15 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization; + +// import org.eclipse.digitaltwin.aas4j.v3.rc02.model.EmbeddedDataSpecification; +// import org.eclipse.digitaltwin.aas4j.v3.rc02.model.impl.DefaultEmbeddedDataSpecification; + +// TODO: Update handling of embeddedDataSpecifications +// Currently we expect the following format +// +// "embeddedDataSpecifications": [ +// "embeddedDataSpecifications": {...}, // reference indicating the type +// "dataSpecificationContent": {...} // actual data specification +// ] +// +// In the future, either embeddedDataSpecifications or dataSpecificationContent should be present. +// However, it is still undefined how the actual (sub-)type of dataSpecificationContent should be serialized, so this cannot be implemented right now. +// Therefore, this functionality is currently disabled until standardization progresses. + +/** + * Custom Deserializer for class DataSpecification. First reads property + * PROP_DATA_SPECIFICATION and tries to resolve which Java class to use for + * deserialization based on the found value with the help of + * DataSpecificationManager. + */ +/* public class EmbeddedDataSpecificationDeserializer extends JsonDeserializer { + + @Override + public EmbeddedDataSpecification deserialize(JsonParser parser, DeserializationContext context) + throws IOException, JsonProcessingException { + Object temp = parser.getCodec().readTree(parser); + ObjectNode node = (ObjectNode) temp; + if (node == null) { + return null; + } + JsonNode nodeDataSpecification = node.get(PROP_DATA_SPECIFICATION); + if (nodeDataSpecification == null) { + throw new JsonMappingException(parser, + String.format("data specification must contain node '%s'", PROP_DATA_SPECIFICATION)); + } + JsonParser parserReference = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeDataSpecification); + parserReference.nextToken(); + Reference reference = parserReference.readValueAs(Reference.class); + JsonNode nodeContent = node.get(PROP_DATA_SPECIFICATION_CONTENT); + if (nodeContent != null) { + Class targetClass = DataSpecificationManager.getDataSpecification(reference).getType(); + JsonParser parserContent = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeContent); + parserContent.nextToken(); + DataSpecificationContent content = parserContent.readValueAs(targetClass); + return new DefaultEmbeddedDataSpecification.Builder().dataSpecificationContent(content).build(); + } + return new DefaultEmbeddedDataSpecification.Builder().dataSpecification(reference).build(); + } +} +*/ \ No newline at end of file diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java index 76ba4040b..b087fab00 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +22,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; /** * Deserializes enum values converting element names from UpperCamelCase to @@ -28,7 +30,7 @@ * * @param Type of enum to deserialize */ -public class EnumDeserializer> extends JsonDeserializer { +public class EnumDeserializer extends JsonDeserializer { protected final Class type; @@ -46,30 +48,7 @@ public T deserialize(JsonParser parser, DeserializationContext context) throws I value = value.substring(0, 1).toUpperCase() + value.substring(1); } - return Enum.valueOf(type, deserializeEnumName(value)); + return (T) Enum.valueOf(type, AasUtils.deserializeEnumName(value)); } - /** - * Translates an enum value from CamelCase to SCREAMING_SNAKE_CASE - * - * @param input - * input name in CamelCase - * @return name in SCREAMING_SNAKE_CASE - */ - public static String deserializeEnumName(String input) { - String result = ""; - if (input == null || input.isEmpty()) { - return result; - } - result += Character.toUpperCase(input.charAt(0)); - for (int i = 1; i < input.length(); i++) { - char currentChar = input.charAt(i), previousChar = input.charAt(i - 1); - if (Character.isUpperCase(currentChar) && Character.isLowerCase(previousChar)) { - result += "_"; - } - result += Character.toUpperCase(currentChar); - } - return result; - } - } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java new file mode 100644 index 000000000..3fd5b8c4a --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization; + +// TODO: import org.eclipse.digitaltwin.aas4j.v3.rc02.model.EmbeddedDataSpecification; + + +/** + * Custom Serializer for class DataSpecification. Adds type information in form + * of a reference. Uses DataSpecificationManager to resolve java type to + * reference. + */ + +// TODO: Solve the problem with EmbeddedDataSpecifications +/*public class EmbeddedDataSpecificationSerializer extends JsonSerializer { + + private static final Logger logger = LoggerFactory.getLogger(EmbeddedDataSpecificationSerializer.class); + + @Override + public void serialize(EmbeddedDataSpecification data, JsonGenerator generator, SerializerProvider provider) + throws IOException { + if (data == null) { + return; + } + Reference reference = null; + DataSpecificationContent content = data.getDataSpecificationContent(); + if (content != null) { + DataSpecificationInfo implicitDataSpecification = DataSpecificationManager.getDataSpecification(content.getClass()); + Reference implicitType = implicitDataSpecification != null ? implicitDataSpecification.getReference() : null; + Reference explicitType = data.getDataSpecification(); + if (implicitType == null) { + logger.warn( + "Trying to serialize unknown implementation of DataSpecificationContent ({}). " + + "Use DataSpecificationManager.register(Reference reference, Class implementation) " + + "to register your implementation", + content.getClass()); + if (explicitType == null) { + logger.warn("Missing type information for DataSpecificationContent! Will be serialized without type information."); + } else { + reference = explicitType; + } + } else { + reference = implicitType; + if (explicitType != null && !Objects.equals(implicitType, explicitType)) { + logger.warn("Conflicting type information for DataSpecificationContent (implicit type: {}, explicit type: {}). Explicit type will be used.", + implicitType, explicitType); + reference = explicitType; + } + } + } + if (reference != null || content != null) { + generator.writeStartObject(); + } + if (reference != null) { + generator.writeObjectField(PROP_DATA_SPECIFICATION, reference); + } + if (content != null) { + generator.writeObjectField(PROP_DATA_SPECIFICATION_CONTENT, content); + } + if (reference != null || content != null) { + generator.writeEndObject(); + } + } + + @Override + public void serializeWithType(EmbeddedDataSpecification data, JsonGenerator generator, SerializerProvider provider, TypeSerializer typedSerializer) + throws IOException, JsonProcessingException { + serialize(data, generator, provider); + } + +}*/ diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index bc015d93e..c0f3631a5 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,81 +18,45 @@ import java.io.IOException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.Direction; -import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.Direction; +import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; /** * Serializes enum values. If enum is part of the AAS Java model, the name will * be converted from SCREAMING_SNAKE_CASE to UpperCamelCase, else default * serialization will be used */ -@SuppressWarnings("rawtypes") public class EnumSerializer extends JsonSerializer { - @Override - public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { + protected static final char UNDERSCORE = '_'; + + @Override + public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { if (value instanceof DataTypeDefXsd) { // only for the DataTypeDefXsd notation if (value.equals(DataTypeDefXsd.ANY_URI)) { gen.writeString("xs:anyURI"); } else if (value.equals(DataTypeDefXsd.NON_NEGATIVE_INTEGER)) { - gen.writeString("xs:nonNegativeInteger"); - } else if(isTimeRelatedValue(value)) { - handleTimeRelatedValue(gen, value); + gen.writeString("xs:NonNegativeInteger"); } else { // pattern: 'xs:' + camelCase - String enum_string = serializeEnumName(value.name()); + String enum_string = AasUtils.serializeEnumName(value.name()); gen.writeString("xs:" + enum_string.substring(0, 1).toLowerCase() + enum_string.substring(1)); } - } else if (value instanceof DataTypeIec61360) { - gen.writeString(value.name().toUpperCase()); - } else if (value instanceof Direction || value instanceof StateOfEvent) { - gen.writeString(value.name().toLowerCase()); + } else if (value instanceof DataTypeIEC61360 || value instanceof Direction || value instanceof StateOfEvent) { + gen.writeString(value.name()); } else if (ReflectionHelper.ENUMS.contains(value.getClass())) { - gen.writeString(serializeEnumName(value.name())); + gen.writeString(AasUtils.serializeEnumName(value.name())); } else { provider.findValueSerializer(Enum.class).serialize(value, gen, provider); } } - private void handleTimeRelatedValue(JsonGenerator gen, Enum value) throws IOException { - String enum_string = serializeEnumName(value.name()); - String adaptedEnumString = "xs:g" + enum_string.substring(1, 2).toUpperCase() + enum_string.substring(2); - gen.writeString(adaptedEnumString); - } - - private boolean isTimeRelatedValue(Enum value) { - String enum_string = serializeEnumName(value.name()); - return enum_string.startsWith("G"); - } - - /** - * Translates an enum value from SCREAMING_SNAKE_CASE to CamelCase - * - * @param input - * input name in SCREAMING_SNAKE_CASE - * @return name in CamelCase - */ - public static String serializeEnumName(String input) { - String result = ""; - boolean capitalize = true; - for (int i = 0; i < input.length(); i++) { - char currentChar = input.charAt(i); - if ('_' == currentChar) { - capitalize = true; - } else { - result += capitalize ? currentChar : Character.toLowerCase(currentChar); - capitalize = false; - } - } - return result; - } - } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index 46985b03e..cd3b04514 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,38 +16,24 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; +import com.google.common.reflect.TypeToken; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; +import java.lang.reflect.Type; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.IdentifiableCollector; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.MostSpecificTypeTokenComparator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.Operation; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.reflect.TypeToken; - /** * Provides utility functions related to AAS */ @@ -55,29 +41,176 @@ public class AasUtils { private static final Logger log = LoggerFactory.getLogger(AasUtils.class); - private static final String REFERENCE_ELEMENT_DELIMITER = ", "; + private static final char UNDERSCORE = '_'; + private static final String KEY_REGEX_GROUP_TYPE = "type"; + private static final String KEY_REGEX_GROUP_ID_TYPE = "idtype"; + private static final String KEY_REGEX_GROUP_VALUE = "value"; + private static final Pattern KEY_REGEX = Pattern.compile( + String.format("\\((?<%s>\\w+)\\)\\[(?<%s>\\w+)\\](?<%s>.*)", + KEY_REGEX_GROUP_TYPE, + KEY_REGEX_GROUP_ID_TYPE, + KEY_REGEX_GROUP_VALUE)); private AasUtils() { } - /** - * Formats a Reference as string - * - * @param reference - * Reference to serialize - * @return string representation of the reference for serialization, null if - * reference is null - */ - private static String asString(Reference reference) { - if (reference == null) { - return null; - } - return String.format("[%s]%s", reference.getType(), - reference.getKeys().stream().map(x -> String.format("(%s)%s", EnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); - } + /** + * Formats a Reference as string + * + * @param reference Reference to serialize + * @return string representation of the reference for serialization, null if + * reference is null + */ + public static String asString(Reference reference) { + if (reference == null) { + return null; + } + return reference.getKeys().stream() + .map(x -> String.format("(%s)[%s]%s", + serializeEnumName(x.getType().name()), + x.getValue())) + .collect(Collectors.joining(",")); + } + + /** + * Parses a given string as Reference. If the given string is not a valid + * reference, null is returned. + * + * @param value String representation of the reference + * @return parsed Reference or null is given value is not a valid Reference + */ + public static Reference parseReference(String value) { + return parseReference(value, + ReflectionHelper.getDefaultImplementation(Reference.class), + ReflectionHelper.getDefaultImplementation(Key.class)); + } + + /** + * Parses a given string as Reference using the provided implementation of + * Reference and Key interface. If the given string is not a valid + * reference, null is returned. + * + * @param value String representation of the reference + * @param referenceType implementation type of Reference interface + * @param keyType implementation type of Key interface + * @return parsed Reference or null is given value is not a valid Reference + */ + public static Reference parseReference(String value, Class referenceType, Class keyType) { + if (value == null || value.isBlank()) { + return null; + } + try { + Reference result = referenceType.getConstructor().newInstance(); + result.setKeys(Stream.of(value.split(",")).map(x -> parseKey(x)).collect(Collectors.toList())); + // TODO: ReferenceType is ignored + // result.setType(Stream.of(value.split(",")).map(x -> parseReferenceType(x)).collect(Collectors.toList())); + return result; + } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new IllegalArgumentException("error parsing reference - could not instantiate reference type", ex); + } + } + + /** + * Gets property with given name as defined in type of given parent or null + * if not defined + * + * @param parent parent object + * @param propertyName name of the property + * @return property with given name as defined in type of given parent or + * null if not defined + */ + public static PropertyDescriptor getProperty(Object parent, String propertyName) { + if (parent == null || propertyName == null || propertyName.isBlank()) { + return null; + } + return getAasProperties(parent.getClass()).stream() + .filter(x -> x.getName().equals(propertyName)) + .findAny() + .orElse(null); + } + + /** + * Gets the content type of a generic collection type + * + * @param genericCollectionType the generic collection type + * @return the content type of the generic collection type + */ + public static Class getCollectionContentType(Type genericCollectionType) { + return TypeToken.of(genericCollectionType).resolveType(Collection.class.getTypeParameters()[0]).getRawType(); + } + + /** + * Gets property with given name as defined in given type or null if not + * defined + * + * @param type type containing the property + * @param propertyName name of the property + * @return property with given name as defined in given type or null if not + * defined + */ + public static PropertyDescriptor getProperty(Class type, String propertyName) { + if (type == null || propertyName == null || propertyName.isBlank()) { + return null; + } + return getAasProperties(type).stream() + .filter(x -> x.getName().equals(propertyName)) + .findAny() + .orElse(null); + } + + /** + * Parses a given string as Key. If the given string is not a valid key, + * null is returned. + * + * @param value String representation of the key + * @return parsed Key or null is given value is not a valid Key + */ + public static Key parseKey(String value) { + Matcher matcher = KEY_REGEX.matcher(value); + if (matcher.find()) { + KeyTypes keyType = KeyTypes.valueOf(deserializeEnumName(matcher.group(KEY_REGEX_GROUP_ID_TYPE))); + return new DefaultKey.Builder() + .type(keyType) + .value(matcher.group(KEY_REGEX_GROUP_VALUE)) + .build(); + } + return null; + } /** - * Creates a reference for an Identifiable instance using provided implementation types for reference and key + * Checks if a reference is a local reference or not. This functionality may + * not be 100% correct as since v3.0RC01 of the AAS specification there no + * longer is an isLocal property to check this and no alternative way to + * determine whether a reference is local or not is introduced. This method + * only checks for the presence of any Key with type GLOBAL_REFERENCE. + * Another approach would be to actually try resolving the reference + * locally. + * + * @param reference The reference to check + * @param environment The environment context the reference resides. In + * current implementation this is not used + * @return true if the reference is a local reference to the given + * environment, false otherwise + */ + public static boolean isLocal(Reference reference, Environment environment) { + return !reference.getKeys().stream().anyMatch(x -> x.getType() == KeyTypes.GLOBAL_REFERENCE); + } + + public static List getSubmodelTemplates(AssetAdministrationShell aas, Environment environment) { + return aas.getSubmodels().stream() + .map(ref -> resolve(ref, environment, Submodel.class)) + .filter(sm -> sm != null) + .filter(sm -> sm.getKind() != ModelingKind.INSTANCE) + .collect(Collectors.toList()); + } + + public static boolean hasTemplate(AssetAdministrationShell aas, Environment environment) { + return !getSubmodelTemplates(aas, environment).isEmpty(); + } + + /** + * Creates a reference for an Identifiable instance using provided + * implementation types for reference and key * * @param identifiable the identifiable to create the reference for * @param referenceType implementation type of Reference interface @@ -87,7 +220,6 @@ private static String asString(Reference reference) { public static Reference toReference(Identifiable identifiable, Class referenceType, Class keyType) { try { Reference reference = referenceType.getConstructor().newInstance(); - reference.setType(ReferenceTypes.MODEL_REFERENCE); Key key = keyType.getConstructor().newInstance(); key.setType(referableToKeyType(identifiable)); key.setValue(identifiable.getId()); @@ -112,44 +244,93 @@ public static Reference toReference(Identifiable identifiable) { * Gets the KeyElements type matching the provided Referable * * @param referable The referable to convert to KeyElements type - * @return the most specific KeyElements type representing the Referable, i.e. abstract types like SUBMODEL_ELEMENT - * or DATA_ELEMENT are never returned; null if there is no corresponding KeyElements type + * @return the most specific KeyElements type representing the Referable, + * i.e. abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT are never + * returned; null if there is no corresponding KeyElements type */ public static KeyTypes referableToKeyType(Referable referable) { Class aasInterface = ReflectionHelper.getAasInterface(referable.getClass()); if (aasInterface != null) { - return KeyTypes.valueOf(EnumDeserializer.deserializeEnumName(aasInterface.getSimpleName())); + return KeyTypes.valueOf(deserializeEnumName(aasInterface.getSimpleName())); } return null; } + /** + * Translates an enum value from SCREAMING_SNAKE_CASE to CamelCase + * + * @param input input name in SCREAMING_SNAKE_CASE + * @return name in CamelCase + */ + public static String serializeEnumName(String input) { + String result = ""; + boolean capitalize = true; + for (int i = 0; i < input.length(); i++) { + char currentChar = input.charAt(i); + if (UNDERSCORE == currentChar) { + capitalize = true; + } else { + result += capitalize + ? currentChar + : Character.toLowerCase(currentChar); + capitalize = false; + } + } + return result; + } + + /** + * Translates an enum value from CamelCase to SCREAMING_SNAKE_CASE + * + * @param input input name in CamelCase + * @return name in SCREAMING_SNAKE_CASE + */ + public static String deserializeEnumName(String input) { + String result = ""; + if (input == null || input.isEmpty()) { + return result; + } + result += Character.toUpperCase(input.charAt(0)); + for (int i = 1; i < input.length(); i++) { + char currentChar = input.charAt(i), + previousChar = input.charAt(i - 1); + if (Character.isUpperCase(currentChar) && Character.isLowerCase(previousChar)) { + result += UNDERSCORE; + } + result += Character.toUpperCase(currentChar); + } + return result; + } + /** * Gets a Java interface representing the type provided by key. * * @param key The KeyElements type - * @return a Java interface representing the provided KeyElements type or null if no matching Class/interface could - * be found. It also returns abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT + * @return a Java interface representing the provided KeyElements type or + * null if no matching Class/interface could be found. It also returns + * abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT */ - private static Class keyTypeToClass(KeyTypes key) { + public static Class keyTypeToClass(KeyTypes key) { return Stream.concat(ReflectionHelper.INTERFACES.stream(), ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream()) - .filter(x -> x.getSimpleName().equals(EnumSerializer.serializeEnumName(key.name()))) + .filter(x -> x.getSimpleName().equals(serializeEnumName(key.name()))) .findAny() .orElse(null); } /** - * Creates a reference for an element given a potential parent using provided implementation types for reference and - * key + * Creates a reference for an element given a potential parent using + * provided implementation types for reference and key * - * @param parent Reference to the parent. Can only be null when element is instance of Identifiable, otherwise - * result will always be null + * @param parent Reference to the parent. Can only be null when element is + * instance of Identifiable, otherwise result will always be null * @param element the element to create a reference for * @param referenceType implementation type of Reference interface * @param keyType implementation type of Key interface * - * @return A reference representing the element or null if either element is null or parent is null and element not - * an instance of Identifiable. In case element is an instance of Identifiable, the returned reference will only - * contain one key pointing directly to the element. + * @return A reference representing the element or null if either element is + * null or parent is null and element not an instance of Identifiable. In + * case element is an instance of Identifiable, the returned reference will + * only contain one key pointing directly to the element. */ public static Reference toReference(Reference parent, Referable element, Class referenceType, Class keyType) { if (element == null) { @@ -175,12 +356,13 @@ public static Reference toReference(Reference parent, Referable element, Class referenceType, Class keyType) { + public static Reference clone(Reference reference, Class referenceType, Class keyType) { if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } try { Reference result = referenceType.getConstructor().newInstance(); List newKeys = new ArrayList<>(); - result.setType(reference.getType()); for (Key key : reference.getKeys()) { Key newKey = keyType.getConstructor().newInstance(); newKey.setType(key.getType()); @@ -256,13 +449,15 @@ private static Reference clone(Reference reference, Class r } /** - * Resolves a Reference within an AssetAdministrationShellEnvironment and returns the targeted object if available, - * null otherwise + * Resolves a Reference within an AssetAdministrationShellEnvironment and + * returns the targeted object if available, null otherwise * * * @param reference The reference to resolve - * @param env The AssetAdministrationShellEnvironment to resolve the reference against - * @return returns an instance of T if the reference could successfully be resolved, otherwise null + * @param env The AssetAdministrationShellEnvironment to resolve the + * reference against + * @return returns an instance of T if the reference could successfully be + * resolved, otherwise null * @throws IllegalArgumentException if something goes wrong while resolving */ public static Referable resolve(Reference reference, Environment env) { @@ -270,18 +465,21 @@ public static Referable resolve(Reference reference, Environment env) { } /** - * Resolves a Reference within an AssetAdministrationShellEnvironment and returns the targeted object if available, - * null otherwise + * Resolves a Reference within an AssetAdministrationShellEnvironment and + * returns the targeted object if available, null otherwise * - * @param sub-type of Referable of the targeted type. If unknown use Referable.class + * @param sub-type of Referable of the targeted type. If unknown use + * Referable.class * @param reference The reference to resolve - * @param env The AssetAdministrationShellEnvironment to resolve the reference against - * @param type desired return type, use Referable.class is unknwon/not needed - * @return returns an instance of T if the reference could successfully be resolved, otherwise null + * @param env The AssetAdministrationShellEnvironment to resolve the + * reference against + * @param type desired return type, use Referable.class is unknwon/not + * needed + * @return returns an instance of T if the reference could successfully be + * resolved, otherwise null * @throws IllegalArgumentException if something goes wrong while resolving */ - @SuppressWarnings("unchecked") - public static T resolve(Reference reference, Environment env, Class type) { + public static T resolve(Reference reference, Environment env, Class type) { if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } @@ -330,54 +528,42 @@ public static T resolve(Reference reference, Environment e Key key = reference.getKeys().get(i); Class keyType = keyTypeToClass(key.getType()); if (keyType != null) { - if (SubmodelElementList.class.isAssignableFrom(current.getClass())) { - try { - current = ((SubmodelElementList) current).getValues().get(Integer.parseInt(key.getValue())); - } catch (NumberFormatException ex) { - throw new IllegalArgumentException(String.format("invalid value for key with index %d, expected integer values >= 0, but found '%s'", - i, key.getValue())); - } catch (IndexOutOfBoundsException ex) { - throw new IllegalArgumentException(String.format("index out of bounds exception for key with index %d, expected integer values >= 0 and < %d, but found '%s'", - i, - ((SubmodelElementList) current).getValues().size(), - key.getValue())); - } + Collection collection; + // operation needs special handling because of nested values + if (Operation.class.isAssignableFrom(current.getClass())) { + Operation operation = (Operation) current; + + collection = Stream.of(operation.getInputVariables().stream(), + operation.getOutputVariables().stream(), + operation.getInoutputVariables().stream()) + .flatMap(x -> x.map(y -> y.getValue())) + .collect(Collectors.toSet()); } else { - Collection collection; - if (Operation.class.isAssignableFrom(current.getClass())) { - Operation operation = (Operation) current; - collection = Stream.of(operation.getInputVariables().stream(), - operation.getOutputVariables().stream(), - operation.getInoutputVariables().stream()) - .flatMap(x -> x.map(y -> y.getValue())) - .collect(Collectors.toSet()); - } else { - List matchingProperties = getAasProperties(current.getClass()).stream() - .filter(x -> Collection.class.isAssignableFrom(x.getReadMethod().getReturnType())) - .filter(x -> TypeToken.of(x.getReadMethod().getGenericReturnType()) - .resolveType(Collection.class.getTypeParameters()[0]) - .isSupertypeOf(keyType)) - .collect(Collectors.toList()); - if (matchingProperties.isEmpty()) { - throw new IllegalArgumentException(String.format("error resolving reference - could not find matching property for type %s in class %s", - keyType.getSimpleName(), - current.getClass().getSimpleName())); - } - if (matchingProperties.size() > 1) { - throw new IllegalArgumentException(String.format("error resolving reference - found %d possible property paths for class %s (%s)", - matchingProperties.size(), - current.getClass().getSimpleName(), - matchingProperties.stream() - .map(x -> x.getName()) - .collect(Collectors.joining(", ")))); - } - try { - collection = (Collection) matchingProperties.get(0).getReadMethod().invoke(current); - } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { - throw new IllegalArgumentException("error resolving reference", ex); - } + List matchingProperties = getAasProperties(current.getClass()).stream() + .filter(x -> Collection.class.isAssignableFrom(x.getReadMethod().getReturnType())) + .filter(x -> TypeToken.of(x.getReadMethod().getGenericReturnType()) + .resolveType(Collection.class.getTypeParameters()[0]) + .isSupertypeOf(keyType)) + .collect(Collectors.toList()); + if (matchingProperties.isEmpty()) { + throw new IllegalArgumentException(String.format("error resolving reference - could not find matching property for type %s in class %s", + keyType.getSimpleName(), + current.getClass().getSimpleName())); + } + if (matchingProperties.size() > 1) { + throw new IllegalArgumentException(String.format("error resolving reference - found %d possible property paths for class %s (%s)", + matchingProperties.size(), + current.getClass().getSimpleName(), + matchingProperties.stream() + .map(x -> x.getName()) + .collect(Collectors.joining(", ")))); + } + try { + collection = (Collection) matchingProperties.get(0).getReadMethod().invoke(current); + } catch (Exception ex) { + throw new IllegalArgumentException("error resolving reference", ex); } - Optional next = collection.stream() + Optional next = collection.stream() .filter(x -> ((Referable) x).getIdShort().equals(key.getValue())) .findFirst(); if (next.isEmpty()) { @@ -391,14 +577,16 @@ public static T resolve(Reference reference, Environment e } /** - * Gets a list of all properties defined for a class implementing at least one AAS interface. + * Gets a list of all properties defined for a class implementing at least + * one AAS interface. * - * @param type A class implementing at least one AAS interface. If it is does not implement any AAS interface the - * result will be an empty list - * @return a list of all properties defined in any of AAS interface implemented by type. If type does not implement - * any AAS interface an empty list is returned. + * @param type A class implementing at least one AAS interface. If it is + * does not implement any AAS interface the result will be an empty list + * @return a list of all properties defined in any of AAS interface + * implemented by type. If type does not implement any AAS interface an + * empty list is returned. */ - private static List getAasProperties(Class type) { + public static List getAasProperties(Class type) { Class aasType = ReflectionHelper.getAasInterface(type); if (aasType == null) { aasType = ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream() @@ -425,4 +613,4 @@ private static List getAasProperties(Class type) { .sorted(Comparator.comparing(x -> x.getName())) .collect(Collectors.toList()); } -} \ No newline at end of file +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java new file mode 100644 index 000000000..78d0f7df0 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.visitor.AssetAdministrationShellElementWalkerVisitor; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + +import java.util.HashSet; +import java.util.Set; + +/** + * Collects all Identifiable elements within an + * AssetAdministrationShellEnvironment + */ +public class IdentifiableCollector { + + private Environment env; + + public IdentifiableCollector(Environment env) { + this.env = env; + } + + public Set collect() { + Visitor visitor = new Visitor(); + visitor.visit(env); + return visitor.identifiables; + } + + private class Visitor implements AssetAdministrationShellElementWalkerVisitor { + + Set identifiables = new HashSet<>(); + + @Override + public void visit(AssetAdministrationShell value) { + identifiables.add(value); + AssetAdministrationShellElementWalkerVisitor.super.visit(value); + } + + @Override + public void visit(Submodel value) { + identifiables.add(value); + AssetAdministrationShellElementWalkerVisitor.super.visit(value); + } + + @Override + public void visit(ConceptDescription value) { + identifiables.add(value); + AssetAdministrationShellElementWalkerVisitor.super.visit(value); + } + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java new file mode 100644 index 000000000..5c9805de7 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; + +import java.util.Comparator; + +/** + * Comparator comparing two classes regarding which type is more specific. + */ +public class MostSpecificClassComparator implements Comparator> { + + @Override + public int compare(Class x, Class y) { + if (y.isAssignableFrom(x)) { + if (x.isAssignableFrom(y)) { + return 0; + } + return -1; + } + return 1; + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java new file mode 100644 index 000000000..5915e8867 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; + +import com.google.common.reflect.TypeToken; +import java.util.Comparator; + +/** + * Comparator comparing two TypeToken regarding which type is more specific. + */ +public class MostSpecificTypeTokenComparator implements Comparator { + + @Override + public int compare(TypeToken x, TypeToken y) { + if (x.isSubtypeOf(y)) { + if (y.isSubtypeOf(x)) { + return 0; + } + return -1; + } + return 1; + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java new file mode 100644 index 000000000..fc6f2af60 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.visitor; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; + + + +public interface AssetAdministrationShellElementVisitor { + + + public default void visit(DataElement dataElement) { + if (dataElement == null) { + return; + } + Class type = dataElement.getClass(); + if (Property.class.isAssignableFrom(type)) { + visit((Property) dataElement); + } else if (MultiLanguageProperty.class.isAssignableFrom(type)) { + visit((MultiLanguageProperty) dataElement); + } else if (Range.class.isAssignableFrom(type)) { + visit((Range) dataElement); + } else if (ReferenceElement.class.isAssignableFrom(type)) { + visit((ReferenceElement) dataElement); + } else if (File.class.isAssignableFrom(type)) { + visit((File) dataElement); + } else if (Blob.class.isAssignableFrom(type)) { + visit((Blob) dataElement); + } + } + + public default void visit(DataSpecificationContent dataSpecificationContent) { + if (dataSpecificationContent == null) { + return; + } + Class type = dataSpecificationContent.getClass(); + // if (DataSpecificationIEC61360.class.isAssignableFrom(type)) { + // visit((DataSpecificationIEC61360) dataSpecificationContent); + //} + } + + public default void visit(EventElement event) { + if (event == null) { + return; + } + Class type = event.getClass(); + if (BasicEventElement.class.isAssignableFrom(type)) { + visit((BasicEventElement) event); + } + } + + public default void visit(HasDataSpecification hasDataSpecification) { + if (hasDataSpecification == null) { + return; + } + Class type = hasDataSpecification.getClass(); + if (AssetAdministrationShell.class.isAssignableFrom(type)) { + visit((AssetAdministrationShell) hasDataSpecification); + } else if (Submodel.class.isAssignableFrom(type)) { + visit((Submodel) hasDataSpecification); + } else if (SubmodelElement.class.isAssignableFrom(type)) { + visit((SubmodelElement) hasDataSpecification); + } + + } + + public default void visit(HasExtensions hasExtensions) { + if (hasExtensions == null) { + return; + } + Class type = hasExtensions.getClass(); + if (Referable.class.isAssignableFrom(type)) { + visit((Referable) hasExtensions); + } + } + + public default void visit(HasKind hasKind) { + if (hasKind == null) { + return; + } + Class type = hasKind.getClass(); + if (Submodel.class.isAssignableFrom(type)) { + visit((Submodel) hasKind); + } else if (SubmodelElement.class.isAssignableFrom(type)) { + visit((SubmodelElement) hasKind); + } + } + + public default void visit(HasSemantics hasSemantics) { + if (hasSemantics == null) { + return; + } + Class type = hasSemantics.getClass(); + if (Extension.class.isAssignableFrom(type)) { + visit((Extension) hasSemantics); + } else if (SpecificAssetId.class.isAssignableFrom(type)) { + visit((SpecificAssetId) hasSemantics); + } else if (Submodel.class.isAssignableFrom(type)) { + visit((Submodel) hasSemantics); + } else if (SubmodelElement.class.isAssignableFrom(type)) { + visit((SubmodelElement) hasSemantics); + } else if (Qualifier.class.isAssignableFrom(type)) { + visit((Qualifier) hasSemantics); + } + } + + public default void visit(Identifiable identifiable) { + if (identifiable == null) { + return; + } + Class type = identifiable.getClass(); + if (AssetAdministrationShell.class.isAssignableFrom(type)) { + visit((AssetAdministrationShell) identifiable); + } else if (Submodel.class.isAssignableFrom(type)) { + visit((Submodel) identifiable); + } else if (ConceptDescription.class.isAssignableFrom(type)) { + visit((ConceptDescription) identifiable); + } + } + + public default void visit(SubmodelElement submodelElement) { + if (submodelElement == null) { + return; + } + Class type = submodelElement.getClass(); + if (RelationshipElement.class.isAssignableFrom(type)) { + visit((RelationshipElement) submodelElement); + } else if (DataElement.class.isAssignableFrom(type)) { + visit((DataElement) submodelElement); + } else if (Capability.class.isAssignableFrom(type)) { + visit((Capability) submodelElement); + } else if (SubmodelElementCollection.class.isAssignableFrom(type)) { + visit((SubmodelElementCollection) submodelElement); + } else if (Operation.class.isAssignableFrom(type)) { + visit((Operation) submodelElement); + } else if (EventElement.class.isAssignableFrom(type)) { + visit((EventElement) submodelElement); + } else if (Entity.class.isAssignableFrom(type)) { + visit((Entity) submodelElement); + } + } + + public default void visit(Qualifiable qualifiable) { + if (qualifiable == null) { + return; + } + Class type = qualifiable.getClass(); + if (Submodel.class.isAssignableFrom(type)) { + visit((Submodel) qualifiable); + } else if (SubmodelElement.class.isAssignableFrom(type)) { + visit((SubmodelElement) qualifiable); + } + } + + public default void visit(Referable referable) { + if (referable == null) { + return; + } + Class type = referable.getClass(); + if (Identifiable.class.isAssignableFrom(type)) { + visit((Identifiable) referable); + } else if (SubmodelElement.class.isAssignableFrom(type)) { + visit((SubmodelElement) referable); + } + } + + public default void visit(Environment assetAdministrationShellEnvironment) { + } + + public default void visit(AdministrativeInformation administrativeInformation) { + } + + public default void visit(AnnotatedRelationshipElement annotatedRelationshipElement) { + } + + public default void visit(AssetAdministrationShell assetAdministrationShell) { + } + + public default void visit(AssetInformation assetInformation) { + } + + public default void visit(BasicEventElement basicEvent) { + } + + public default void visit(Blob blob) { + } + + public default void visit(Capability capability) { + } + + public default void visit(ConceptDescription conceptDescription) { + } + + //public default void visit(EmbeddedDataSpecification embeddedDataSpecification) { + //} + + public default void visit(Entity entity) { + } + public default void visit(EventPayload eventMessage) { + } + + public default void visit(Extension extension) { + } + + public default void visit(File file) { + } + + public default void visit(SpecificAssetId identifierKeyValuePair) { + } + + public default void visit(Key key) { + } + + public default void visit(LangString langString) { + } + + public default void visit(MultiLanguageProperty multiLanguageProperty) { + } + + public default void visit(Operation operation) { + } + + public default void visit(OperationVariable operationVariable) { + } + + public default void visit(Property property) { + } + + public default void visit(Qualifier qualifier) { + } + + public default void visit(Range range) { + } + + public default void visit(Reference reference) { + } + + public default void visit(ReferenceElement referenceElement) { + } + + public default void visit(RelationshipElement relationshipElement) { + } + + public default void visit(Submodel submodel) { + } + + public default void visit(SubmodelElementCollection submodelElementCollection) { + } + + public default void visit(Resource resource) { + + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java new file mode 100644 index 000000000..9a1e53ad1 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.visitor; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; + + +public interface AssetAdministrationShellElementWalkerVisitor extends AssetAdministrationShellElementVisitor { + + + @Override + public default void visit(AnnotatedRelationshipElement annotatedRelationshipElement) { + if (annotatedRelationshipElement == null) { + return; + } + annotatedRelationshipElement.getAnnotations().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(annotatedRelationshipElement); + } + + @Override + public default void visit(AssetAdministrationShell assetAdministrationShell) { + if (assetAdministrationShell == null) { + return; + } + visit(assetAdministrationShell.getDerivedFrom()); + visit(assetAdministrationShell.getAssetInformation()); + assetAdministrationShell.getSubmodels().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(assetAdministrationShell); + } + + @Override + public default void visit(AssetInformation assetInformation) { + if (assetInformation == null) { + return; + } + visit(assetInformation.getGlobalAssetId()); + assetInformation.getSpecificAssetIds().forEach(x -> visit(x)); + visit(assetInformation.getDefaultThumbnail()); + AssetAdministrationShellElementVisitor.super.visit(assetInformation); + } + + @Override + public default void visit(Resource resource) { + if (resource == null) { + return; + } + AssetAdministrationShellElementVisitor.super.visit(resource); + } + + @Override + public default void visit(BasicEventElement basicEvent) { + if (basicEvent == null) { + return; + } + visit(basicEvent.getObserved()); + AssetAdministrationShellElementVisitor.super.visit(basicEvent); + } + + @Override + public default void visit(ConceptDescription conceptDescription) { + if (conceptDescription == null) { + return; + } + conceptDescription.getIsCaseOf().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(conceptDescription); + } + + @Override + public default void visit(HasDataSpecification hasDataSpecification) { + if (hasDataSpecification == null) { + return; + } + //hasDataSpecification.getEmbeddedDataSpecifications().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(hasDataSpecification); + } + + @Override + public default void visit(HasExtensions hasExtensions) { + if (hasExtensions == null) { + return; + } + hasExtensions.getExtensions().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(hasExtensions); + } + + @Override + public default void visit(HasSemantics hasSemantics) { + if (hasSemantics == null) { + return; + } + visit(hasSemantics.getSemanticId()); + AssetAdministrationShellElementVisitor.super.visit(hasSemantics); + } + + @Override + public default void visit(Identifiable identifiable) { + if (identifiable == null) { + return; + } + visit(identifiable.getAdministration()); + AssetAdministrationShellElementVisitor.super.visit(identifiable); + } + + @Override + public default void visit(SpecificAssetId specificAssetId) { + if (specificAssetId == null) { + return; + } + visit(specificAssetId.getExternalSubjectId()); + AssetAdministrationShellElementVisitor.super.visit(specificAssetId); + } + + @Override + public default void visit(MultiLanguageProperty multiLanguageProperty) { + if (multiLanguageProperty == null) { + return; + } + multiLanguageProperty.getValue().forEach(x -> visit(x)); + visit(multiLanguageProperty.getValueId()); + AssetAdministrationShellElementVisitor.super.visit(multiLanguageProperty); + } + + @Override + public default void visit(OperationVariable operationVariable) { + if (operationVariable == null) { + return; + } + visit(operationVariable.getValue()); + AssetAdministrationShellElementVisitor.super.visit(operationVariable); + } + + @Override + public default void visit(Property property) { + if (property == null) { + return; + } + visit(property.getValueId()); + AssetAdministrationShellElementVisitor.super.visit(property); + } + + @Override + public default void visit(Qualifiable qualifiable) { + if (qualifiable == null) { + return; + } + qualifiable.getQualifiers().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(qualifiable); + } + + @Override + public default void visit(Qualifier qualifier) { + if (qualifier == null) { + return; + } + visit(qualifier.getValueId()); + AssetAdministrationShellElementVisitor.super.visit(qualifier); + } + + @Override + public default void visit(Referable referable) { + if (referable == null) { + return; + } + referable.getDescription().forEach(x -> visit(x)); + referable.getDisplayName().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(referable); + } + + @Override + public default void visit(Reference reference) { + if (reference == null) { + return; + } + reference.getKeys().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(reference); + } + + @Override + public default void visit(ReferenceElement referenceElement) { + if (referenceElement == null) { + return; + } + visit(referenceElement.getValue()); + AssetAdministrationShellElementVisitor.super.visit(referenceElement); + } + + @Override + public default void visit(RelationshipElement relationshipElement) { + if (relationshipElement == null) { + return; + } + visit(relationshipElement.getFirst()); + visit(relationshipElement.getSecond()); + AssetAdministrationShellElementVisitor.super.visit(relationshipElement); + } + + @Override + public default void visit(Entity entity) { + if (entity == null) { + return; + } + visit(entity.getGlobalAssetId()); + visit(entity.getSpecificAssetId()); + entity.getStatements().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(entity); + } + + @Override + public default void visit(Extension extension) { + if (extension == null) { + return; + } + visit(extension.getRefersTo()); + AssetAdministrationShellElementVisitor.super.visit(extension); + } + + @Override + public default void visit(Environment assetAdministrationShellEnvironment) { + if (assetAdministrationShellEnvironment == null) { + return; + } + assetAdministrationShellEnvironment.getAssetAdministrationShells().forEach(x -> visit(x)); + assetAdministrationShellEnvironment.getConceptDescriptions().forEach(x -> visit(x)); + assetAdministrationShellEnvironment.getSubmodels().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(assetAdministrationShellEnvironment); + } + + @Override + public default void visit(Submodel submodel) { + if (submodel == null) { + return; + } + submodel.getSubmodelElements().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(submodel); + } + + @Override + public default void visit(SubmodelElementCollection submodelElementCollection) { + if (submodelElementCollection == null) { + return; + } + submodelElementCollection.getValue().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(submodelElementCollection); + } + + @Override + public default void visit(Operation operation) { + if (operation == null) { + return; + } + operation.getInputVariables().forEach(x -> visit(x.getValue())); + operation.getInoutputVariables().forEach(x -> visit(x.getValue())); + operation.getOutputVariables().forEach(x -> visit(x.getValue())); + AssetAdministrationShellElementVisitor.super.visit(operation); + } + +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java new file mode 100644 index 000000000..28d7b36fe --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; + +/** + * Generic interface used by MappingProvider to infere generic arguments. This + * is used to automatically determine best-matching mapper + * + * @param The type that this Mapper can process + */ +public interface Mapper { + +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java new file mode 100644 index 000000000..89fdb5859 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Abstract super-class for a MappingContext that already provides a + * MappingProvider + * + * @param Type of mapper the the MappingProvider can operate on + */ +public abstract class MappingContext { + + protected static final Logger log = LoggerFactory.getLogger(MappingContext.class); + protected final MappingProvider mappingProvider; + + public MappingContext(MappingProvider mappingProvider) { + this.mappingProvider = mappingProvider; + } + + public MappingProvider getMappingProvider() { + return mappingProvider; + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java new file mode 100644 index 000000000..de7108db1 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; + +/** + * Exception throw upon any error on mapping + */ +public class MappingException extends Exception { + + public MappingException(String msg) { + super(msg); + } + + public MappingException(String msg, Throwable err) { + super(msg, err); + } + +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java new file mode 100644 index 000000000..44e10d707 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; + +import com.google.common.reflect.TypeToken; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.MostSpecificClassComparator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.MostSpecificTypeTokenComparator; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Manages a set of mappers and allows finding them by type. This is the + * cornerstone functionality of the mapping framework. + * + * @param Type of mappers that are supported + */ +public class MappingProvider { + + private static final Logger log = LoggerFactory.getLogger(MappingProvider.class); + + private final T defaultMapper; + private final T defaultCollectionMapper; + private final Map, List> mappings = new HashMap<>(); + + public MappingProvider(Class type, + Mapper defaultMapper, + Mapper> defaultCollectionMapper) { + if (type == null) { + throw new IllegalArgumentException("type must be non-null"); + } + if (defaultMapper == null) { + throw new IllegalArgumentException("defaultMapper must be non-null"); + } + if (defaultCollectionMapper == null) { + throw new IllegalArgumentException("defaultCollectionMapper must be non-null"); + } + if (!type.isAssignableFrom(defaultMapper.getClass())) { + throw new IllegalArgumentException("defaultMapper must be of type " + type); + } + if (!type.isAssignableFrom(defaultCollectionMapper.getClass())) { + throw new IllegalArgumentException("defaultCollectionMapper must be of type " + type); + } + this.defaultMapper = (T) defaultMapper; + this.defaultCollectionMapper = (T) defaultCollectionMapper; + } + + public void register(T mapper) { + TypeToken key = getMappedType(mapper.getClass()); + if (!mappings.containsKey(key)) { + mappings.put(key, new ArrayList<>()); + } + mappings.get(key).add(mapper); + } + + private TypeToken getMappedType(Class type) { + return TypeToken.of(type) + .getTypes().stream() + .filter(y -> Mapper.class.equals(y.getRawType())) + .findFirst() + .get() + .resolveType(Mapper.class.getTypeParameters()[0]); + } + + /** + * Find the most specific mapper for a given object. + * + * @param obj The object to find a suitable mapper for. If this is an + * instance of Type (e.g. a Class) type information for that is returned. + * @return The most specific mapper for the given object + */ + public T getMapper(Object obj) { + if (obj == null) { + return getMapper(Object.class); + } + if (Type.class.isAssignableFrom(obj.getClass())) { + return getMapper((Type) obj); + } + return getMapper(obj.getClass()); + } + + /** + * Find the most specific mapper for a given type. + * + * @param type The type to find a suitable mapper for. + * @return The most specific mapper for the given type + */ + public T getMapper(Type type) { + Optional> customMapper = mappings.entrySet().stream() + .filter(x -> x.getKey().isSupertypeOf(type)) + .sorted((x, y) -> Objects.compare(x.getKey(), y.getKey(), new MostSpecificTypeTokenComparator())) + .map(x -> x.getValue()) + .findFirst(); + if (customMapper.isEmpty() && !TypeToken.of(Collection.class).isSupertypeOf(type)) { + customMapper = mappings.entrySet().stream() + .filter(x -> x.getKey().getRawType().isAssignableFrom(TypeToken.of(type).getRawType())) + .sorted((x, y) -> Objects.compare(x.getKey().getRawType(), y.getKey().getRawType(), new MostSpecificClassComparator())) + .map(x -> x.getValue()) + .findFirst(); + } + if (customMapper.isEmpty() || customMapper.get().isEmpty()) { + if (TypeToken.of(Collection.class).isSupertypeOf(type) && defaultCollectionMapper != null) { + return defaultCollectionMapper; + } + return defaultMapper; + } + if (customMapper.get().size() > 1) { + log.warn("found {} equally suitable mappers for type '{}'", customMapper.get().size(), type); + } + return customMapper.get().get(0); + } + +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java new file mode 100644 index 000000000..b036a0836 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; + +/** + * A mapper that when mapping from A to B allows to write mappers based on the + * classes of A (the source of the mapping) + * + * @param type that the mapper accepts, here: any class of A + * @param the generator type, here: to generate instances of B + * @param the type of mapping context + */ +public interface SourceBasedMapper extends Mapper { + + /** + * Maps the given value to target format via the generator. + * + * @param value the value to map + * @param generator the generator to write the mapping result to + * @param context the context of the mapping + * @throws MappingException + */ + public void map(T value, G generator, C context) throws MappingException; +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java new file mode 100644 index 000000000..b34f6e09e --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; + +/** + * A mapper that when mapping from A to B allows to write mappers based on the + * classes of B (the target of the mapping) + * + * @param type that the mapper accepts, here: any class of B + * @param

the parser type, here: to parse data of A + * @param the type of mapping context + */ +public interface TargetBasedMapper> extends Mapper { + + /** + * Reads from the parser and returns the mapping result. + * + * @param parser the parser to read the actual input + * @param context the context + * @return a new instance of T created by mapping data given by the parser + * @throws MappingException + */ + public T map(P parser, C context) throws MappingException; +} diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 483d4a0d9..e20d26153 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,53 +19,9 @@ import java.util.Arrays; import java.util.Base64; -import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.Direction; -import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultCapability; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultQualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueList; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueReferencePair; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + public class AASFull { @@ -84,50 +40,64 @@ public class AASFull { public final static ConceptDescription CONCEPT_DESCRIPTION_2 = createConceptDescription2(); public final static ConceptDescription CONCEPT_DESCRIPTION_3 = createConceptDescription3(); public final static ConceptDescription CONCEPT_DESCRIPTION_4 = createConceptDescription4(); + public static final Environment ENVIRONMENT = createEnvironment(); public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"; public static AssetAdministrationShell createAAS1() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build()) - .description(new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() - ) + .description(Arrays.asList( + new DefaultLangString.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + )) .id("https://acplt.org/Test_AssetAdministrationShell") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) .derivedFrom(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) .value("https://acplt.org/TestAssetAdministrationShell2") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId("https://acplt.org/Test_Asset") + .globalAssetId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) + .value("https://acplt.org/Test_Asset") + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) + //.billOfMaterial((new DefaultReference.Builder() + // .keys(new DefaultKey.Builder() + // .type(KeyTypes.SUBMODEL) + // .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") + // .build())) + // .build()) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build(); } @@ -138,21 +108,27 @@ public static AssetAdministrationShell createAAS2() { .id("https://acplt.org/Test_AssetAdministrationShell_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId("https://acplt.org/Test_Asset_Mandatory") + .globalAssetId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) + .value("https://acplt.org/Test_Asset_Mandatory") + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel_Mandatory") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel2_Mandatory") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build(); } @@ -163,7 +139,13 @@ public static AssetAdministrationShell createAAS3() { .id("https://acplt.org/Test_AssetAdministrationShell2_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId("https://acplt.org/Test_Asset_Mandatory") + .globalAssetId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) + .value("https://acplt.org/Test_Asset_Mandatory") + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) .build()) .build(); } @@ -171,25 +153,31 @@ public static AssetAdministrationShell createAAS3() { public static AssetAdministrationShell createAAS4() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_AssetAdministrationShell_Missing") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId("https://acplt.org/Test_Asset_Missing") + .globalAssetId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) + .value("https://acplt.org/Test_Asset_Missing") + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel_Missing") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build(); } @@ -197,31 +185,28 @@ public static AssetAdministrationShell createAAS4() { public static Submodel createSubmodel1() { return new DefaultSubmodel.Builder() .idShort("Identification") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() )) .id("http://acplt.org/Submodels/Assets/TestAsset/Identification") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/AssetIdentification") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodelElements(new DefaultProperty.Builder() .idShort("ManufacturerName") - .displayName( - new DefaultLangStringNameType.Builder().text("Manufacturer Name").language("en-us").build() - ) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -229,7 +214,7 @@ public static Submodel createSubmodel1() { .value("0173-1#02-AAO677#002") .build() ) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .value("100") @@ -241,22 +226,21 @@ public static Submodel createSubmodel1() { .type("http://acplt.org/Qualifier/ExampleQualifier2") .valueType(DataTypeDefXsd.INT) .build()) - .value("http://acplt.org/valueId/ACPLT") + .value("http://acplt.org/ValueId/ACPLT") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ACPLT") + .value("http://acplt.org/ValueId/ACPLT") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultProperty.Builder() .idShort("InstanceId") - .category("VARIABLE") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -264,23 +248,8 @@ public static Submodel createSubmodel1() { .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build() ) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .supplementalSemanticIds(Arrays.asList( - new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("something_random_e14ad770") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build(), - new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("something_random_bd061acd") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build())) .value("978-8234-234-342") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() @@ -288,7 +257,7 @@ public static Submodel createSubmodel1() { .type(KeyTypes.GLOBAL_REFERENCE) .value("978-8234-234-342") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .build(); @@ -297,100 +266,106 @@ public static Submodel createSubmodel1() { public static Submodel createSubmodel2() { return new DefaultSubmodel.Builder() .idShort("BillOfMaterial") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() )) .id("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") + .version("0.9") .build()) - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/BillOfMaterial") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .statements(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .value("http://acplt.org/valueId/ExampleValue2") + .value("http://acplt.org/ValueId/ExampleValue2") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExampleValue2") + .value("http://acplt.org/ValueId/ExampleValue2") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .statements(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .entityType(EntityType.CO_MANAGED_ENTITY) .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity2") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .entityType(EntityType.SELF_MANAGED_ENTITY) - .globalAssetId("https://acplt.org/Test_Asset2") + .globalAssetId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) + .value("https://acplt.org/Test_Asset2") + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) .build()) .build(); } @@ -398,36 +373,36 @@ public static Submodel createSubmodel2() { public static Submodel createSubmodel3() { return new DefaultSubmodel.Builder() .idShort("TestSubmodel") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -463,16 +438,16 @@ public static Submodel createSubmodel3() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -505,6 +480,7 @@ public static Submodel createSubmodel3() { .type(ReferenceTypes.MODEL_REFERENCE) .build()) .annotations(new DefaultProperty.Builder() + .kind(ModelingKind.INSTANCE) .idShort("ExampleProperty3") .category("PARAMETER") .value("some example annotation") @@ -513,40 +489,41 @@ public static Submodel createSubmodel3() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") + .kind(ModelingKind.TEMPLATE) .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -555,24 +532,24 @@ public static Submodel createSubmodel3() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -581,24 +558,24 @@ public static Submodel createSubmodel3() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty3") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -607,16 +584,16 @@ public static Submodel createSubmodel3() { .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultBasicEventElement.Builder() @@ -624,16 +601,16 @@ public static Submodel createSubmodel3() { .category("PARAMETER") .direction(Direction.INPUT) .state(StateOfEvent.ON) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -655,114 +632,113 @@ public static Submodel createSubmodel3() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .values(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() + .value(Arrays.asList( + new DefaultLangString.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), + new DefaultLangString.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExampleMultiLanguagevalueId") + .value("http://acplt.org/ValueId/ExampleMultiLanguageValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) - .value(new DefaultRange.Builder() // TODO: a SME-List must only contain one SME-Type, e.g. Property or Range + .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .min("0") .max("100") .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .contentType("application/pdf") .value(Base64.getDecoder().decode("AQIDBAU=")) @@ -770,16 +746,16 @@ public static Submodel createSubmodel3() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example File object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value("file:///TestFile.pdf") .contentType("application/pdf") @@ -787,16 +763,16 @@ public static Submodel createSubmodel3() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -811,7 +787,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.PROPERTY) .value("ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .build()) @@ -822,7 +798,7 @@ public static Submodel createSubmodel4() { return new DefaultSubmodel.Builder() .idShort("Test_Submodel_Mandatory") .id("https://acplt.org/Test_Submodel_Mandatory") - .kind(ModellingKind.TEMPLATE) + .kind(ModelingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .first(new DefaultReference.Builder() @@ -891,6 +867,7 @@ public static Submodel createSubmodel4() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") + .kind(ModelingKind.TEMPLATE) .build()) .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") @@ -933,7 +910,6 @@ public static Submodel createSubmodel4() { .max(null) .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") @@ -959,7 +935,7 @@ public static Submodel createSubmodel4() { public static Submodel createSubmodel5() { return new DefaultSubmodel.Builder() .idShort("Test_Submodel2_Mandatory") - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .id("https://acplt.org/Test_Submodel2_Mandatory") .build(); } @@ -967,36 +943,35 @@ public static Submodel createSubmodel5() { public static Submodel createSubmodel6() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelMissing") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Missing") - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") - .build()) + .version("0.9") + .revision("0").build()) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1032,16 +1007,16 @@ public static Submodel createSubmodel6() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1074,6 +1049,7 @@ public static Submodel createSubmodel6() { .type(ReferenceTypes.MODEL_REFERENCE) .build()) .annotations(new DefaultProperty.Builder() + .kind(ModelingKind.INSTANCE) .idShort("ExampleProperty") .category("PARAMETER") .value("some example annotation") @@ -1082,32 +1058,33 @@ public static Submodel createSubmodel6() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") + .kind(ModelingKind.TEMPLATE) .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1121,16 +1098,16 @@ public static Submodel createSubmodel6() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1144,16 +1121,16 @@ public static Submodel createSubmodel6() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty3") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1167,16 +1144,16 @@ public static Submodel createSubmodel6() { .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultBasicEventElement.Builder() @@ -1184,16 +1161,16 @@ public static Submodel createSubmodel6() { .category("PARAMETER") .direction(Direction.INPUT) .state(StateOfEvent.ON) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1208,7 +1185,7 @@ public static Submodel createSubmodel6() { .type(KeyTypes.PROPERTY) .value("ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultSubmodelElementList.Builder() @@ -1216,30 +1193,30 @@ public static Submodel createSubmodel6() { .category("PARAMETER") .orderRelevant(true) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1251,69 +1228,68 @@ public static Submodel createSubmodel6() { .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .values(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() + .value(Arrays.asList( + new DefaultLangString.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), + new DefaultLangString.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .min("0") .max("100") .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .contentType("application/pdf") .value(Base64.getDecoder().decode("AQIDBAU=")) @@ -1321,16 +1297,16 @@ public static Submodel createSubmodel6() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example File object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value("file:///TestFile.pdf") .contentType("application/pdf") @@ -1338,16 +1314,16 @@ public static Submodel createSubmodel6() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1372,38 +1348,39 @@ public static Submodel createSubmodel6() { public static Submodel createSubmodel7() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelTemplate") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Template") - .kind(ModellingKind.TEMPLATE) + .kind(ModelingKind.TEMPLATE) .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .kind(ModellingKind.TEMPLATE) + .kind(ModelingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1438,17 +1415,18 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1482,33 +1460,36 @@ public static Submodel createSubmodel7() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") + .kind(ModelingKind.TEMPLATE) .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1517,17 +1498,18 @@ public static Submodel createSubmodel7() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1536,17 +1518,18 @@ public static Submodel createSubmodel7() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1555,34 +1538,36 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .build()) .submodelElements(new DefaultBasicEventElement.Builder() .idShort("ExampleBasicEvent") .category("PARAMETER") .direction(Direction.OUTPUT) .state(StateOfEvent.OFF) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1603,64 +1588,68 @@ public static Submodel createSubmodel7() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .min(null) .max("100") .valueType(DataTypeDefXsd.INT) @@ -1668,100 +1657,105 @@ public static Submodel createSubmodel7() { .value(new DefaultRange.Builder() .idShort("ExampleRange2") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .min("0") .max(null) .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .contentType("application/pdf") .build()) .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example File object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .value(null) .contentType("application/pdf") .build()) .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .build()) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection2") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .build()) .build(); } @@ -1769,21 +1763,21 @@ public static Submodel createSubmodel7() { public static ConceptDescription createConceptDescription1() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example concept description for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_ConceptDescription") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build(); } @@ -1798,15 +1792,14 @@ public static ConceptDescription createConceptDescription2() { public static ConceptDescription createConceptDescription3() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription1") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example concept description for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) - .category("PROPERTY") .id("https://acplt.org/Test_ConceptDescription_Missing") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) .build(); } @@ -1816,66 +1809,71 @@ public static ConceptDescription createConceptDescription4() { .idShort("TestSpec_01") .id("http://acplt.org/DataSpecifciations/Example/Identification") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() .dataSpecification(new DefaultReference.Builder() - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredNames(Arrays.asList( - new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), - new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .preferredName(Arrays.asList( + new DefaultLangString.Builder().text("Test Specification").language("de").build(), + new DefaultLangString.Builder().text("TestSpecification").language("en-us").build() )) - .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) + .dataType(DataTypeIEC61360.REAL_MEASURE) + .definition(new DefaultLangString.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) + .definition(new DefaultLangString.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) + .shortName(new DefaultLangString.Builder().text("Test Spec").language("de").build()) + .shortName(new DefaultLangString.Builder().text("TestSpec").language("en-us").build()) .unit("SpaceUnit") .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/Units/SpaceUnit") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") .symbol("SU") .valueFormat("string") .value("TEST") +// .levelType(LevelType.MIN) + .levelType(LevelType.MAX) .valueList(new DefaultValueList.Builder() .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + // TODO valueType? .build()) .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/valueId/ExamplevalueId2") + .value("http://acplt.org/ValueId/ExampleValueId2") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId2") + .value("http://acplt.org/ValueId/ExampleValueId2") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + // TODO valueType? .build()) .build()) .build()) @@ -1906,4 +1904,4 @@ public static Environment createEnvironment() { .build(); } -} +} \ No newline at end of file diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index a57f4a418..d48733dae 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,39 +16,9 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResource; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import org.junit.Assert; -import org.junit.Test; public class AASSimple { @@ -59,7 +29,7 @@ public class AASSimple { private static final String WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DOCUMENT = "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"; private static final String ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED = "Actual rotationspeed with which the motor or feedingunit is operated"; private static final String AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD = "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird"; - private static final String ACTUAL_ROTATION_SPEED = "ActRotationSpeed"; + private static final String ACTUAL_ROTATION_SPEED = "ActualRotationSpeed"; private static final String ACTUALROTATIONSPEED = "Actualrotationspeed"; private static final String AKTUELLE_DREHZAHL = "AktuelleDrehzahl"; private static final String _1_MIN = "1/min"; @@ -81,8 +51,10 @@ public class AASSimple { private static final String TITEL = "Titel"; private static final String WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DESCRIPTION_TITLE = "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"; private static final String TITLE = "Title"; + private static final String SERVO_DC_MOTOR = "ServoDCMotor"; private static final String FILE_MASTER_VERWALTUNGSSCHALE_DETAIL_PART1_PNG = "file:///master/verwaltungsschale-detail-part1.png"; private static final String IMAGE_PNG = "image/png"; + private static final String THUMBNAIL = "thumbnail"; private static final String HTTP_CUSTOMER_COM_SYSTEMS_IO_T_1 = "http://customer.com/Systems/IoT/1"; private static final String QJ_YG_PGGJWKI_HK4_RR_QI_YS_LG = "QjYgPggjwkiHk4RrQiYSLg=="; private static final String DEVICE_ID = "DeviceID"; @@ -112,6 +84,7 @@ public class AASSimple { private static final String SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID = WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DESCRIPTION_TITLE; private static final String SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT = TITLE; private static final String SUBMODEL_DOCUMENTATION_PROPERTY_VALUE = "OperatingManual"; + private static final String SUBMODEL_DOCUMENTATION_PROPERTY_VALUETYPE = "langString"; private static final String SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID = WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_STORED_DOCUMENT_REPRESENTATION_DIGITAL_FILE; private static final String SUBMODEL_DOCUMENTATION_FILE_ID_SHORT = "DigitalFile_PDF"; private static final String SUBMODEL_DOCUMENTATION_FILE_contentType = "application/pdf"; @@ -124,6 +97,7 @@ public class AASSimple { private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT = ROTATION_SPEED; private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY = "VARIABLE"; private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE = "4370"; + private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUETYPE = "integer"; public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"; public AASSimple() { @@ -138,6 +112,7 @@ public AASSimple() { public static final ConceptDescription CONCEPT_DESCRIPTION_MAXROTATIONSPEED = createConceptDescriptionMaxRotationSpeed(); public static final ConceptDescription CONCEPT_DESCRIPTION_ROTATIONSPEED = createConceptDescriptionRotationSpeed(); public static final ConceptDescription CONCEPT_DESCRIPTION_DOCUMENT = createConceptDescriptionDocument(); + public static final Environment ENVIRONMENT = createEnvironment(); public static AssetAdministrationShell createAAS() { return new DefaultAssetAdministrationShell.Builder() @@ -145,7 +120,13 @@ public static AssetAdministrationShell createAAS() { .id(AAS_IDENTIFIER) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) + .globalAssetId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) + .value(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) .specificAssetIds(new DefaultSpecificAssetId.Builder() .name(EQUIPMENT_ID) .value(_538FD1B3_F99F_4A52_9C75_72E9FA921270) @@ -154,7 +135,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_ERP_012) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .specificAssetIds(new DefaultSpecificAssetId.Builder() @@ -165,7 +146,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_IO_T_1) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .defaultThumbnail(new DefaultResource.Builder() @@ -178,7 +159,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_TECHNICAL_DATA_ID) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodels( new DefaultReference.Builder() @@ -186,19 +167,20 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_OPERATIONAL_DATA_ID) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodels( new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.SUBMODEL) - .value(SUBMODEL_DOCUMENTATION_ID) - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL) + .value(SUBMODEL_DOCUMENTATION_ID) + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) .build(); } + public static Submodel createSubmodelTechnicalData() { return new DefaultSubmodel.Builder() .semanticId(new DefaultReference.Builder() @@ -206,17 +188,19 @@ public static Submodel createSubmodelTechnicalData() { .type(KeyTypes.GLOBAL_REFERENCE) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.INSTANCE) .idShort(SUBMODEL_TECHNICAL_DATA_ID_SHORT) .id(SUBMODEL_TECHNICAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_PROPERTY) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .idShort(SUBMODEL_TECHNICAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_TECHNICAL_DATA_PROPERTY_CATEGORY) @@ -228,16 +212,17 @@ public static Submodel createSubmodelTechnicalData() { public static Submodel createSubmodelOperationalData() { return new DefaultSubmodel.Builder() - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .idShort(SUBMODEL_OPERATIONAL_DATA_ID_SHORT) .id(SUBMODEL_OPERATIONAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_OPERATIONAL_DATA_SEMANTIC_ID_PROPERTY) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .idShort(SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY) @@ -249,37 +234,40 @@ public static Submodel createSubmodelOperationalData() { public static Submodel createSubmodelDocumentation() { return new DefaultSubmodel.Builder() - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .idShort(SUBMODEL_DOCUMENTATION_ID_SHORT) .id(SUBMODEL_DOCUMENTATION_ID) .submodelElements(new DefaultSubmodelElementCollection.Builder() + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_SEMANTIC_ID) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_ID_SHORT) .value(new DefaultProperty.Builder() + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT) .value(SUBMODEL_DOCUMENTATION_PROPERTY_VALUE) .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultFile.Builder() + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_FILE_ID_SHORT) .contentType(SUBMODEL_DOCUMENTATION_FILE_contentType) @@ -301,17 +289,17 @@ public static ConceptDescription createConceptDescriptionTitle() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(TITLE).language("EN").build()) - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(TITEL).language("DE").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(TITLE).language("EN").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(TITEL).language("DE").build()) + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) + .preferredName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) + .shortName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) + .shortName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") - .dataType(DataTypeIec61360.STRING_TRANSLATABLE) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) + .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) + .definition(new DefaultLangString.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) .build()) .build()) .build(); @@ -327,18 +315,18 @@ public static ConceptDescription createConceptDescriptionDigitalFile() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .dataSpecificationContent( - new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DIGITALE_DATEI).language("DE").build()) + new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) + .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) + .shortName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) + .shortName(new DefaultLangString.Builder().text(DIGITALE_DATEI).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") - .dataType(DataTypeIec61360.STRING) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) + .dataType(DataTypeIEC61360.STRING) + .definition(new DefaultLangString.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) .build()) .build()) .build(); @@ -349,7 +337,7 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .idShort(MAX_ROTATION_SPEED).category(PROPERTY) .administration(new DefaultAdministrativeInformation.Builder() .version("2") - .revision("1") + .revision("2.1") .build()) .id(_0173_1_02_BAA120_008) .embeddedDataSpecifications( @@ -359,23 +347,23 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_DREHZAHL).language("de").build()) - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_ROTATIONSPEED).language("en").build()) + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new DefaultLangString.Builder().text(MAX_DREHZAHL).language("de").build()) + .preferredName(new DefaultLangString.Builder().text(MAX_ROTATIONSPEED).language("en").build()) .unit(_1_MIN) .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .sourceOfDefinition("ExampleString") - .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) + .dataType(DataTypeIEC61360.REAL_MEASURE) + .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) + .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) .build()) .build()) .build(); @@ -393,26 +381,26 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .dataSpecificationContent( - new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) + new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) + .preferredName(new DefaultLangString.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) + .shortName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) + .shortName(new DefaultLangString.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) .unit(_1_MIN) .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .sourceOfDefinition("ExampleString") - .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) + .dataType(DataTypeIEC61360.REAL_MEASURE) + .definition(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) + .definition(new DefaultLangString.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) .build()) .build()) .build(); @@ -428,16 +416,16 @@ public static ConceptDescription createConceptDescriptionDocument() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DOCUMENT).language("EN").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DOCUMENT).language("EN").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DOKUMENT).language("DE").build()) + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) + .shortName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) + .shortName(new DefaultLangString.Builder().text(DOKUMENT).language("DE").build()) .unit("ExampleString") .sourceOfDefinition(ISO15519_1_2010) - .dataType(DataTypeIec61360.STRING) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(DOCUMENT_DEF).language("EN").build()) + .dataType(DataTypeIEC61360.STRING) + .definition(new DefaultLangString.Builder().text(DOCUMENT_DEF).language("EN").build()) .build()) .build()) .build(); @@ -456,11 +444,4 @@ public static Environment createEnvironment() { .conceptDescriptions(createConceptDescriptionDocument()) .build(); } - - @Test - public void testAasSimpleExtensionsInitialized() { - List extensions = AASSimple.createEnvironment().getAssetAdministrationShells().get(0).getExtensions(); - Assert.assertTrue(extensions != null); - } - } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java new file mode 100644 index 000000000..995289faf --- /dev/null +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; + + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.junit.Assert; +import org.junit.Test; + +public class AasUtilsTest { + + @Test + public void testParseReference() { + Reference reference = AasUtils.parseReference("(ModelReference)[Property]Temperature"); + Assert.assertNotNull(reference); + Assert.assertEquals(1, reference.getKeys().size()); + Assert.assertEquals(KeyTypes.PROPERTY, reference.getKeys().get(0).getType()); + Assert.assertEquals("Temperature", reference.getKeys().get(0).getValue()); + } + + @Test + public void whenDeserializingEnumNames_withUpperCamelCase_shouldReturnScreamingSnakeCase() { + Assert.assertEquals("ANY_ENUM", AasUtils.deserializeEnumName("AnyEnum")); + } + + @Test + public void whenDeserializingEnumNames_withLowerCamelCase_shouldReturnScreamingSnakeCase() { + Assert.assertEquals("ANY_ENUM", AasUtils.deserializeEnumName("anyEnum")); + } + + @Test + public void whenDeserializingEnumNames_withScreamingSnakeCase_shouldReturnUnchanged() { + final String name = "ANY_ENUM"; + Assert.assertEquals(name, AasUtils.deserializeEnumName(name)); + } +} diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java index b9bc9de24..d22adf747 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.Property; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; import java.util.List; import java.util.Objects; @@ -28,7 +35,7 @@ public class CustomProperty implements Property { protected List dataSpecifications; - protected ModellingKind kind; + protected ModelingKind kind; protected Reference semanticId; @@ -42,9 +49,9 @@ public class CustomProperty implements Property { protected String category; - protected List description; + protected List description; - protected List displayName; + protected List displayName; protected String idShort; @@ -77,7 +84,7 @@ public boolean equals(Object obj) { && Objects.equals(this.description, other.description) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.qualifiers, other.qualifiers) - && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) + // TODO && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.kind, other.kind) && Objects.equals(this.semanticId, other.semanticId); } } @@ -123,22 +130,32 @@ final public void setCategory(String category) { } @Override - final public List getDescriptions() { + final public List getDescription() { return description; } @Override - final public void setDescriptions(List description) { + final public void setDescription(List description) { this.description = description; } @Override - final public List getDisplayNames() { + public String getChecksum() { + return null; + } + + @Override + public void setChecksum(String checksum) { + + } + + @Override + final public List getDisplayName() { return displayName; } @Override - final public void setDisplayNames(List displayName) { + final public void setDisplayName(List displayName) { this.displayName = displayName; } @@ -172,6 +189,16 @@ final public void setEmbeddedDataSpecifications(List this.embeddedDataSpecifications = embeddedDataSpecifications; } + @Override + final public ModelingKind getKind() { + return kind; + } + + @Override + final public void setKind(ModelingKind kind) { + this.kind = kind; + } + @Override final public Reference getSemanticId() { return semanticId; diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java index 5908adfb9..efd6ef3a1 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java @@ -1,9 +1,25 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import java.io.IOException; - +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import org.junit.Assert; @@ -11,8 +27,7 @@ import org.junit.Test; import org.mockito.Mockito; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; +import java.io.IOException; public class EnumDeserializerTest { @@ -25,38 +40,22 @@ public void setUp() { deserializationContextMock = Mockito.mock(DeserializationContext.class); } - @Test - public void whenDeserializingEnumNames_withUpperCamelCase_shouldReturnScreamingSnakeCase() { - Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("AnyEnum")); - } - - @Test - public void whenDeserializingEnumNames_withLowerCamelCase_shouldReturnScreamingSnakeCase() { - Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("anyEnum")); - } - - @Test - public void whenDeserializingEnumNames_withScreamingSnakeCase_shouldReturnUnchanged() { - final String name = "ANY_ENUM"; - Assert.assertEquals(name, EnumDeserializer.deserializeEnumName(name)); - } - @Test public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { - assertDeserialization("BOOLEAN", DataTypeIec61360.BOOLEAN); - assertDeserialization("DATE", DataTypeIec61360.DATE); - assertDeserialization("INTEGER_CURRENCY", DataTypeIec61360.INTEGER_CURRENCY); - assertDeserialization("INTEGER_COUNT", DataTypeIec61360.INTEGER_COUNT); - assertDeserialization("INTEGER_MEASURE", DataTypeIec61360.INTEGER_MEASURE); - assertDeserialization("RATIONAL", DataTypeIec61360.RATIONAL); - assertDeserialization("RATIONAL_MEASURE", DataTypeIec61360.RATIONAL_MEASURE); - assertDeserialization("REAL_COUNT", DataTypeIec61360.REAL_COUNT); - assertDeserialization("REAL_MEASURE", DataTypeIec61360.REAL_MEASURE); - assertDeserialization("STRING", DataTypeIec61360.STRING); - assertDeserialization("STRING_TRANSLATABLE", DataTypeIec61360.STRING_TRANSLATABLE); - assertDeserialization("TIME", DataTypeIec61360.TIME); - assertDeserialization("TIMESTAMP", DataTypeIec61360.TIMESTAMP); - assertDeserialization("IRI", DataTypeIec61360.IRI); + assertDeserialization("BOOLEAN", DataTypeIEC61360.BOOLEAN); + assertDeserialization("DATE", DataTypeIEC61360.DATE); + assertDeserialization("INTEGER_CURRENCY", DataTypeIEC61360.INTEGER_CURRENCY); + assertDeserialization("INTEGER_COUNT", DataTypeIEC61360.INTEGER_COUNT); + assertDeserialization("INTEGER_MEASURE", DataTypeIEC61360.INTEGER_MEASURE); + assertDeserialization("RATIONAL", DataTypeIEC61360.RATIONAL); + assertDeserialization("RATIONAL_MEASURE", DataTypeIEC61360.RATIONAL_MEASURE); + assertDeserialization("REAL_COUNT", DataTypeIEC61360.REAL_COUNT); + assertDeserialization("REAL_MEASURE", DataTypeIEC61360.REAL_MEASURE); + assertDeserialization("STRING", DataTypeIEC61360.STRING); + assertDeserialization("STRING_TRANSLATABLE", DataTypeIEC61360.STRING_TRANSLATABLE); + assertDeserialization("TIME", DataTypeIEC61360.TIME); + assertDeserialization("TIMESTAMP", DataTypeIEC61360.TIMESTAMP); + assertDeserialization("IRI", DataTypeIEC61360.IRI); } @Test @@ -71,8 +70,7 @@ public void whenSerializingEnum_usingStateOfEvent_shouldReturnLowerCase() { assertDeserialization("off", StateOfEvent.OFF); } - @SuppressWarnings("rawtypes") - private void assertDeserialization(String value, Enum expected) { + private void assertDeserialization(String value, Enum expected) { try { Mockito.doReturn(value).when(jsonParserMock).getText(); Class type = expected.getClass(); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 2fb858cc0..422766102 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -1,18 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import java.io.IOException; - +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; +import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; +import java.io.IOException; public class EnumSerializerTest { @@ -36,35 +52,40 @@ public void setUp() throws Exception { @Test public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { - assertSerialization(DataTypeIec61360.BOOLEAN, "BOOLEAN"); - assertSerialization(DataTypeIec61360.DATE, "DATE"); - assertSerialization(DataTypeIec61360.INTEGER_CURRENCY, "INTEGER_CURRENCY"); - assertSerialization(DataTypeIec61360.INTEGER_COUNT, "INTEGER_COUNT"); - assertSerialization(DataTypeIec61360.INTEGER_MEASURE, "INTEGER_MEASURE"); - assertSerialization(DataTypeIec61360.RATIONAL, "RATIONAL"); - assertSerialization(DataTypeIec61360.RATIONAL_MEASURE, "RATIONAL_MEASURE"); - assertSerialization(DataTypeIec61360.REAL_COUNT, "REAL_COUNT"); - assertSerialization(DataTypeIec61360.REAL_MEASURE, "REAL_MEASURE"); - assertSerialization(DataTypeIec61360.STRING, "STRING"); - assertSerialization(DataTypeIec61360.STRING_TRANSLATABLE, "STRING_TRANSLATABLE"); - assertSerialization(DataTypeIec61360.TIME, "TIME"); - assertSerialization(DataTypeIec61360.TIMESTAMP, "TIMESTAMP"); - assertSerialization(DataTypeIec61360.IRI, "IRI"); + assertSerialization(DataTypeIEC61360.BOOLEAN, "BOOLEAN"); + assertSerialization(DataTypeIEC61360.DATE, "DATE"); + assertSerialization(DataTypeIEC61360.INTEGER_CURRENCY, "INTEGER_CURRENCY"); + assertSerialization(DataTypeIEC61360.INTEGER_COUNT, "INTEGER_COUNT"); + assertSerialization(DataTypeIEC61360.INTEGER_MEASURE, "INTEGER_MEASURE"); + assertSerialization(DataTypeIEC61360.RATIONAL, "RATIONAL"); + assertSerialization(DataTypeIEC61360.RATIONAL_MEASURE, "RATIONAL_MEASURE"); + assertSerialization(DataTypeIEC61360.REAL_COUNT, "REAL_COUNT"); + assertSerialization(DataTypeIEC61360.REAL_MEASURE, "REAL_MEASURE"); + assertSerialization(DataTypeIEC61360.STRING, "STRING"); + assertSerialization(DataTypeIEC61360.STRING_TRANSLATABLE, "STRING_TRANSLATABLE"); + assertSerialization(DataTypeIEC61360.TIME, "TIME"); + assertSerialization(DataTypeIEC61360.TIMESTAMP, "TIMESTAMP"); + assertSerialization(DataTypeIEC61360.IRI, "IRI"); } @Test - public void whenSerializingEnum_usingDirection_shouldReturnLowerCase() { - assertSerialization(Direction.INPUT, "input"); - assertSerialization(Direction.OUTPUT, "output"); + public void whenSerializingEnum_usingDirection_shouldReturnUpperCase() { + assertSerialization(Direction.INPUT, "INPUT"); + assertSerialization(Direction.OUTPUT, "OUTPUT"); } @Test - public void whenSerializingEnum_usingStateOfEvent_shouldReturnLowerCase() { - assertSerialization(StateOfEvent.ON, "on"); - assertSerialization(StateOfEvent.OFF, "off"); + public void whenSerializingEnum_usingStateOfEvent_shouldReturnUpperCase() { + assertSerialization(StateOfEvent.ON, "ON"); + assertSerialization(StateOfEvent.OFF, "OFF"); } - private void assertSerialization(Enum value, String expected) { + @Test + public void whenSerializingEnum_usingModelingKind_shouldReturnCamelCase() { + assertSerialization(ModelingKind.INSTANCE, "Instance"); + assertSerialization(ModelingKind.TEMPLATE, "Template"); + } + private void assertSerialization(Enum value, String expected) { this.serializationOutput.setLength(0); try { this.enumSerializer.serialize(value, jsonGeneratorMock, serializerProviderMock); From ddc62e27fe8ae16ce7d6e2a548d73e97c79096f5 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 29 Jun 2023 10:13:02 +0200 Subject: [PATCH 05/59] Update dataformat-json project --- dataformat-json/pom.xml | 4 +- ...nistrationShellDescriptorDeserializer.java | 49 + ...ministrationShellDescriptorSerializer.java | 46 + .../json/GenericAasDeserializer.java | 49 + .../dataformat/json/GenericAasSerializer.java | 49 + .../v3/dataformat/json/JsonDeserializer.java | 336 +- .../v3/dataformat/json/JsonSerializer.java | 274 +- .../json/ReferableDeserializer.java | 55 + .../dataformat/json/ReferableSerializer.java | 46 + .../json/ReferenceDeserializer.java | 52 + .../dataformat/json/ReferenceSerializer.java | 47 + .../ReflectionAnnotationIntrospector.java | 113 + .../json/SpecificAssetIdDeserializer.java | 52 + .../json/SpecificAssetIdSerializer.java | 47 + .../json/SubmodelDescriptorDeserializer.java | 50 + .../json/SubmodelDescriptorSerializer.java | 47 + ...setAdministrationShellDescriptorMixin.java | 59 + .../json/mixins/AssetInformationMixin.java | 25 +- .../json/mixins/ConceptDescriptionMixin.java | 14 +- .../DataSpecificationIec61360Mixin.java | 25 +- .../DataSpecificationPhysicalUnitMixin.java | 101 + .../dataformat/json/mixins/EntityMixin.java | 10 +- .../v3/dataformat/json/mixins/FileMixin.java | 3 +- .../json/mixins/HasExtensionsMixin.java | 5 +- .../json/mixins/LangStringMixin.java | 33 + .../mixins/MultiLanguagePropertyMixin.java | 15 +- .../json/mixins/QualifierMixin.java | 9 +- .../json/mixins/ReferableMixin.java | 21 +- .../json/mixins/SubmodelDescriptorMixin.java | 45 + .../json/mixins/SubmodelElementListMixin.java | 6 +- .../dataformat/json/mixins/SubmodelMixin.java | 45 + .../json/modeltype/JsonTreeProcessor.java | 55 + .../json/modeltype/ModelTypeProcessor.java | 88 + dataformat-json/src/main/resources/aas.json | 641 +--- ...rationShellDescriptorDeserializerTest.java | 72 + ...strationShellDescriptorSerializerTest.java | 58 + .../dataformat/json/JsonDeserializerTest.java | 29 +- .../json/JsonReferableDeserializerTest.java | 104 +- .../json/JsonReferableSerializerTest.java | 110 +- .../json/JsonReferenceDeserializerTest.java | 96 + .../json/JsonReferenceSerializerTest.java | 79 + .../dataformat/json/JsonSerializerTest.java | 37 +- .../JsonSpecificAssetIdDeserializerTest.java | 81 + .../JsonSpecificAssetIdSerializerTest.java | 70 + ...sonSubmodelDescriptorDeserializerTest.java | 55 + .../JsonSubmodelDescriptorSerializerTest.java | 62 + .../dataformat/json/JsonValidationTest.java | 32 +- .../ReflectionAnnotationIntrospectorTest.java | 2 +- .../v3/dataformat/json/TestDataHelper.java | 73 + .../resources/AssetAdministrationShell.json | 137 +- .../src/test/resources/MotorAAS.json | 101 +- .../src/test/resources/MotorAAS_reduced.json | 262 ++ .../src/test/resources/Submodel.json | 268 +- .../src/test/resources/SubmodelElement.json | 108 +- .../resources/SubmodelElementCollection.json | 168 +- .../test/resources/SubmodelElementList.json | 277 +- .../assetAdministrationShellDescriptor.json | 112 + .../assetAdministrationShellList.json | 108 + .../src/test/resources/empty_aas.json | 2 + .../test/resources/invalidJsonExample.json | 468 +++ .../src/test/resources/jsonExample.json | 493 +++ .../resources/listOfSubmodelElements.json | 92 + .../test/resources/submodelDescriptor.json | 47 + .../resources/submodelElementListEmpty.json | 6 + .../src/test/resources/submodelList.json | 297 ++ .../resources/test_demo_full_example.json | 2878 +++++++++++++++ ...xample_withEmbeddedConceptDescription.json | 3135 +++++++++++++++++ 67 files changed, 10921 insertions(+), 1514 deletions(-) create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasDeserializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java create mode 100644 dataformat-json/src/test/resources/MotorAAS_reduced.json create mode 100644 dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json create mode 100644 dataformat-json/src/test/resources/assetAdministrationShellList.json create mode 100644 dataformat-json/src/test/resources/empty_aas.json create mode 100644 dataformat-json/src/test/resources/invalidJsonExample.json create mode 100644 dataformat-json/src/test/resources/jsonExample.json create mode 100644 dataformat-json/src/test/resources/listOfSubmodelElements.json create mode 100644 dataformat-json/src/test/resources/submodelDescriptor.json create mode 100644 dataformat-json/src/test/resources/submodelElementListEmpty.json create mode 100644 dataformat-json/src/test/resources/submodelList.json create mode 100644 dataformat-json/src/test/resources/test_demo_full_example.json create mode 100644 dataformat-json/src/test/resources/test_demo_full_example_withEmbeddedConceptDescription.json diff --git a/dataformat-json/pom.xml b/dataformat-json/pom.xml index 6b807cc93..db3ad313d 100644 --- a/dataformat-json/pom.xml +++ b/dataformat-json/pom.xml @@ -13,12 +13,12 @@ - ${project.groupId} + ${groupId} dataformat-core ${revision} - ${project.groupId} + ${groupId} dataformat-core ${revision} tests diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java new file mode 100644 index 000000000..ae3360f42 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; + +import java.util.List; + +/** + * Deserializer Interface for deserialization of AssetAdministrationShellDescriptor + */ +public interface AssetAdministrationShellDescriptorDeserializer { + + /** + * Deserializes a given string into an instance of + * the given AssetAdministrationShellDescriptor + * + * @param assetAdministrationShellDescriptor a string representation of the AssetAdministrationShellDescriptor + * @return an instance of the AssetAdministrationShellDescriptor + * @throws DeserializationException + */ + AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException; + + /** + * Deserializes a given string into an instance of + * a list of the given AssetAdministrationShellDescriptors + * + * @param assetAdministrationShellDescriptors a string representation of an array of AssetAdministrationShellDescriptors + * @return an instance of a list of the AssetAdministrationShellDescriptors + * @throws DeserializationException + */ + List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorSerializer.java new file mode 100644 index 000000000..12a9d9330 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorSerializer.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 SAP SE + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import java.util.List; + +/** + * Serializer Interface for serialization of AssetAdministrationShellDescriptor + */ +public interface AssetAdministrationShellDescriptorSerializer { + + /** + * Serializes a given instance of a AssetAdministrationShellDescriptor to string + * + * @param assetAdministrationShellDescriptor the AssetAdministrationShellDescriptor to serialize + * @return the string representation of the SpecificAssetId + * @throws SerializationException if serialization fails + */ + String writeAssetAdministrationShellDescriptor(AssetAdministrationShellDescriptor assetAdministrationShellDescriptor) throws SerializationException; + + /** + * + * @param assetAdministrationShellDescriptors the references to serialize + * @return the string representation of the list of SubmodelDescriptors + * @throws SerializationException if serialization fails + */ + String writeAssetAdministrationShellDescriptors(List assetAdministrationShellDescriptors) throws SerializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasDeserializer.java new file mode 100644 index 000000000..0e9ee092e --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasDeserializer.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) SAP SE 2022 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; + +import java.util.List; + +/** + * Serializer Interface for serialization of any AAS metamodel class + */ +public interface GenericAasDeserializer { + + /** + * Deserializes a given JSON String of an arbitrary AAS element + * + * @param aas_element the AAS-conform JSON object to deserialize + * @param outputClass the expected class of the aas_element + * @return the default implementation of the AAS-conform element class + * @throws DeserializationException if the deserialization fails + */ + T read(String aas_element, Class outputClass) throws DeserializationException ; + + + /** + * Deserializes a given JSON array to a list of AAS element + * + * @param aas_array the AAS-conform JSON array to deserialize + * @param outputClass the expected type of the aas_array elements + * @return a list of the default implementations of the aas_array elements + * @param type of the returned element + * @throws DeserializationException + */ + List readList(String aas_array, Class outputClass) throws DeserializationException ; +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasSerializer.java new file mode 100644 index 000000000..ad88697b8 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasSerializer.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) SAP SE 2022 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; + +import java.util.List; + +/** + * Serializer Interface for serialization of any AAS metamodel class + */ +public interface GenericAasSerializer { + + /** + * Serializes a given instance of an aas element to string + * + * @param aas_element the AAS-conform element to serialize + * @return the string representation of the AAS-conform element + * @throws SerializationException if serialization fails + */ + String write(T aas_element) throws SerializationException; + + + /** + * Serializes a list of aas elements to string + * + * @param aas_elements a list of AAS-conform elements to serialize + * @param the type of the AAS elements + * @return a serialised JSON array as a string + * @throws SerializationException if serialization fails + */ + String writeList(List aas_elements, Class outputClass) throws SerializationException; + + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index d44cafa7f..406ea22e3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,40 +16,36 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.List; -import java.util.stream.Collectors; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +// TODO import io.adminshell.aas.v3.dataformat.core.deserialization.EmbeddedDataSpecificationDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; + + /** * Class for deserializing/parsing AAS JSON documents. */ -public class JsonDeserializer { +public class JsonDeserializer implements Deserializer, ReferableDeserializer, ReferenceDeserializer, SpecificAssetIdDeserializer, SubmodelDescriptorDeserializer, AssetAdministrationShellDescriptorDeserializer { protected JsonMapper mapper; protected SimpleAbstractTypeResolver typeResolver; - - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + // TODO + protected static Map, com.fasterxml.jackson.databind.JsonDeserializer> customDeserializers = Map.of( + /* EmbeddedDataSpecification.class, new EmbeddedDataSpecificationDeserializer() */); public JsonDeserializer() { initTypeResolver(); @@ -62,15 +59,22 @@ protected void buildMapper() { .annotationIntrospector(new ReflectionAnnotationIntrospector()) .addModule(buildEnumModule()) .addModule(buildImplementationModule()) + .addModule(buildCustomDeserializerModule()) .build(); ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); } - @SuppressWarnings("unchecked") - private void initTypeResolver() { + protected SimpleModule buildCustomDeserializerModule() { + SimpleModule module = new SimpleModule(); + customDeserializers.forEach(module::addDeserializer); + return module; + } + + private void initTypeResolver() { typeResolver = new SimpleAbstractTypeResolver(); ReflectionHelper.DEFAULT_IMPLEMENTATIONS .stream() + .filter(x -> !customDeserializers.containsKey(x.getInterfaceType())) .forEach(x -> typeResolver.addMapping(x.getInterfaceType(), x.getImplementationType())); } @@ -86,255 +90,119 @@ protected SimpleModule buildImplementationModule() { return module; } - - /** - * Deserializes a given string into an instance of - * AssetAdministrationShellEnvironment - * - * @param value a string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ + @Override public Environment read(String value) throws DeserializationException { try { - return mapper.readValue(value, Environment.class); + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + //return mapper.treeToValue(ModelTypeProcessor.preprocess(value), Environment.class); + return mapper.treeToValue(new ObjectMapper().readTree(value), Environment.class); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); } } - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param src an InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src) throws DeserializationException { - return read(src, DEFAULT_CHARSET); - } - - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param src An InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src, Charset charset) throws DeserializationException { - return read(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator()))); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param file A java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file, Charset charset) - throws FileNotFoundException, DeserializationException { - return read(new FileInputStream(file), charset); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param file a java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if the file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { - return read(file, DEFAULT_CHARSET); - } - - /** - * Enables usage of custom implementation to be used for deserialization - * instead of default implementation, e.g. defining a custom implementation - * of the Submodel interface {@code class - * CustomSubmodel implements Submodel {}} and calling - * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will - * result in all instances of Submodel will be deserialized as - * CustomSubmodel. Subsequent class with the same aasInterface parameter - * will override the effects of all previous calls. - * - * @param the type of the interface to replace - * @param aasInterface the class of the interface to replace - * @param implementation the class implementing the interface that should be - * used for deserialization. - */ + @Override public void useImplementation(Class aasInterface, Class implementation) { typeResolver.addMapping(aasInterface, implementation); buildMapper(); } - /** - * Deserializes a given string into an instance of the given Referable - * - * @param src a string representation of the Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ public T readReferable(String src, Class outputClass) throws DeserializationException { + @Override + public T readReferable(String referable, Class outputClass) throws DeserializationException { try { - return mapper.readValue(src, outputClass); + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + //return mapper.treeToValue(ModelTypeProcessor.preprocess(referable), outputClass); + return mapper.treeToValue(new ObjectMapper().readTree(referable), outputClass); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing Referable", ex); } } - /** - * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(InputStream src, Class outputClass) throws DeserializationException { - return readReferable(src, DEFAULT_CHARSET, outputClass); + @Override + public List readReferables(String referables, Class outputClass) throws DeserializationException { + try { + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + // String parsed = mapper.writeValueAsString(ModelTypeProcessor.preprocess(referables)) ; + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(referables)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of Referables", ex); + } } - /** - * Deserializes a given input stream into an instance of the given Referable - * - * @param src a input stream representing a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - return readReferable(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator())), - outputClass); + @Override + public Reference readReference(String reference) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(reference), Reference.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the Reference", ex); + } } - /** - * Deserializes a given file into an instance of the given Referable using DEFAULT_CHARSET - * - * @param src a file containing string representation of a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public T readReferable(File src, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferable(src, DEFAULT_CHARSET, outputClass); + @Override + public List readReferences(String references) throws DeserializationException { + try { + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(references)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of References", ex); + } } - /** - * Deserializes a given file into an instance of the given Referable - * - * @param src a file containing string representation of a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public T readReferable(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferable(new FileInputStream(src), charset, outputClass); + @Override + public SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(specificAssetId), SpecificAssetId.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the SpecificAssetId", ex); + } } - /** - * Deserializes a given string into an instance of a list of the given Referables - * - * @param referables a string representation of an array of Referables - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of a list of the referables - * @throws DeserializationException if deserialization of referable fails - */ public List readReferables(String referables, Class outputClass) throws DeserializationException { + @Override + public List readSpecificAssetIds(String specificAssetIds) throws DeserializationException { try { - return mapper.readValue(referables, new TypeReference>() { - }); + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(specificAssetIds)) ; + return mapper.readValue(parsed,new TypeReference>(){}); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of Referable", ex); + throw new DeserializationException("error deserializing list of SpecificAssetIds", ex); } } - - /** - * Deserializes a given input stream into an instance of a list of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Class outputClass) throws DeserializationException { - return readReferables(src, DEFAULT_CHARSET, outputClass); + @Override + public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(submodelDescriptor), SubmodelDescriptor.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the SubmodelDescriptor", ex); + } } - /** - * Deserializes a given input stream into an instance of a list of the given Referable - * - * @param src a input stream representing a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - return readReferables(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator())), - outputClass); + @Override + public List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException { + try { + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(submodelDescriptors)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of SubmodelDescriptors", ex); + } } - /** - * Deserializes a given file into an instance of a list of the given Referable using DEFAULT_CHARSET - * - * @param src a file containing string representation of a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public List readReferables(File src, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferables(src, DEFAULT_CHARSET, outputClass); + @Override + public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(assetAdministrationShellDescriptor), AssetAdministrationShellDescriptor.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the AssetAdministrationShellDescriptor", ex); + } } - /** - * Deserializes a given file into an instance of a list of the given Referable - * - * @param src a file containing string representation of a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public List readReferables(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferables(new FileInputStream(src), charset, outputClass); + @Override + public List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException { + try { + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(assetAdministrationShellDescriptors)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of AssetAdministrationShellDescriptors", ex); + } } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 563e3506e..31310e560 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,35 +16,32 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.*; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.Collection; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleModule; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +// TODO import io.adminshell.aas.v3.dataformat.core.serialization.EmbeddedDataSpecificationSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; + +import java.util.List; /** - * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to JSON. + * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to + * JSON. */ -public class JsonSerializer { +public class JsonSerializer implements Serializer, ReferableSerializer, ReferenceSerializer, SpecificAssetIdSerializer, SubmodelDescriptorSerializer, AssetAdministrationShellDescriptorSerializer { protected JsonMapper mapper; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - public JsonSerializer() { buildMapper(); } @@ -53,136 +51,194 @@ protected void buildMapper() { .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .serializationInclusion(JsonInclude.Include.NON_NULL) .addModule(buildEnumModule()) + .addModule(buildCustomSerializerModule()) .annotationIntrospector(new ReflectionAnnotationIntrospector()) .build(); ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); } + protected SimpleModule buildCustomSerializerModule() { + SimpleModule module = new SimpleModule(); + // TODO: module.addSerializer(EmbeddedDataSpecification.class, new EmbeddedDataSpecificationSerializer()); + return module; + } + protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); module.addSerializer(Enum.class, new EnumSerializer()); return module; } - /** - * Serializes a given instance of AssetAdministrationShellEnvironment to - * string - * - * @param aasEnvironment the AssetAdministrationShellEnvironment to - * serialize - * @return the string representation of the environment - * @throws SerializationException if serialization fails - */ + @Override public String write(Environment aasEnvironment) throws SerializationException { try { - return mapper.writeValueAsString(aasEnvironment); + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + // return mapper.writeValueAsString(ModelTypeProcessor.postprocess(mapper.valueToTree(aasEnvironment))); + return mapper.writeValueAsString(mapper.valueToTree(aasEnvironment)); } catch (JsonProcessingException ex) { throw new SerializationException("error serializing AssetAdministrationShellEnvironment", ex); } } - /** - * Serializes a given instance of Environment to an - * OutputStream using DEFAULT_CHARSET - * - * @param out the Outputstream to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { - write(out, DEFAULT_CHARSET, aasEnvironment); + @Override + public String writeReferable(Referable referable) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(referable)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing Referable", ex); + } } - /** - * Serializes a given instance of Environment to an - * OutputStream using given charset - * - * @param out the Outputstream to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Charset charset, Environment aasEnvironment) - throws IOException, SerializationException { - try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { - writer.write(write(aasEnvironment)); + @Override + public String writeReferables(List referables) throws SerializationException { + if(referables.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.get(0).getClass())); + String json = objectWriter.writeValueAsString(referables); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of Referables", ex); } } - // Note that the AAS also defines a file class - /** - * Serializes a given instance of Environment to a - * java.io.File using DEFAULT_CHARSET - * - * @param file the java.io.File to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - void write(java.io.File file, Charset charset, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - try (OutputStream out = new FileOutputStream(file)) { - write(out, charset, aasEnvironment); + @Override + public String writeReference(Reference reference) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(reference)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing Referable", ex); } } - /** - * Serializes a given instance of Environment to a - * java.io.File using given charset - * - * @param file the java.io.File to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - void write(java.io.File file, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - write(file, DEFAULT_CHARSET, aasEnvironment); + @Override + public String writeReferences(List references) throws SerializationException { + if(references.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, Reference.class)); + String json = objectWriter.writeValueAsString(references); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of References", ex); + } } - /** - * Serializes a given instance of a Referable to string - * - * @param referable the referable to serialize - * @return the string representation of the referable - * @throws SerializationException if serialization fails - */ - public String write(Referable referable) throws SerializationException { + @Override + public String writeSpecificAssetId(SpecificAssetId specificAssetId) throws SerializationException { try { - return mapper.writeValueAsString(referable); + return mapper.writeValueAsString(mapper.valueToTree(specificAssetId)); } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); + throw new SerializationException("error serializing SpecificAssetId", ex); + } + } + + @Override + public String writeSpecificAssetIds(List specificAssetIds) throws SerializationException { + if(specificAssetIds.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SpecificAssetId.class)); + String json = objectWriter.writeValueAsString(specificAssetIds); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of SpecificAssetIds", ex); } } - /** - * - * @param referables the referables to serialize - * @return the string representation of the list of referables - * @throws SerializationException if serialization fails - */ - public String write(Collection referables) throws SerializationException { - if (referables == null) { + @Override + public String writeSubmodelDescriptor(SubmodelDescriptor submodelDescriptor) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(submodelDescriptor)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing SubmodelDescriptor", ex); + } + } + + @Override + public String writeSubmodelDescriptors(List submodelDescriptors) throws SerializationException { + if(submodelDescriptors.isEmpty()){ return null; - } else if (referables.isEmpty()) { - return mapper.createArrayNode().toString(); - } + } try { - return mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.iterator().next().getClass())) - .writeValueAsString(referables); + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SubmodelDescriptor.class)); + String json = objectWriter.writeValueAsString(submodelDescriptors); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of Referables", ex); + throw new SerializationException("error serializing list of SubmodelDescriptors", ex); } } + + @Override + public String writeAssetAdministrationShellDescriptor(AssetAdministrationShellDescriptor assetAdministrationShellDescriptor) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(assetAdministrationShellDescriptor)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing AssetAdministrationShellDescriptor", ex); + } + } + + @Override + public String writeAssetAdministrationShellDescriptors(List assetAdministrationShellDescriptors) throws SerializationException { + if(assetAdministrationShellDescriptors.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, AssetAdministrationShellDescriptor.class)); + String json = objectWriter.writeValueAsString(assetAdministrationShellDescriptors); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of AssetAdministrationShellDescriptors", ex); + } + } + + + +// @Override +// public String write(Object aas_element) throws SerializationException { +// try { +// // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore +// //return mapper.writeValueAsString(ModelTypeProcessor.postprocess(this.mapper.readTree(json))); +// return mapper.writeValueAsString(mapper.valueToTree(aas_element)); +// +// } catch (JsonProcessingException ex) { +// throw new SerializationException("error serializing an aas-element", ex); +// } +// } + +// @Override +// public String writeList(List aas_elements, Class outputClass) throws SerializationException { +// if(aas_elements.isEmpty()){ +// return null; +// } +// +// try { +// ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, outputClass)); +// String json = objectWriter.writeValueAsString(aas_elements); +// +// return mapper.writeValueAsString(this.mapper.readTree(json)); +// +// } catch (JsonProcessingException ex) { +// throw new SerializationException("error serializing list of AAS elements", ex); +// } +// } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java new file mode 100644 index 000000000..501ee11ce --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; + +import java.util.List; + +/** + * Deserializer Interface for deserialization of referables + */ +public interface ReferableDeserializer { + + /** + * Deserializes a given string into an instance of + * the given Referable + * + * @param referable a string representation of the + * Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException + */ + T readReferable(String referable, Class outputClass) throws DeserializationException; + + /** + * Deserializes a given string into an instance of + * a list of the given Referables + * + * @param referables a string representation of an + * array of Referables + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of a list of the referables + * @throws DeserializationException + */ + List readReferables(String referables, Class outputClass) throws DeserializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java new file mode 100644 index 000000000..41231cbfc --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; + +import java.util.List; + +/** + * Serializer Interface for serialization of referables + */ +public interface ReferableSerializer { + + /** + * Serializes a given instance of a Referable to string + * + * @param referable the referable to serialize + * @return the string representation of the referable + * @throws SerializationException if serialization fails + */ + String writeReferable(Referable referable) throws SerializationException; + + /** + * + * @param referables the referables to serialize + * @return the string representation of the list of referables + * @throws SerializationException if serialization fails + */ + String writeReferables(List referables) throws SerializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java new file mode 100644 index 000000000..99d877dd1 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +/** + * Deserializer Interface for deserialization of referables + */ +public interface ReferenceDeserializer { + + /** + * Deserializes a given string into an instance of + * the given Referable + * + * @param reference a string representation of the + * Reference + * @return an instance of the referable + * @throws DeserializationException + */ + Reference readReference(String reference) throws DeserializationException; + + /** + * Deserializes a given string into an instance of + * a list of the given Referables + * + * @param references a string representation of an + * array of References + * @return an instance of a list of the references + * @throws DeserializationException + */ + List readReferences(String references) throws DeserializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java new file mode 100644 index 000000000..affda40f4 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +/** + * Serializer Interface for serialization of referables + */ +public interface ReferenceSerializer { + + /** + * Serializes a given instance of a Referable to string + * + * @param reference the Reference to serialize + * @return the string representation of the reference + * @throws SerializationException if serialization fails + */ + String writeReference(Reference reference) throws SerializationException; + + /** + * + * @param references the references to serialize + * @return the string representation of the list of references + * @throws SerializationException if serialization fails + */ + String writeReferences(List references) throws SerializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java new file mode 100644 index 000000000..53c94daf3 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.cfg.MapperConfig; +import com.fasterxml.jackson.databind.introspect.Annotated; +import com.fasterxml.jackson.databind.introspect.AnnotatedClass; +import com.fasterxml.jackson.databind.introspect.AnnotatedMethod; +import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; +import com.fasterxml.jackson.databind.jsontype.NamedType; +import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +/** + * This class helps to dynamically decide how to de-/serialize classes and + * properties defined in the AAS model library. + * + * This is equivalent to adding the following annotations + *

    + *
  • to all interfaces defined in the AAS model: + *
      + *
    • @JsonTypeName([interface name]) + *
    • @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "modelType") + *
    • @JsonSubTypes({ + * + * \@Type(value = [sub-interface].class, name = "[sub-interface name]"), ...}) + * for each sub-interface + *
    + *
  • to all getter methods returning any type of Collection<?> defined in the + * AAS model: + *
      + *
    • @JsonInclude(JsonInclude.Include.NON_EMPTY)
    • + *
    + *
+ */ +public class ReflectionAnnotationIntrospector extends JacksonAnnotationIntrospector { + + private static final long serialVersionUID = 1L; + + private static final String MODEL_TYPE_PROPERTY = "modelType"; + private static final String GETTER_PREFIX = "get"; + + @Override + public String findTypeName(AnnotatedClass ac) { + String customType = ReflectionHelper.getModelType(ac.getRawType()); + return customType != null + ? customType + : super.findTypeName(ac); + } + + @Override + public TypeResolverBuilder findTypeResolver(MapperConfig config, AnnotatedClass ac, JavaType baseType) { + String modelType = ReflectionHelper.getModelType(ac.getRawType()); + if (modelType != null) { + TypeResolverBuilder result = _constructStdTypeResolverBuilder(); + result = result.init(JsonTypeInfo.Id.NAME, null); + result.inclusion(JsonTypeInfo.As.PROPERTY); + result.typeProperty(MODEL_TYPE_PROPERTY); + result.typeIdVisibility(false); + return result; + } + return super.findTypeResolver(config, ac, baseType); + } + + @Override + public List findSubtypes(Annotated a) { + if (ReflectionHelper.SUBTYPES.containsKey(a.getRawType()) && !ReflectionHelper.SUBTYPES.get(a.getRawType()).isEmpty()) { + return ReflectionHelper.SUBTYPES.get(a.getRawType()).stream() + .map(x -> new NamedType(x, x.getSimpleName())) + .collect(Collectors.toList()); + } + return super.findSubtypes(a); + } + + @Override + public JsonInclude.Value findPropertyInclusion(Annotated a) { + JsonInclude.Value result = super.findPropertyInclusion(a); + if (result != JsonInclude.Value.empty()) { + return result; + } + if (AnnotatedMethod.class.isAssignableFrom(a.getClass())) { + AnnotatedMethod method = (AnnotatedMethod) a; + if (method.getParameterCount() == 0 + && method.getName().startsWith(GETTER_PREFIX) + && Collection.class.isAssignableFrom(method.getRawReturnType()) + && ReflectionHelper.isModelInterfaceOrDefaultImplementation(method.getDeclaringClass())) { + return result.withValueInclusion(JsonInclude.Include.NON_EMPTY); + } + } + return result; + } + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java new file mode 100644 index 000000000..74c9145f3 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; + +import java.util.List; + +/** + * Deserializer Interface for deserialization of referables + */ +public interface SpecificAssetIdDeserializer { + + /** + * Deserializes a given string into an instance of + * the given Referable + * + * @param specificAssetId a string representation of the + * specificAssetId + * @return an instance of the referable + * @throws DeserializationException + */ + SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException; + + /** + * Deserializes a given string into an instance of + * a list of the given Referables + * + * @param specificAssetIds a string representation of an + * array of specificAssetIds + * @return an instance of a list of the referables + * @throws DeserializationException + */ + List readSpecificAssetIds(String specificAssetIds) throws DeserializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java new file mode 100644 index 000000000..d87ad3a81 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; + +import java.util.List; + +/** + * Serializer Interface for serialization of referables + */ +public interface SpecificAssetIdSerializer { + + /** + * Serializes a given instance of a Referable to string + * + * @param specificAssetId the SpecificAssetId to serialize + * @return the string representation of the SpecificAssetId + * @throws SerializationException if serialization fails + */ + String writeSpecificAssetId(SpecificAssetId specificAssetId) throws SerializationException; + + /** + * + * @param specificAssetIds the references to serialize + * @return the string representation of the list of SpecificAssetIds + * @throws SerializationException if serialization fails + */ + String writeSpecificAssetIds(List specificAssetIds) throws SerializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java new file mode 100644 index 000000000..6f157e9f3 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import java.util.List; + +/** + * Deserializer Interface for deserialization of SubmodelDescriptor + */ +public interface SubmodelDescriptorDeserializer { + + /** + * Deserializes a given string into an instance of + * the given SubmodelDescriptor + * + * @param submodelDescriptor a string representation of the SubmodelDescriptor + * @return an instance of the SubmodelDescriptor + * @throws DeserializationException + */ + SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException; + + /** + * Deserializes a given string into an instance of + * a list of the given SubmodelDescriptors + * + * @param submodelDescriptors a string representation of an array of SubmodelDescriptors + * @return an instance of a list of the SubmodelDescriptors + * @throws DeserializationException + */ + List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java new file mode 100644 index 000000000..38ccce841 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import java.util.List; + +/** + * Serializer Interface for serialization of SubmodelDescriptor + */ +public interface SubmodelDescriptorSerializer { + + /** + * Serializes a given instance of a SubmodelDescriptor to string + * + * @param submodelDescriptor the SubmodelDescriptor to serialize + * @return the string representation of the SpecificAssetId + * @throws SerializationException if serialization fails + */ + String writeSubmodelDescriptor(SubmodelDescriptor submodelDescriptor) throws SerializationException; + + /** + * + * @param submodelDescriptors the references to serialize + * @return the string representation of the list of SubmodelDescriptors + * @throws SerializationException if serialization fails + */ + String writeSubmodelDescriptors(List submodelDescriptors) throws SerializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java new file mode 100644 index 000000000..93528fee5 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import java.util.List; + +public interface AssetAdministrationShellDescriptorMixin { + + @JsonProperty("idShort") + public String getIdShort(); + + @JsonProperty("idShort") + public void setIdShort(String idShort); + + @JsonProperty("descriptions") + public List getDescription(); + + @JsonProperty("descriptions") + public void setDescription(List description); + + @JsonProperty("displayNames") + public List getDisplayName(); + + @JsonProperty("displayNames") + public void setDisplayName(List displayName); + + @JsonProperty("submodelDescriptors") + public List getSubmodelDescriptor(); + + @JsonProperty("submodelDescriptors") + public void setSubmodelDescriptor(List submodelDescriptor); + + @JsonProperty("specificAssetIds") + public SpecificAssetId getSpecificAssetId(); + + @JsonProperty("specificAssetIds") + public void setSpecificAssetId(SpecificAssetId specificAssetId); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java index 1e88c6d7f..692601fde 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,18 +17,28 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + public interface AssetInformationMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public AssetKind getAssetKind(); + @JsonProperty("thumbnail") + public void setDefaultThumbnail(File value); - @JsonProperty("globalAssetId") - public String getGlobalAssetID(); + @JsonProperty("thumbnail") + public File getDefaultThumbnail(); - @JsonProperty("globalAssetId") - public void setGlobalAssetID(String globalAssetID); + @JsonProperty("billOfMaterial") + public List getBillOfMaterials(); + + @JsonProperty("billOfMaterial") + public void setBillOfMaterials(List billOfMaterials); + + @JsonInclude(JsonInclude.Include.ALWAYS) + public AssetKind getAssetKind(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java index f5aadcd1b..919c02f51 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +17,23 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; +// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import java.util.List; public interface ConceptDescriptionMixin { @JsonProperty("isCaseOf") - public List getIsCaseOf(); + public List getIsCaseOfs(); @JsonProperty("isCaseOf") - public void setIsCaseOfs(List isCaseOf); + public void setIsCaseOfs(List isCaseOfs); +// +// @JsonProperty("embeddedDataSpecifications") +// public List getEmbeddedDataSpecifications(); +// +// @JsonProperty("embeddedDataSpecifications") +// @JsonDeserialize(using = DataSpecificationDeserializer.class) + + // TODO public void setEmbeddedDataSpecifications(List embeddedDataSpecifications); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java index 88ec3908d..67576b8cd 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,30 +18,32 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; + +// TODO import io.adminshell.aas.v3.model.LevelType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; -public interface DataSpecificationIec61360Mixin { +public interface DataSpecificationIEC61360Mixin { @JsonProperty("levelType") public List getLevelTypes(); - @JsonProperty("levelType") - public void setLevelTypes(List levelTypes); + // TODO + // @JsonProperty("levelType") + // public void setLevelTypes(List levelTypes); @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("preferredName") - public List getPreferredName(); + public List getPreferredName(); @JsonProperty("preferredName") - public void setPreferredName(List preferredName); + public void setPreferredName(List preferredName); - @JsonProperty("unitId") - public Reference getUnitID(); + @JsonProperty("shortName") + public List getShortName(); - public @JsonProperty("unitId") - void setUnitID(Reference unitID); + @JsonProperty("shortName") + public void setShortName(List shortName); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java new file mode 100644 index 000000000..3c135cfa4 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +import java.util.List; + +public interface DataSpecificationPhysicalUnitMixin { + + @JsonProperty("conversionFactor") + public List getConversionFactors(); + + @JsonProperty("conversionFactor") + public void setConversionFactors(List conversionFactors); + + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonProperty("definition") + public List getDefinition(); + + @JsonProperty("definition") + public void setDefinition(List definition); + + @JsonProperty("dinNotation") + public List getDinNotations(); + + @JsonProperty("dinNotation") + public void setDinNotations(List dinNotations); + + @JsonProperty("eceCode") + public List getEceCodes(); + + @JsonProperty("eceCode") + public void setEceCodes(List eceCodes); + + @JsonProperty("eceName") + public List getEceNames(); + + @JsonProperty("eceName") + public void setEceNames(List eceNames); + + @JsonProperty("nistName") + public List getNistNames(); + + @JsonProperty("nistName") + public void setNistNames(List nistNames); + + @JsonProperty("siName") + public List getSiNames(); + + @JsonProperty("siName") + public void setSiNames(List siNames); + + @JsonProperty("siNotation") + public List getSiNotations(); + + @JsonProperty("siNotation") + public void setSiNotations(List siNotations); + + @JsonProperty("registrationAuthorityId") + public List getRegistrationAuthorityIds(); + + @JsonProperty("registrationAuthorityId") + public void setRegistrationAuthorityIds(List registrationAuthorityIds); + + @JsonProperty("supplier") + public List getSuppliers(); + + @JsonProperty("supplier") + public void setSuppliers(List suppliers); + + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonProperty("unitName") + public List getUnitNames(); + + @JsonProperty("unitName") + public void setUnitNames(List unitNames); + + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonProperty("unitSymbol") + public List getUnitSymbols(); + + @JsonProperty("unitSymbol") + public void setUnitSymbols(List unitSymbols); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java index c6d9a89ef..e32fd4385 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,15 +19,16 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; public interface EntityMixin { @JsonInclude(JsonInclude.Include.ALWAYS) public EntityType getEntityType(); - @JsonProperty("globalAssetId") - public String getGlobalAssetID(); + @JsonProperty("specificAssetIds") + public SpecificAssetId getExternalAssetId(); - @JsonProperty("globalAssetId") - public void setGlobalAssetID(String globalAssetID); + @JsonProperty("specificAssetIds") + public void setExternalAssetId(SpecificAssetId externalAssetId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java index 91b903b08..70c41f799 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,5 +21,5 @@ public interface FileMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public String getContentType(); + public String getMimeType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java index d97c658e3..b39b6a735 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,9 +24,9 @@ public interface HasExtensionsMixin { - @JsonProperty("extension") + @JsonProperty("extensions") public List getExtensions(); - @JsonProperty("extension") + @JsonProperty("extensions") public void setExtensions(List extensions); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java new file mode 100644 index 000000000..20a22471d --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +public interface LangStringMixin { + + @JsonProperty("text") + @JsonInclude(JsonInclude.Include.ALWAYS) + public String getText(); + + @JsonProperty("text") + public void setText(String value); + + @JsonInclude(JsonInclude.Include.ALWAYS) + public String getLanguage(); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java index cacb010eb..554ce2b7c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,22 +17,16 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; + +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface MultiLanguagePropertyMixin { @JsonProperty("value") - public List getValue(); + public List getValue(); @JsonProperty("value") - public void setValue(LangStringTextType value); - - @JsonProperty("valueId") - public Reference getValueID(); - - @JsonProperty("valueId") - public void setValueID(Reference valueID); + public void setValue(LangString value); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java index 6cdd8c2a3..18da0db82 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,17 +17,9 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface QualifierMixin { @JsonInclude(JsonInclude.Include.ALWAYS) public String getType(); - - @JsonProperty("valueId") - public Reference getValueID(); - - @JsonProperty("valueId") - void setValueID(Reference valueID); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java index d93eb2c17..c98dd784a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,23 +16,31 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import java.util.List; +import java.util.Set; public interface ReferableMixin { + @JsonProperty("idShort") + public String getIdShort(); + + @JsonProperty("idShort") + public void setIdShort(String idShort); + @JsonProperty("description") - public List getDescription(); + public List getDescription(); @JsonProperty("description") - public void setDescription(List description); + public void setDescription(List description); @JsonProperty("displayName") - public List getDisplayName(); + public List getDisplayName(); @JsonProperty("displayName") - public void setDisplayName(List displayNames); + public void setDisplayName(List displayName); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java new file mode 100644 index 000000000..95826b52d --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import java.util.List; + +public interface SubmodelDescriptorMixin { + + @JsonProperty("descriptions") + public List getDescription(); + + @JsonProperty("descriptions") + public void setDescription(List description); + + @JsonProperty("displayNames") + public List getDisplayName(); + + @JsonProperty("displayNames") + public void setDisplayName(List displayName); + + @JsonProperty("specificAssetIds") + public SpecificAssetId getSpecificAssetId(); + + @JsonProperty("specificAssetIds") + public void setSpecificAssetId(SpecificAssetId specificAssetId); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java index 5ca0161db..68ad53ec7 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +18,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.Collection; -import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; public interface SubmodelElementListMixin { diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java new file mode 100644 index 000000000..56d53fc33 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.Collection; +import java.util.List; + +public interface SubmodelMixin { + + @JsonProperty("idShort") + public String getIdShort(); + + @JsonProperty("idShort") + public void setIdShort(String idShort); + + @JsonProperty("description") + public List getDescription(); + + @JsonProperty("description") + public void setDescription(List description); + + @JsonProperty("displayName") + public List getDisplayName(); + + @JsonProperty("displayName") + public void setDisplayName(List displayName); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java new file mode 100644 index 000000000..60de90b26 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.modeltype; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.function.Consumer; + +/** + * Helper class to traverse a JsonNode recursive and applying an operation to + * each node + */ +public class JsonTreeProcessor { + + private final Consumer operator; + + public static void traverse(JsonNode node, Consumer operator) { + new JsonTreeProcessor(operator).traverse(node); + } + + public JsonTreeProcessor(Consumer operator) { + this.operator = operator; + } + + public void traverse(JsonNode node) { + if (null == node.getNodeType()) { + return; + } + switch (node.getNodeType()) { + case ARRAY: + node.elements().forEachRemaining(x -> traverse(x)); + break; + case OBJECT: + operator.accept((ObjectNode) node); + node.elements().forEachRemaining(x -> traverse(x)); + break; + default: + // do nothing + } + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java new file mode 100644 index 000000000..19c04a054 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.modeltype; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + +/** + * Helper class to deal with nested nature of modelType property in JSON. As + * Jackson can not natively deal with such nested type information, this class + * offers functions to unwrapp the modelType information via the preprocess(...) + * method and wrap it again via postprocess(...). + */ +public class ModelTypeProcessor { + + private static final String MODEL_TYPE = "modelType"; + private static final String MODEL_TYPE_NAME = "name"; + + /** + * Unwrapps type information recursively, e.g. converts + *
+     * "modelType": {
+     *      "name": "Foo"
+     * }
+     * 
to + *
+     * "modelType": "Foo"
+     * 
+ * + * @param json json as string + * @return root node with unwrapped type information + * @throws JsonProcessingException parsing JSON fails + */ + public static JsonNode preprocess(String json) throws JsonProcessingException { + JsonNode result = new ObjectMapper().readTree(json); + JsonTreeProcessor.traverse(result, + x -> { + if (x.get(MODEL_TYPE) != null) { + x.replace(MODEL_TYPE, x.get(MODEL_TYPE).get(MODEL_TYPE_NAME)); + } + }); + return result; + } + + /** + * Wraps type information recursively, e.g. converts + *
+     * "modelType": "Foo"
+     * 
to + *
+     * "modelType": {
+     *      "name": "Foo"
+     * }
+     * 
+ * + * @param node root node + * @return transformed root node + * @throws JsonProcessingException parsing JSON fails + */ + public static JsonNode postprocess(JsonNode node) throws JsonProcessingException { + JsonTreeProcessor.traverse(node, + x -> { + if (x.get(MODEL_TYPE) != null && x.get(MODEL_TYPE).isTextual()) { + ObjectNode nodeModelType = JsonNodeFactory.instance.objectNode(); + nodeModelType.set(MODEL_TYPE_NAME, JsonNodeFactory.instance.textNode(x.get(MODEL_TYPE).asText())); + x.replace(MODEL_TYPE, nodeModelType); + } + }); + return node; + } +} diff --git a/dataformat-json/src/main/resources/aas.json b/dataformat-json/src/main/resources/aas.json index 496811106..3d0b2a302 100644 --- a/dataformat-json/src/main/resources/aas.json +++ b/dataformat-json/src/main/resources/aas.json @@ -7,7 +7,7 @@ "$ref": "#/definitions/Environment" } ], - "$id": "https://admin-shell.io/aas/3/0", + "$id": "https://admin-shell.io/aas/3/0/RC02", "definitions": { "AasSubmodelElements": { "type": "string", @@ -31,24 +31,6 @@ "SubmodelElementList" ] }, - "AbstractLangString": { - "type": "object", - "properties": { - "language": { - "type": "string", - "pattern": "^(([a-zA-Z]{2,3}(-[a-zA-Z]{3}(-[a-zA-Z]{3}){2})?|[a-zA-Z]{4}|[a-zA-Z]{5,8})(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-(([a-zA-Z0-9]){5,8}|[0-9]([a-zA-Z0-9]){3}))*(-[0-9A-WY-Za-wy-z](-([a-zA-Z0-9]){2,8})+)*(-[xX](-([a-zA-Z0-9]){1,8})+)?|[xX](-([a-zA-Z0-9]){1,8})+|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" - }, - "text": { - "type": "string", - "minLength": 1, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - } - }, - "required": [ - "language", - "text" - ] - }, "AdministrativeInformation": { "allOf": [ { @@ -58,42 +40,11 @@ "properties": { "version": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 4 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^(0|[1-9][0-9]*)$" - } - ] + "minLength": 1 }, "revision": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 4 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^(0|[1-9][0-9]*)$" - } - ] - }, - "creator": { - "$ref": "#/definitions/Reference" - }, - "templateId": { - "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 } } } @@ -102,19 +53,16 @@ "AnnotatedRelationshipElement": { "allOf": [ { - "$ref": "#/definitions/RelationshipElement_abstract" + "$ref": "#/definitions/RelationshipElement" }, { "properties": { "annotations": { "type": "array", "items": { - "$ref": "#/definitions/DataElement_choice" + "$ref": "#/definitions/DataElement" }, "minItems": 1 - }, - "modelType": { - "const": "AnnotatedRelationshipElement" } } } @@ -142,9 +90,6 @@ "$ref": "#/definitions/Reference" }, "minItems": 1 - }, - "modelType": { - "const": "AssetAdministrationShell" } }, "required": [ @@ -160,10 +105,7 @@ "$ref": "#/definitions/AssetKind" }, "globalAssetId": { - "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "$ref": "#/definitions/Reference" }, "specificAssetIds": { "type": "array", @@ -172,12 +114,6 @@ }, "minItems": 1 }, - "assetType": { - "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, "defaultThumbnail": { "$ref": "#/definitions/Resource" } @@ -190,7 +126,6 @@ "type": "string", "enum": [ "Instance", - "NotApplicable", "Type" ] }, @@ -212,27 +147,22 @@ }, "messageTopic": { "type": "string", - "minLength": 1, - "maxLength": 255, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "messageBroker": { "$ref": "#/definitions/Reference" }, "lastUpdate": { "type": "string", - "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)(Z|\\+00:00|-00:00)$" + "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" }, "minInterval": { "type": "string", - "pattern": "^-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S))))$" + "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" }, "maxInterval": { "type": "string", - "pattern": "^-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S))))$" - }, - "modelType": { - "const": "BasicEventElement" + "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" } }, "required": [ @@ -256,21 +186,8 @@ }, "contentType": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 100 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\u0080-\u00ff])|\\\\([\\t !-~]|[\u0080-\u00ff]))*\"))*$" - } - ] - }, - "modelType": { - "const": "Blob" + "minLength": 1, + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \t]*;[ \t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\t !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([\t !-~]|[\\x80-\\xff]))*\"))*$" } }, "required": [ @@ -280,18 +197,7 @@ ] }, "Capability": { - "allOf": [ - { - "$ref": "#/definitions/SubmodelElement" - }, - { - "properties": { - "modelType": { - "const": "Capability" - } - } - } - ] + "$ref": "#/definitions/SubmodelElement" }, "ConceptDescription": { "allOf": [ @@ -309,9 +215,6 @@ "$ref": "#/definitions/Reference" }, "minItems": 1 - }, - "modelType": { - "const": "ConceptDescription" } } } @@ -320,28 +223,6 @@ "DataElement": { "$ref": "#/definitions/SubmodelElement" }, - "DataElement_choice": { - "oneOf": [ - { - "$ref": "#/definitions/Blob" - }, - { - "$ref": "#/definitions/File" - }, - { - "$ref": "#/definitions/MultiLanguageProperty" - }, - { - "$ref": "#/definitions/Property" - }, - { - "$ref": "#/definitions/Range" - }, - { - "$ref": "#/definitions/ReferenceElement" - } - ] - }, "DataSpecificationContent": { "type": "object", "properties": { @@ -353,14 +234,7 @@ "modelType" ] }, - "DataSpecificationContent_choice": { - "oneOf": [ - { - "$ref": "#/definitions/DataSpecificationIec61360" - } - ] - }, - "DataSpecificationIec61360": { + "DataSpecificationIEC61360": { "allOf": [ { "$ref": "#/definitions/DataSpecificationContent" @@ -370,64 +244,54 @@ "preferredName": { "type": "array", "items": { - "$ref": "#/definitions/LangStringPreferredNameTypeIec61360" + "$ref": "#/definitions/LangString" }, "minItems": 1 }, "shortName": { "type": "array", "items": { - "$ref": "#/definitions/LangStringShortNameTypeIec61360" + "$ref": "#/definitions/LangString" }, "minItems": 1 }, "unit": { "type": "string", - "minLength": 1, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "unitId": { "$ref": "#/definitions/Reference" }, "sourceOfDefinition": { "type": "string", - "minLength": 1, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "symbol": { "type": "string", - "minLength": 1, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "dataType": { - "$ref": "#/definitions/DataTypeIec61360" + "$ref": "#/definitions/DataTypeIEC61360" }, "definition": { "type": "array", "items": { - "$ref": "#/definitions/LangStringDefinitionTypeIec61360" + "$ref": "#/definitions/LangString" }, "minItems": 1 }, "valueFormat": { "type": "string", - "minLength": 1, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "valueList": { "$ref": "#/definitions/ValueList" }, "value": { - "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "type": "string" }, "levelType": { "$ref": "#/definitions/LevelType" - }, - "modelType": { - "const": "DataSpecificationIec61360" } }, "required": [ @@ -436,6 +300,77 @@ } ] }, + "DataSpecificationPhysicalUnit": { + "allOf": [ + { + "$ref": "#/definitions/DataSpecificationContent" + }, + { + "properties": { + "unitName": { + "type": "string", + "minLength": 1 + }, + "unitSymbol": { + "type": "string", + "minLength": 1 + }, + "definition": { + "type": "array", + "items": { + "$ref": "#/definitions/LangString" + }, + "minItems": 1 + }, + "siNotation": { + "type": "string", + "minLength": 1 + }, + "siName": { + "type": "string", + "minLength": 1 + }, + "dinNotation": { + "type": "string", + "minLength": 1 + }, + "eceName": { + "type": "string", + "minLength": 1 + }, + "eceCode": { + "type": "string", + "minLength": 1 + }, + "nistName": { + "type": "string", + "minLength": 1 + }, + "sourceOfDefinition": { + "type": "string", + "minLength": 1 + }, + "conversionFactor": { + "type": "string", + "minLength": 1 + }, + "registrationAuthorityId": { + "type": "string", + "minLength": 1 + }, + "supplier": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "unitName", + "unitSymbol", + "definition" + ] + } + ] + }, "DataTypeDefXsd": { "type": "string", "enum": [ @@ -445,6 +380,8 @@ "xs:byte", "xs:date", "xs:dateTime", + "xs:dateTimeStamp", + "xs:dayTimeDuration", "xs:decimal", "xs:double", "xs:duration", @@ -468,10 +405,11 @@ "xs:unsignedByte", "xs:unsignedInt", "xs:unsignedLong", - "xs:unsignedShort" + "xs:unsignedShort", + "xs:yearMonthDuration" ] }, - "DataTypeIec61360": { + "DataTypeIEC61360": { "type": "string", "enum": [ "BLOB", @@ -509,7 +447,7 @@ "$ref": "#/definitions/Reference" }, "dataSpecificationContent": { - "$ref": "#/definitions/DataSpecificationContent_choice" + "$ref": "#/definitions/DataSpecificationContent" } }, "required": [ @@ -527,7 +465,7 @@ "statements": { "type": "array", "items": { - "$ref": "#/definitions/SubmodelElement_choice" + "$ref": "#/definitions/SubmodelElement" }, "minItems": 1 }, @@ -535,20 +473,10 @@ "$ref": "#/definitions/EntityType" }, "globalAssetId": { - "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - "specificAssetIds": { - "type": "array", - "items": { - "$ref": "#/definitions/SpecificAssetId" - }, - "minItems": 1 + "$ref": "#/definitions/Reference" }, - "modelType": { - "const": "Entity" + "specificAssetId": { + "$ref": "#/definitions/SpecificAssetId" } }, "required": [ @@ -610,20 +538,18 @@ }, "topic": { "type": "string", - "minLength": 1, - "maxLength": 255, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "subjectId": { "$ref": "#/definitions/Reference" }, "timeStamp": { "type": "string", - "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)(Z|\\+00:00|-00:00)$" + "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" }, "payload": { "type": "string", - "contentEncoding": "base64" + "minLength": 1 } }, "required": [ @@ -641,9 +567,7 @@ "properties": { "name": { "type": "string", - "minLength": 1, - "maxLength": 128, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "valueType": { "$ref": "#/definitions/DataTypeDefXsd" @@ -652,11 +576,7 @@ "type": "string" }, "refersTo": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - }, - "minItems": 1 + "$ref": "#/definitions/Reference" } }, "required": [ @@ -674,36 +594,13 @@ "properties": { "value": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 2000 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" - } - ] + "minLength": 1, + "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" }, "contentType": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 100 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\u0080-\u00ff])|\\\\([\\t !-~]|[\u0080-\u00ff]))*\"))*$" - } - ] - }, - "modelType": { - "const": "File" + "minLength": 1, + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \t]*;[ \t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\t !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([\t !-~]|[\\x80-\\xff]))*\"))*$" } }, "required": [ @@ -740,7 +637,7 @@ "type": "object", "properties": { "kind": { - "$ref": "#/definitions/ModellingKind" + "$ref": "#/definitions/ModelingKind" } } }, @@ -771,9 +668,7 @@ }, "id": { "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 } }, "required": [ @@ -790,9 +685,7 @@ }, "value": { "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 } }, "required": [ @@ -829,97 +722,29 @@ "SubmodelElementList" ] }, - "LangStringDefinitionTypeIec61360": { - "allOf": [ - { - "$ref": "#/definitions/AbstractLangString" - }, - { - "properties": { - "text": { - "maxLength": 1023 - } - } - } - ] - }, - "LangStringNameType": { - "allOf": [ - { - "$ref": "#/definitions/AbstractLangString" - }, - { - "properties": { - "text": { - "maxLength": 128 - } - } - } - ] - }, - "LangStringPreferredNameTypeIec61360": { - "allOf": [ - { - "$ref": "#/definitions/AbstractLangString" - }, - { - "properties": { - "text": { - "maxLength": 255 - } - } - } - ] - }, - "LangStringShortNameTypeIec61360": { - "allOf": [ - { - "$ref": "#/definitions/AbstractLangString" - }, - { - "properties": { - "text": { - "maxLength": 18 - } - } - } - ] - }, - "LangStringTextType": { - "allOf": [ - { - "$ref": "#/definitions/AbstractLangString" - }, - { - "properties": { - "text": { - "maxLength": 1023 - } - } - } - ] - }, - "LevelType": { + "LangString": { "type": "object", "properties": { - "min": { - "type": "boolean" - }, - "nom": { - "type": "boolean" - }, - "typ": { - "type": "boolean" + "language": { + "type": "string", + "pattern": "^(([a-zA-Z]{2,3}(-[a-zA-Z]{3}(-[a-zA-Z]{3}){2})?|[a-zA-Z]{4}|[a-zA-Z]{5,8})(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-(([a-zA-Z0-9]){5,8}|[0-9]([a-zA-Z0-9]){3}))*(-[0-9A-WY-Za-wy-z](-([a-zA-Z0-9]){2,8})+)*(-[xX](-([a-zA-Z0-9]){1,8})+)?|[xX](-([a-zA-Z0-9]){1,8})+|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" }, - "max": { - "type": "boolean" + "text": { + "type": "string" } }, "required": [ - "min", - "nom", - "typ", - "max" + "language", + "text" + ] + }, + "LevelType": { + "type": "string", + "enum": [ + "Max", + "Min", + "Nom", + "Typ" ] }, "ModelType": { @@ -931,7 +756,8 @@ "Blob", "Capability", "ConceptDescription", - "DataSpecificationIec61360", + "DataSpecificationIEC61360", + "DataSpecificationPhysicalUnit", "Entity", "File", "MultiLanguageProperty", @@ -945,7 +771,7 @@ "SubmodelElementList" ] }, - "ModellingKind": { + "ModelingKind": { "type": "string", "enum": [ "Instance", @@ -962,15 +788,12 @@ "value": { "type": "array", "items": { - "$ref": "#/definitions/LangStringTextType" + "$ref": "#/definitions/LangString" }, "minItems": 1 }, "valueId": { "$ref": "#/definitions/Reference" - }, - "modelType": { - "const": "MultiLanguageProperty" } } } @@ -1003,9 +826,6 @@ "$ref": "#/definitions/OperationVariable" }, "minItems": 1 - }, - "modelType": { - "const": "Operation" } } } @@ -1015,7 +835,7 @@ "type": "object", "properties": { "value": { - "$ref": "#/definitions/SubmodelElement_choice" + "$ref": "#/definitions/SubmodelElement" } }, "required": [ @@ -1037,9 +857,6 @@ }, "valueId": { "$ref": "#/definitions/Reference" - }, - "modelType": { - "const": "Property" } }, "required": [ @@ -1078,9 +895,7 @@ }, "type": { "type": "string", - "minLength": 1, - "maxLength": 128, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "valueType": { "$ref": "#/definitions/DataTypeDefXsd" @@ -1122,9 +937,6 @@ }, "max": { "type": "string" - }, - "modelType": { - "const": "Range" } }, "required": [ @@ -1142,39 +954,31 @@ "properties": { "category": { "type": "string", - "minLength": 1, - "maxLength": 128, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "idShort": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 128 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$" - } - ] + "maxLength": 128, + "pattern": "^[a-zA-Z][a-zA-Z0-9_]+$" }, "displayName": { "type": "array", "items": { - "$ref": "#/definitions/LangStringNameType" + "$ref": "#/definitions/LangString" }, "minItems": 1 }, "description": { "type": "array", "items": { - "$ref": "#/definitions/LangStringTextType" + "$ref": "#/definitions/LangString" }, "minItems": 1 }, + "checksum": { + "type": "string", + "minLength": 1 + }, "modelType": { "$ref": "#/definitions/ModelType" } @@ -1216,9 +1020,6 @@ "properties": { "value": { "$ref": "#/definitions/Reference" - }, - "modelType": { - "const": "ReferenceElement" } } } @@ -1227,25 +1028,11 @@ "ReferenceTypes": { "type": "string", "enum": [ - "ExternalReference", + "GlobalReference", "ModelReference" ] }, "RelationshipElement": { - "allOf": [ - { - "$ref": "#/definitions/RelationshipElement_abstract" - }, - { - "properties": { - "modelType": { - "const": "RelationshipElement" - } - } - } - ] - }, - "RelationshipElement_abstract": { "allOf": [ { "$ref": "#/definitions/SubmodelElement" @@ -1266,48 +1053,18 @@ } ] }, - "RelationshipElement_choice": { - "oneOf": [ - { - "$ref": "#/definitions/RelationshipElement" - }, - { - "$ref": "#/definitions/AnnotatedRelationshipElement" - } - ] - }, "Resource": { "type": "object", "properties": { "path": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 2000 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" - } - ] + "minLength": 1, + "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" }, "contentType": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 100 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\u0080-\u00ff])|\\\\([\\t !-~]|[\u0080-\u00ff]))*\"))*$" - } - ] + "minLength": 1, + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \t]*;[ \t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\t !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([\t !-~]|[\\x80-\\xff]))*\"))*$" } }, "required": [ @@ -1323,15 +1080,11 @@ "properties": { "name": { "type": "string", - "minLength": 1, - "maxLength": 64, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "value": { "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "externalSubjectId": { "$ref": "#/definitions/Reference" @@ -1339,7 +1092,8 @@ }, "required": [ "name", - "value" + "value", + "externalSubjectId" ] } ] @@ -1373,12 +1127,9 @@ "submodelElements": { "type": "array", "items": { - "$ref": "#/definitions/SubmodelElement_choice" + "$ref": "#/definitions/SubmodelElement" }, "minItems": 1 - }, - "modelType": { - "const": "Submodel" } } } @@ -1389,6 +1140,9 @@ { "$ref": "#/definitions/Referable" }, + { + "$ref": "#/definitions/HasKind" + }, { "$ref": "#/definitions/HasSemantics" }, @@ -1410,12 +1164,9 @@ "value": { "type": "array", "items": { - "$ref": "#/definitions/SubmodelElement_choice" + "$ref": "#/definitions/SubmodelElement" }, "minItems": 1 - }, - "modelType": { - "const": "SubmodelElementCollection" } } } @@ -1431,6 +1182,13 @@ "orderRelevant": { "type": "boolean" }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/SubmodelElement" + }, + "minItems": 1 + }, "semanticIdListElement": { "$ref": "#/definitions/Reference" }, @@ -1439,16 +1197,6 @@ }, "valueTypeListElement": { "$ref": "#/definitions/DataTypeDefXsd" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/SubmodelElement_choice" - }, - "minItems": 1 - }, - "modelType": { - "const": "SubmodelElementList" } }, "required": [ @@ -1457,52 +1205,6 @@ } ] }, - "SubmodelElement_choice": { - "oneOf": [ - { - "$ref": "#/definitions/RelationshipElement" - }, - { - "$ref": "#/definitions/AnnotatedRelationshipElement" - }, - { - "$ref": "#/definitions/BasicEventElement" - }, - { - "$ref": "#/definitions/Blob" - }, - { - "$ref": "#/definitions/Capability" - }, - { - "$ref": "#/definitions/Entity" - }, - { - "$ref": "#/definitions/File" - }, - { - "$ref": "#/definitions/MultiLanguageProperty" - }, - { - "$ref": "#/definitions/Operation" - }, - { - "$ref": "#/definitions/Property" - }, - { - "$ref": "#/definitions/Range" - }, - { - "$ref": "#/definitions/ReferenceElement" - }, - { - "$ref": "#/definitions/SubmodelElementCollection" - }, - { - "$ref": "#/definitions/SubmodelElementList" - } - ] - }, "ValueList": { "type": "object", "properties": { @@ -1522,10 +1224,7 @@ "type": "object", "properties": { "value": { - "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "type": "string" }, "valueId": { "$ref": "#/definitions/Reference" diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java new file mode 100644 index 000000000..5fc1f8e6e --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.Arrays; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +public class JsonAssetAdministrationShellDescriptorDeserializerTest { + + private static final Logger logger = LoggerFactory.getLogger(JsonAssetAdministrationShellDescriptorDeserializerTest.class); + + + + public static AssetAdministrationShellDescriptor createAasDescriptor() { + + SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() + .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) + .externalSubjectId(TestDataHelper.createReference( + ReferenceTypes.MODEL_REFERENCE, KeyTypes.ASSET_ADMINISTRATION_SHELL, "defaultSpecificAssetId")) + .name("defaultSpecificAssetIdName") + .value("http://example.company/myAsset").build(); + + return new DefaultAssetAdministrationShellDescriptor.Builder() + .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) + .description(TestDataHelper.DEFAULT_DESCRIPTION) + .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) + .identification(TestDataHelper.DEFAULT_IDENTIFICATION) + .idShort(TestDataHelper.DEFAULT_ID_SHORT) + .specificAssetId(specificAssetId) + .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) + .globalAssetId(TestDataHelper.createReference(ReferenceTypes.MODEL_REFERENCE, KeyTypes.ASSET_ADMINISTRATION_SHELL, "defaultGlobalAssetId")) + .submodelDescriptor(List.of(JsonSubmodelDescriptorDeserializerTest.getDefaultSubmodelDescriptor())).build(); + } + + @Test + public void testReadAasDescriptor() throws IOException, DeserializationException { + File fileExpected = new File("src/test/resources/assetAdministrationShellDescriptor.json"); + String expected = Files.readString(fileExpected.toPath()); + AssetAdministrationShellDescriptor assetAdministrationShellDescriptor = new JsonDeserializer().readAssetAdministrationShellDescriptor(expected); + AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); + + assertEquals(aasExpected, assetAdministrationShellDescriptor); + } + +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java new file mode 100644 index 000000000..bd7e90a73 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import org.json.JSONException; +import org.junit.Test; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.Set; + +import static org.junit.Assert.assertTrue; + +public class JsonAssetAdministrationShellDescriptorSerializerTest { + + + private static final Logger logger = LoggerFactory.getLogger(JsonAssetAdministrationShellDescriptorSerializerTest.class); + + + @Test + public void testReadAssetAdministrationShellDescriptor() throws IOException, SerializationException, JSONException { + File fileExpected = new File("src/test/resources/assetAdministrationShellDescriptor.json"); + + validateAndCompare(fileExpected, JsonAssetAdministrationShellDescriptorDeserializerTest.createAasDescriptor()); + } + + private void validateAndCompare(File expectedFile, AssetAdministrationShellDescriptor descriptor) throws IOException, SerializationException, JSONException { + String expected = Files.readString(expectedFile.toPath()); + String actual = new JsonSerializer().writeAssetAdministrationShellDescriptor(descriptor); + logger.info(actual); + Set errors = new JsonSchemaValidator().validateSchema(actual); + assertTrue(errors.isEmpty()); + JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); + JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); + } +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 8f70a124a..f42b06cfd 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,44 +18,48 @@ import static org.junit.Assert.assertEquals; +import org.junit.Assert; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import org.junit.Assert; -import org.junit.Test; public class JsonDeserializerTest { + private static final Logger logger = LoggerFactory.getLogger(JsonDeserializerTest.class); + @Test public void testReadFromFile() throws Exception { - new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); + new JsonDeserializer().read(JsonSerializerTest.AASFULL_FILE); } @Test public void testSimpleExample() throws Exception { - Environment expected = Examples.EXAMPLE_SIMPLE.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_SIMPLE.fileContentStream()); - Assert.assertEquals(expected, actual); + Environment env = new JsonDeserializer().read(JsonSerializerTest.AASSIMPLE_FILE); + Assert.assertEquals(AASSimple.ENVIRONMENT, env); } @Test public void testFullExample() throws Exception { - Environment expected = Examples.EXAMPLE_FULL.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); - Assert.assertEquals(expected, actual); + Environment env = new JsonDeserializer().read(JsonSerializerTest.AASFULL_FILE); + Assert.assertEquals(AASFull.ENVIRONMENT, env); } @Test public void testCustomImplementationClass() throws Exception { - String json = new JsonSerializer().write(AASSimple.createEnvironment()); - JsonDeserializer deserializer = new JsonDeserializer(); + String json = new JsonSerializer().write(AASSimple.ENVIRONMENT); + Deserializer deserializer = new JsonDeserializer(); Environment environment = deserializer.read(json); checkImplementationClasses(environment, DefaultSubmodel.class, DefaultProperty.class); deserializer.useImplementation(Submodel.class, CustomSubmodel.class); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java index 68ef1d473..4d32ad062 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,84 +18,119 @@ import static org.junit.Assert.assertEquals; +import java.io.File; import java.io.IOException; -import java.util.Collections; +import java.nio.file.Files; +import java.util.Arrays; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; + import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; public class JsonReferableDeserializerTest { + private static final Logger logger = LoggerFactory.getLogger(JsonReferableDeserializerTest.class); + @Test public void testReadAAS() throws IOException, DeserializationException { - AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); - AssetAdministrationShell actual = new JsonDeserializer().readReferable(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/assetAdministrationShell.json"); + String expected = Files.readString(fileExpected.toPath()); + AssetAdministrationShell aas = new JsonDeserializer().readReferable(expected, AssetAdministrationShell.class); + Environment environment = AASFull.ENVIRONMENT; + AssetAdministrationShell aasExpected = environment.getAssetAdministrationShells().get(0); + + assertEquals(aasExpected, aas); } @Test public void testReadAASs() throws IOException, DeserializationException { - List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/assetAdministrationShellList.json"); + String expected = Files.readString(fileExpected.toPath()); + List aas = new JsonDeserializer().readReferables(expected, AssetAdministrationShell.class); + Environment environment = AASFull.ENVIRONMENT; + List aasExpected = Arrays.asList(environment.getAssetAdministrationShells().get(0) + ,environment.getAssetAdministrationShells().get(1)) ; + + assertEquals(aasExpected, aas); } @Test public void testReadSubmodel() throws IOException, DeserializationException { - Submodel expected = Examples.SUBMODEL.getModel(); - Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodel.json"); + String expected = Files.readString(fileExpected.toPath()); + Submodel submodel = new JsonDeserializer().readReferable(expected, Submodel.class); + Environment environment = AASFull.ENVIRONMENT; + Submodel submodelExpected = environment.getSubmodels().get(0); + + assertEquals(submodelExpected, submodel); } @Test public void testReadSubmodels() throws IOException, DeserializationException { - List expected = Examples.SUBMODEL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelList.json"); + String expected = Files.readString(fileExpected.toPath()); + List submodels = new JsonDeserializer().readReferables(expected,Submodel.class); + Environment environment = AASFull.ENVIRONMENT; + List submodelsExpected = Arrays.asList(environment.getSubmodels().get(0),environment.getSubmodels().get(1)); + + assertEquals(submodelsExpected, submodels); } @Test public void testReadSubmodelElement() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); - SubmodelElement actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelElement.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelElement submodelElement = new JsonDeserializer().readReferable(expected,SubmodelElement.class); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElementExpected = environment.getSubmodels().get(0).getSubmodelElements().get(0); + + assertEquals(submodelElementExpected, submodelElement); } @Test public void testReadSubmodelElements() throws IOException, DeserializationException { - List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables( - Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/listOfSubmodelElements.json"); + String expected = Files.readString(fileExpected.toPath()); + List submodelElements = new JsonDeserializer().readReferables(expected,SubmodelElement.class); + Environment environment = AASFull.ENVIRONMENT; + List submodelElementsExpected = Arrays.asList( + environment.getSubmodels().get(0).getSubmodelElements().get(0), + environment.getSubmodels().get(0).getSubmodelElements().get(1)); ; + + assertEquals(submodelElementsExpected, submodelElements); } @Test public void testReadSubmodelElementList() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); - SubmodelElementList actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelElementList.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelElementList submodelElementList = new JsonDeserializer().readReferable(expected, SubmodelElementList.class); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElementListExpected = environment.getSubmodels().get(6).getSubmodelElements().get(5); ; + + assertEquals(submodelElementListExpected, submodelElementList); } @Test public void testReadSubmodelElementCollection() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); - SubmodelElementCollection actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelElementCollection.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelElementCollection submodelElementCollection = new JsonDeserializer().readReferable(expected, SubmodelElementCollection.class); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElementCollectionExpected = environment.getSubmodels().get(6).getSubmodelElements().get(6); ; + + assertEquals(submodelElementCollectionExpected, submodelElementCollection); } - @Test - public void testReadEmptyReferableList() throws DeserializationException { - List emptyList = Collections.emptyList(); - List deserialized = new JsonDeserializer().readReferables("[]", Referable.class); - assertEquals(emptyList, deserialized); - } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java index 7df276487..43fcec6f6 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,92 +16,125 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import java.io.File; import java.io.IOException; -import java.util.Collection; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import java.nio.file.Files; +import java.sql.Ref; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.json.JSONException; -import org.junit.Ignore; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; + +import static org.junit.Assert.assertTrue; public class JsonReferableSerializerTest { - @Test - public void testSerializeAAS() throws IOException, SerializationException, JSONException { - compare(Examples.ASSET_ADMINISTRATION_SHELL); - } + private static final Logger logger = LoggerFactory.getLogger(JsonReferableSerializerTest.class); @Test - public void testSerializeWithAssetInformation() throws SerializationException, JSONException, IOException { - compare(Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION); + public void testSerializeAAS() throws IOException, SerializationException, JSONException { + Environment environment = AASFull.ENVIRONMENT; + AssetAdministrationShell assetAdministrationShell = environment.getAssetAdministrationShells().get(0); + compare("src/test/resources/assetAdministrationShell.json",assetAdministrationShell); } @Test public void testSerializeAASs() throws IOException, SerializationException, JSONException { - compare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); + Environment environment = AASFull.ENVIRONMENT; + compare("src/test/resources/assetAdministrationShellList.json", + environment.getAssetAdministrationShells().get(0), environment.getAssetAdministrationShells().get(1)); } @Test - @Ignore("Add test after DataSpecficationPhysicalUnit is supported again") - public void testSerializeConceptDescriptionWithPhysicalUnit() throws IOException, SerializationException, JSONException { - compare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); + public void testSerializeSubmodel() throws IOException, SerializationException, JSONException { + Environment environment = AASFull.ENVIRONMENT; + Submodel submodel = environment.getSubmodels().get(0); + compare("src/test/resources/submodel.json",submodel); } @Test - public void testSerializeSubmodel() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL); + public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { + Environment environment = AASFull.ENVIRONMENT; + compare("src/test/resources/submodelList.json", environment.getSubmodels().get(0), environment.getSubmodels().get(1)); } @Test - public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST_OF); + public void testSerializeSubmodelAsReferable() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + + List submodels = new ArrayList<>(); + submodels.add(AASFull.ENVIRONMENT.getSubmodels().get(0)); + submodels.add(AASFull.ENVIRONMENT.getSubmodels().get(1)); + submodels.add(AASFull.ENVIRONMENT.getSubmodels().get(2)); + + String serializedReferenceArray = serializer.writeReferables(submodels); + + assertTrue(serializedReferenceArray.contains("\"http://acplt.org/Submodels/Assets/TestAsset/Identification\"")); } @Test public void testSerializeSubmodelElement() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElement = environment.getSubmodels().get(0).getSubmodelElements().get(0); + compare("src/test/resources/submodelElement.json",submodelElement); } @Test public void testSerializeSubmodelElements() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST_OF); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElement0 = environment.getSubmodels().get(0).getSubmodelElements().get(0); + SubmodelElement submodelElement1 = environment.getSubmodels().get(0).getSubmodelElements().get(1); + compare("src/test/resources/listOfSubmodelElements.json",submodelElement0,submodelElement1); } @Test public void testSerializeSubmodelElementCollection() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_COLLECTION); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElementCollection submodelElementCollection = (SubmodelElementCollection) environment.getSubmodels().get(6).getSubmodelElements().get(6); + compare("src/test/resources/submodelElementCollection.json",submodelElementCollection); } @Test public void testSerializeSubmodelElementList() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElementList submodelElementList = (SubmodelElementList) environment.getSubmodels().get(6).getSubmodelElements().get(5); + compare("src/test/resources/submodelElementList.json",submodelElementList); } @Test public void testSerializeSubmodelElementListEmpty() throws SerializationException, JSONException, IOException { - compare(Examples.SUBMODEL_ELEMENT_LIST_EMPTY); + compare("src/test/resources/submodelElementListEmpty.json", + new DefaultSubmodelElementList.Builder() + .idShort("submodelElementList") + .orderRelevant(true) + .build()); } - @SuppressWarnings("unchecked") - private void compare(ExampleData exampleData) throws IOException, SerializationException, JSONException { - String expected = exampleData.fileContent(); - String actual = null; - if (Environment.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = new JsonSerializer().write((Environment) exampleData.getModel()); - } else if (Referable.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = new JsonSerializer().write((Referable) exampleData.getModel()); - } else if (Collection.class.isAssignableFrom(exampleData.getModel().getClass()) - && ((Collection) exampleData.getModel()).stream().allMatch(x -> x != null && Referable.class.isAssignableFrom(x.getClass()))) { - actual = new JsonSerializer().write((Collection) exampleData.getModel()); + private void compare(String filePathForExpected, Referable... referable) throws IOException, SerializationException, JSONException { + File fileExpected = new File(filePathForExpected); + String expected = Files.readString(fileExpected.toPath()); + String actual; + if(referable.length>1){ + actual = new JsonSerializer().writeReferables(List.of(referable)); + } else { + actual = new JsonSerializer().writeReferable(Arrays.stream(referable).findFirst().get()); } + logger.info(actual); + JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); + } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java new file mode 100644 index 000000000..9ab226d17 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class JsonReferenceDeserializerTest { + + private static final Logger logger = LoggerFactory.getLogger(JsonReferenceDeserializerTest.class); + + private String reference_string; + private String reference_list_string; + private String valueReferencePair_string; + + + @Before + public void prepare() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + reference_string = serializer.writeReference(AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId()); + reference_list_string = serializer.writeReferences(AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels()); +// valueReferencePair_string = serializer.write(((DataSpecificationIEC61360) AASFull.ENVIRONMENT.getConceptDescriptions().get(3).getEmbeddedDataSpecifications().get(0).getDataSpecificationContent()).getValueList().getValueReferencePairs().get(0)); + } + + + @Test + public void testDeserializeReference() throws DeserializationException { + JsonDeserializer deserializer = new JsonDeserializer(); + + Reference reference = deserializer.readReference(reference_string); + + assertTrue(!reference.getKeys().get(0).getValue().isEmpty()); + } + +// @Test +// public void testValueReferencePair() throws DeserializationException { +// JsonDeserializer deserializer = new JsonDeserializer(); +// +// ValueReferencePair valueReferencePair = deserializer.read(valueReferencePair_string, ValueReferencePair.class); +// +// assertTrue(!valueReferencePair.getValue().isEmpty()); +// } + +// @Test +// @Ignore("No comparison of input string object to expected class implememted yet.") +// public void testNonAasElement() { +// JsonDeserializer deserializer = new JsonDeserializer(); +// +// try { +// ValueReferencePair valueReferencePair = deserializer.read(reference_string, ValueReferencePair.class); +// } catch (DeserializationException e) { +// // fine +// } +// +// fail("DeserializationException expected"); +// } + + + @Test + public void testDeserializeReferenceList() throws DeserializationException { + JsonDeserializer deserializer = new JsonDeserializer(); + + List referenceList = deserializer.readReferences(reference_list_string); + + assertTrue(referenceList.get(0).getType().equals(ReferenceTypes.GLOBAL_REFERENCE)); + } + + +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java new file mode 100644 index 000000000..febc36eb5 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.junit.Ignore; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.*; + +public class JsonReferenceSerializerTest { + + private static final Logger logger = LoggerFactory.getLogger(JsonReferenceSerializerTest.class); + + + + @Test + public void testSerializeReference() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + + Reference reference = AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId(); + + String serializedReference = serializer.writeReference(reference); + + assertTrue(serializedReference.contains("\"http://acplt.org/SubmodelTemplates/AssetIdentification\"")); + } + + +// @Test +// @Ignore("If the input parameter is not an AAS-defined element, plain Jackson works nevertheless...") +// public void testNonAasElement() throws SerializationException { +// JsonSerializer serializer = new JsonSerializer(); +// +// Object object = new ArrayList() {{ add("something"); }}; +// +// try { +// String output = serializer.write(object); +// } catch (SerializationException e) { +// // fine +// } +// +// fail("SerializationException expected"); +// } + + + + @Test + public void testSerializeReferenceList() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + + List referenceList = AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels(); + + String serializedReferenceArray = serializer.writeReferences(referenceList); + + assertTrue(serializedReferenceArray.contains("\"https://acplt.org/Test_Submodel\"")); + } + +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 1ea73393e..40f49d167 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,16 +21,11 @@ import java.io.File; import java.io.IOException; -import java.util.Collections; -import java.util.List; +import java.nio.file.Files; import java.util.Set; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.json.JSONException; import org.junit.Rule; import org.junit.Test; @@ -41,7 +37,13 @@ import com.fasterxml.jackson.core.JsonProcessingException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; + public class JsonSerializerTest { + public static final java.io.File AASSIMPLE_FILE = new java.io.File("src/test/resources/jsonExample.json"); + public static final java.io.File AASFULL_FILE = new java.io.File("src/test/resources/test_demo_full_example.json"); private static final Logger logger = LoggerFactory.getLogger(JsonSerializerTest.class); @@ -56,35 +58,28 @@ public void testSerializeNull() throws JsonProcessingException, IOException, Ser @Test public void testWriteToFile() throws JsonProcessingException, IOException, SerializationException { File file = tempFolder.newFile("output.json"); - new JsonSerializer().write(file, AASSimple.createEnvironment()); + new JsonSerializer().write(file, AASSimple.ENVIRONMENT); assertTrue(file.exists()); } @Test public void testSerializeEmpty() throws JsonProcessingException, IOException, SerializationException, JSONException { - validateAndCompare(Examples.ENVIRONMENT_EMPTY); + validateAndCompare(new java.io.File("src/test/resources/empty_aas.json"), new DefaultEnvironment.Builder().build()); } @Test public void testSerializeSimpleExample() throws SerializationException, JSONException, IOException { - validateAndCompare(Examples.EXAMPLE_SIMPLE); + validateAndCompare(AASSIMPLE_FILE, AASSimple.ENVIRONMENT); } @Test public void testSerializeFullExample() throws SerializationException, JSONException, IOException { - validateAndCompare(Examples.EXAMPLE_FULL); + validateAndCompare(AASFULL_FILE, AASFull.ENVIRONMENT); } - @Test - public void testSerializeEmptyReferableList() throws SerializationException { - List emptyList = Collections.emptyList(); - String serialized = new JsonSerializer().write(emptyList); - assertEquals("[]", serialized); - } - - private void validateAndCompare(ExampleData exampleData) throws IOException, SerializationException, JSONException { - String expected = exampleData.fileContent(); - String actual = new JsonSerializer().write(exampleData.getModel()); + private void validateAndCompare(File expectedFile, Environment environment) throws IOException, SerializationException, JSONException { + String expected = Files.readString(expectedFile.toPath()); + String actual = new JsonSerializer().write(environment); logger.info(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); assertTrue(errors.isEmpty()); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java new file mode 100644 index 000000000..fd3587994 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.checkerframework.checker.units.qual.A; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class JsonSpecificAssetIdDeserializerTest { + + private static final Logger logger = LoggerFactory.getLogger(JsonSpecificAssetIdDeserializerTest.class); + + private String specificAssetId_string; + private String specificAssetId_list_string; + + + @Before + public void prepare() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + + SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() + .name("testSpecificAssetId") + .value("testValue") + .build(); + List specificAssetIds = new ArrayList() {{ + add(specificAssetId); + add(specificAssetId); + }}; + + specificAssetId_string = serializer.writeSpecificAssetId(specificAssetId); + specificAssetId_list_string = serializer.writeSpecificAssetIds(specificAssetIds); + } + + + @Test + public void testDeserializeReference() throws DeserializationException { + JsonDeserializer deserializer = new JsonDeserializer(); + + SpecificAssetId specificAssetId = deserializer.readSpecificAssetId(specificAssetId_string); + + assertTrue(!specificAssetId.getValue().isEmpty()); + } + + + @Test + public void testDeserializeReferenceList() throws DeserializationException { + JsonDeserializer deserializer = new JsonDeserializer(); + + List specificAssetIdList = deserializer.readSpecificAssetIds(specificAssetId_list_string); + + assertTrue(specificAssetIdList.get(0).getValue().equalsIgnoreCase("testvalue")); + } + + +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java new file mode 100644 index 000000000..37980a5b1 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class JsonSpecificAssetIdSerializerTest { + + private static final Logger logger = LoggerFactory.getLogger(JsonSpecificAssetIdSerializerTest.class); + + SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() + .name("testSpecificAssetId") + .value("testValue") + .build(); + + + @Test + public void testSerializeSpecificAssetId() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + + String specificAssetId_string = serializer.writeSpecificAssetId(specificAssetId); + + assertTrue(specificAssetId_string.contains("\"value\" : \"testValue\"")); + } + + + @Test + public void testSerializeSpecificAssetIdList() throws SerializationException { + + List specificAssetIds = new ArrayList() {{ + add(specificAssetId); + add(specificAssetId); + }}; + + JsonSerializer serializer = new JsonSerializer(); + + String specificAssetId_list_string = serializer.writeSpecificAssetIds(specificAssetIds); + + assertTrue(specificAssetId_list_string.startsWith("[")); + assertTrue(specificAssetId_list_string.contains("\"name\" : \"testSpecificAssetId\"")); + } + + +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java new file mode 100644 index 000000000..7bc2b30ff --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; +import org.junit.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +public class JsonSubmodelDescriptorDeserializerTest { + + public static SubmodelDescriptor getDefaultSubmodelDescriptor () { + return new DefaultSubmodelDescriptor.Builder() + .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) + .description(TestDataHelper.DEFAULT_DESCRIPTION) + .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) + .identification(TestDataHelper.DEFAULT_IDENTIFICATION) + .idShort(TestDataHelper.DEFAULT_ID_SHORT) + .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) + .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) + .build(); + } + + + @Test + public void testReadSubmodelDescriptor() throws IOException, DeserializationException { + File fileExpected = new File("src/test/resources/submodelDescriptor.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelDescriptor submodelDescriptor = new JsonDeserializer().readSubmodelDescriptor(expected); + SubmodelDescriptor submodelDescriptorExpected = getDefaultSubmodelDescriptor(); + + assertEquals(submodelDescriptorExpected, submodelDescriptor); + } +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java new file mode 100644 index 000000000..d8a61dfb2 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Descriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; +import org.json.JSONException; +import org.junit.Test; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.List; +import java.util.Set; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class JsonSubmodelDescriptorSerializerTest { + + + private static final Logger logger = LoggerFactory.getLogger(JsonSubmodelDescriptorSerializerTest.class); + + + @Test + public void testReadSubmodelDescriptor() throws IOException, SerializationException, JSONException { + File fileExpected = new File("src/test/resources/submodelDescriptor.json"); + + validateAndCompare(fileExpected, JsonSubmodelDescriptorDeserializerTest.getDefaultSubmodelDescriptor()); + } + + private void validateAndCompare(File expectedFile, SubmodelDescriptor descriptor) throws IOException, SerializationException, JSONException { + String expected = Files.readString(expectedFile.toPath()); + String actual = new JsonSerializer().writeSubmodelDescriptor(descriptor); + logger.info(actual); + Set errors = new JsonSchemaValidator().validateSchema(actual); + assertTrue(errors.isEmpty()); + JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); + JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); + } +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java index ed0e9b08e..f9878057f 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +16,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.IOException; @@ -28,7 +30,6 @@ import junitparams.JUnitParamsRunner; import junitparams.Parameters; -import static org.junit.Assert.assertFalse; @RunWith(JUnitParamsRunner.class) public class JsonValidationTest { @@ -42,27 +43,28 @@ public static void prepareValidator() throws IOException { @Test @Parameters({ - "src/test/resources/Environment-Empty.json", - "src/test/resources/Example-Simple.json", + "src/test/resources/empty_aas.json", + "src/test/resources/jsonExample.json", "src/test/resources/MotorAAS.json", - "src/test/resources/MotorAAS-Reduced.json", - "src/test/resources/Example-Full.json" + "src/test/resources/MotorAAS_reduced.json", + "src/test/resources/test_demo_full_example.json" }) public void validateValidJson(String file) throws IOException { - assertTrue(validate(file).isEmpty()); + String serializedEnvironment = new String(Files.readAllBytes(Paths.get(file))); + Set errors = validator.validateSchema(serializedEnvironment); + System.out.println("Validating: " + file); + assertTrue(errors.isEmpty()); } @Test - @Parameters({"src/test/resources/Environment-Invalid.json"}) + @Parameters({"src/test/resources/invalidJsonExample.json"}) public void validateInvalidJson(String file) throws IOException { - assertFalse(validate(file).isEmpty()); - } - - private Set validate(String file) throws IOException { - String json = new String(Files.readAllBytes(Paths.get(file))); - Set result = validator.validateSchema(json); + String serializedEnvironment = new String(Files.readAllBytes(Paths.get(file))); + Set errors = validator.validateSchema(serializedEnvironment); System.out.println("Validating: " + file); - result.forEach(System.out::println); - return result; + for (String s : errors) { + System.out.println(s); + } + assertEquals(2, errors.size()); } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java index a020dd4a9..4b677e6ca 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +28,6 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins.ReferenceMixin; import org.junit.Before; import org.junit.Test; diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java new file mode 100644 index 000000000..575dfb2da --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 SAP SE + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + +import java.util.List; + +public class TestDataHelper { + + public static final String DEFAULT_IDENTIFICATION = "identification"; + + public static final Reference DEFAULT_SEMANTIC_ID = + new DefaultReference.Builder().type(ReferenceTypes.GLOBAL_REFERENCE) + .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value("eClassDefaultSemanticId").build()) + .build(); + + public static final EmbeddedDataSpecification DEFAULT_EMBEDDED_DATA_SPECIFICATION = new DefaultEmbeddedDataSpecification.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder().build()) + .dataSpecification(createGlobalReference("defaultEmbeddedDataSpecificationDataSpecificationValue")).build(); + + public static final AdministrativeInformation DEFAULT_ADMINISTRATIVE_INFORMATION = + new DefaultAdministrativeInformation.Builder() + .embeddedDataSpecifications(DEFAULT_EMBEDDED_DATA_SPECIFICATION) + .revision("defaultAdministrativeInformationRevisionValue") + .version("defaultAdministrativeInformationVersionValue").build(); + + public static final List DEFAULT_DESCRIPTION = List.of(createLangString("en", "defaultDescription")); + + public static final List DEFAULT_DISPLAY_NAME = List.of(createLangString("en", "defaultDisplayName")); + + public static final String DEFAULT_ID_SHORT = "defaultIdShort"; + + + + + public static LangString createLangString(String langCode, String text) { + return new DefaultLangString.Builder().language(langCode).text(text).build(); + } + + public static Reference createReference(ReferenceTypes type, KeyTypes keyType, String value) { + return new DefaultReference.Builder().type(type).keys(createKey(keyType, value)).build(); + } + + public static Reference createGlobalReference(String value) { + return createReference(ReferenceTypes.GLOBAL_REFERENCE, KeyTypes.GLOBAL_REFERENCE, value); + } + + public static DefaultEndpoint.Builder createEndpointBuilder() { + + String DEFAULT_INTERFACE_VALUE = "defaultInterface"; + + return new DefaultEndpoint.Builder() + .protocolInformation(createProtocolInformationBuilder().build()) + .withInterface(DEFAULT_INTERFACE_VALUE); + } + + public static Key createKey(KeyTypes type, String value) { + return new DefaultKey.Builder().type(type).value(value).build(); + } + + public static DefaultProtocolInformation.Builder createProtocolInformationBuilder() { + return new DefaultProtocolInformation.Builder() + .endpointAddress("defaultEndpointAddress") + .endpointProtocol("defaultEndpointProtocol") + .endpointProtocolVersion("defaultEndpointProtocolVersion") + .subprotocol("defaultSubprotocol") + .subprotocolBody("defaultSubprotocolBody") + .subprotocolBodyEncoding("defaultSubprotocolBodyEncoding"); + } +} diff --git a/dataformat-json/src/test/resources/AssetAdministrationShell.json b/dataformat-json/src/test/resources/AssetAdministrationShell.json index aa9b84207..dca5615c6 100644 --- a/dataformat-json/src/test/resources/AssetAdministrationShell.json +++ b/dataformat-json/src/test/resources/AssetAdministrationShell.json @@ -1,64 +1,73 @@ -{ - "idShort": "TestAssetAdministrationShell", - "description": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ], - "modelType": "AssetAdministrationShell", - "id": "https://acplt.org/Test_AssetAdministrationShell", - "administration": - { - "version": "0", - "revision": "9" - }, - "derivedFrom": - { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/TestAssetAdministrationShell2" - } - ], - "type": "ExternalReference" - }, - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId":"https://acplt.org/Test_Asset" - }, - "submodels": [ - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - } - ], - "type": "ExternalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" - } - ], - "type": "ExternalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" - } - ], - "type": "ExternalReference" - } - ] -} +{ + "idShort": "TestAssetAdministrationShell", + "description": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ], + "modelType": "AssetAdministrationShell", + "id": "https://acplt.org/Test_AssetAdministrationShell", + "administration": + { + "version": "0.9", + "revision": "0" + }, + "derivedFrom": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/TestAssetAdministrationShell2" + } + ], + "type": "GlobalReference" + }, + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" + } + ], + "type": "GlobalReference" + } + ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/MotorAAS.json b/dataformat-json/src/test/resources/MotorAAS.json index b0b828a79..f1207e299 100644 --- a/dataformat-json/src/test/resources/MotorAAS.json +++ b/dataformat-json/src/test/resources/MotorAAS.json @@ -6,7 +6,15 @@ "id": "http://customer.com/aas/9175_7013_7091_9168", "assetInformation": { "assetKind": "Instance", - "globalAssetId": "http://customer.com/assets/KHBVZJSQKIY", + "globalAssetId": { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "http://customer.com/assets/KHBVZJSQKIY" + } + ], + "type": "GlobalReference" + }, "specificAssetIds": [ { "name": "EquipmentID", @@ -18,7 +26,7 @@ "value": "http://customer.com/Systems/ERP/012" } ], - "type": "ExternalReference" + "type": "GlobalReference" } }, { @@ -31,12 +39,13 @@ "value": "http://customer.com/Systems/IoT/1" } ], - "type": "ExternalReference" + "type": "GlobalReference" } } ], "thumbnail": { "modelType": "File", + "kind": "Instance", "idShort": "thumbnail", "mimeType": "image/png", "path": "https://github.com/admin-shell/io/blob/master/verwaltungsschale-detail-part1.png" @@ -50,7 +59,7 @@ "value": "http.//i40.customer.com/type/1/1/7A7104BDAB57E184" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, { "keys": [ @@ -59,7 +68,7 @@ "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, { "keys": [ @@ -68,7 +77,7 @@ "value": "http://i40.customer.com/type/1/1/1A7B62B529F19152" } ], - "type": "ExternalReference" + "type": "GlobalReference" } ] } @@ -83,7 +92,7 @@ "value": "0173-1#01-AFZ615#016" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "kind": "Instance", "idShort": "TechnicalData", @@ -91,6 +100,7 @@ "submodelElements": [ { "modelType": "Property", + "kind": "Instance", "semanticId": { "keys": [ { @@ -98,7 +108,7 @@ "value": "0173-1#02-BAA120#008" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "idShort": "MaxRotationSpeed", "category": "PARAMETER", @@ -115,6 +125,7 @@ "submodelElements": [ { "modelType": "SubmodelElementCollection", + "kind": "Instance", "semanticId": { "keys": [ { @@ -122,12 +133,13 @@ "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "idShort": "OperatingManual", "value": [ { "modelType": "Property", + "kind": "Instance", "semanticId": { "keys": [ { @@ -135,14 +147,15 @@ "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "idShort": "Title", "value": "OperatingManual", - "valueType": "xs:string" + "valueType": "langString" }, { "modelType": "File", + "kind": "Instance", "semanticId": { "keys": [ { @@ -150,11 +163,11 @@ "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "idShort": "DigitalFile_PDF", "contentType": "application/pdf", - "value": "file:///aasx/OperatingManual.pdf" + "value": "/aasx/OperatingManual.pdf" } ], "ordered": false, @@ -170,6 +183,7 @@ "submodelElements": [ { "modelType": "Property", + "kind": "Instance", "semanticId": { "keys": [ { @@ -177,7 +191,7 @@ "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "idShort": "RotationSpeed", "category": "Variable", @@ -201,10 +215,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIec61360", + "modelType": "DataSpecificationIEC61360", "preferredName": [ { "language": "EN", @@ -215,7 +229,7 @@ "text": "Titel" } ], - "shortName": [ + "shortNames": [ { "language": "EN", "text": "Title" @@ -225,7 +239,9 @@ "text": "Titel" } ], - "dataType": "STRING_TRANSLATABLE", + "unit": "", + "sourceOfDefinition": "", + "dataType": "StringTranslatable", "definition": [ { "language": "DE", @@ -249,10 +265,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIec61360", + "modelType": "DataSpecificationIEC61360", "preferredName": [ { "language": "EN", @@ -263,7 +279,7 @@ "text": "DigitaleDatei" } ], - "shortName": [ + "shortNames": [ { "language": "EN", "text": "DigitalFile" @@ -273,7 +289,9 @@ "text": "DigitaleDatei" } ], - "dataType": "STRING", + "unit": "", + "sourceOfDefinition": "", + "dataType": "String", "definition": [ { "language": "DE", @@ -302,10 +320,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIec61360", + "modelType": "DataSpecificationIEC61360", "preferredName": [ { "language": "de", @@ -316,6 +334,7 @@ "text": "Max.rotationspeed" } ], + "shortNames": [], "unit": "1/min", "unitId": { "keys": [ @@ -324,9 +343,10 @@ "value": "0173-1#05-AAA650#002" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, - "dataType": "REAL_MEASURE", + "sourceOfDefinition": "", + "dataType": "RealMeasure", "definition": [ { "language": "de", @@ -355,10 +375,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIec61360", + "modelType": "DataSpecificationIEC61360", "preferredName": [ { "language": "DE", @@ -369,14 +389,14 @@ "text": "Actualrotationspeed" } ], - "shortName": [ + "shortNames": [ { "language": "DE", "text": "AktuelleDrehzahl" }, { "language": "EN", - "text": "ActRotationSpeed" + "text": "ActualRotationSpeed" } ], "unit": "1/min", @@ -387,9 +407,10 @@ "value": "0173-1#05-AAA650#002" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, - "dataType": "REAL_MEASURE", + "sourceOfDefinition": "", + "dataType": "RealMeasure", "definition": [ { "language": "DE", @@ -417,17 +438,12 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIec61360", - "preferredName": [ - { - "language": "DE", - "text": "Dokument" - } - ], - "shortName": [ + "modelType": "DataSpecificationIEC61360", + "preferredName": [], + "shortNames": [ { "language": "EN", "text": "Document" @@ -437,8 +453,9 @@ "text": "Dokument" } ], + "unit": "", "sourceOfDefinition": "[ISO15519-1:2010]", - "dataType": "STRING", + "dataType": "String", "definition": [ { "language": "DE", diff --git a/dataformat-json/src/test/resources/MotorAAS_reduced.json b/dataformat-json/src/test/resources/MotorAAS_reduced.json new file mode 100644 index 000000000..895605423 --- /dev/null +++ b/dataformat-json/src/test/resources/MotorAAS_reduced.json @@ -0,0 +1,262 @@ +{ + "assetAdministrationShells": [ + { + "modelType": "AssetAdministrationShell", + "idShort": "ExampleMotor", + "id": "http://customer.com/aas/9175_7013_7091_9168", + "assetInformation": { + "assetKind": "Instance", + "globalAssetId": { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "http://customer.com/assets/KHBVZJSQKIY" + } + ], + "type": "GlobalReference" + }, + "specificAssetIds": [ + { + "name": "EquipmentID", + "value": "538fd1b3-f99f-4a52-9c75-72e9fa921270", + "externalSubjectId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://customer.com/Systems/ERP/012" + } + ], + "type": "GlobalReference" + } + }, + { + "name": "DeviceID", + "value": "QjYgPggjwkiHk4RrQiYSLg==", + "externalSubjectId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://customer.com/Systems/IoT/1" + } + ], + "type": "GlobalReference" + } + } + ], + "thumbnail": { + "modelType": "File", + "kind": "Instance", + "idShort": "thumbnail", + "mimeType": "image/png", + "path": "https://github.com/admin-shell/io/blob/master/verwaltungsschale-detail-part1.png" + } + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "http.//i40.customer.com/type/1/1/7A7104BDAB57E184" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" + } + ], + "type": "GlobalReference" + } + ] + } + ], + "submodels": [ + { + "modelType": "Submodel", + "semanticId": { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#01-AFZ615#016" + } + ], + "type": "GlobalReference" + }, + "kind": "Instance", + "idShort": "TechnicalData", + "id": "http://i40.customer.com/type/1/1/7A7104BDAB57E184", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "0173-1#02-BAA120#008" + } + ], + "type": "GlobalReference" + }, + "idShort": "MaxRotationSpeed", + "category": "PARAMETER", + "value": "5000", + "valueType": "xs:integer" + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "idShort": "OperationalData", + "id": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" + } + ], + "type": "GlobalReference" + }, + "idShort": "RotationSpeed", + "category": "Variable", + "value": "4370", + "valueType": "xs:integer" + } + ] + } + ], + "conceptDescriptions": [ + { + "modelType": "ConceptDescription", + "idShort": "MaxRotationSpeed", + "category": "PROPERTY", + "administration": { + "version": "0", + "revision": "2" + }, + "id": "0173-1#02-BAA120#008", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + { + "language": "de", + "text": "max.Drehzahl" + }, + { + "language": "en", + "text": "Max.rotationspeed" + } + ], + "shortNames": [], + "unit": "1/min", + "unitId": { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#05-AAA650#002" + } + ], + "type": "GlobalReference" + }, + "sourceOfDefinition": "", + "dataType": "RealMeasure", + "definition": [ + { + "language": "de", + "text": "HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf" + }, + { + "language": "en", + "text": "Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated" + } + ] + } + } + ] + }, + { + "modelType": "ConceptDescription", + "idShort": "RotationSpeed", + "category": "PROPERTY", + "id": "http://customer.com/cd/1/1/18EBD56F6B43D895", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + { + "language": "DE", + "text": "AktuelleDrehzahl" + }, + { + "language": "EN", + "text": "Actualrotationspeed" + } + ], + "shortNames": [ + { + "language": "DE", + "text": "AktuelleDrehzahl" + }, + { + "language": "EN", + "text": "ActualRotationSpeed" + } + ], + "unit": "1/min", + "unitId": { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#05-AAA650#002" + } + ], + "type": "GlobalReference" + }, + "sourceOfDefinition": "", + "dataType": "RealMeasure", + "definition": [ + { + "language": "DE", + "text": "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird" + }, + { + "language": "EN", + "text": "Actual rotationspeed with which the motor or feedingunit is operated" + } + ] + } + } + ] + } + ] +} diff --git a/dataformat-json/src/test/resources/Submodel.json b/dataformat-json/src/test/resources/Submodel.json index c3751c085..79a85f8cc 100644 --- a/dataformat-json/src/test/resources/Submodel.json +++ b/dataformat-json/src/test/resources/Submodel.json @@ -1,144 +1,124 @@ - -{ - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" - } - ], - "type": "ExternalReference" - }, - "administration": - { - "revision": "9", - "version": "0" - }, - "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", - "idShort": "Identification", - "submodelElements": [ - { - "modelType": "Property", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ], - "type": "ExternalReference" - }, - "value": "http://acplt.org/ValueId/ACPLT", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ACPLT" - } - ], - "type": "ExternalReference" - }, - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "value": "100", - "valueType": "xs:int" - }, - { - "type": "http://acplt.org/Qualifier/ExampleQualifier2", - "value": "50", - "valueType": "xs:int" - } - ], - "idShort": "ManufacturerName", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ], - "displayName": [ - { - "language": "en-us", - "text": "Manufacturer Name" - } - ] - }, - { - "modelType": "Property", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "ExternalReference" - }, - "value": "978-8234-234-342", - "supplementalSemanticIds": [ - { - "keys": [ - { - "type": "GlobalReference", - "value": "something_random_e14ad770" - } - ], - "type": "ExternalReference" - }, - { - "keys": [{ - "type": "GlobalReference", - "value": "something_random_bd061acd" - }], - "type": "ExternalReference" - } - - ], - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "978-8234-234-342" - } - ], - "type": "ExternalReference" - }, - "valueType": "xs:string", - "category": "VARIABLE", - "idShort": "InstanceId", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - } - ], - "description": [ - { - "language": "en-us", - "text": "An example asset identification submodel for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" - } - ] -} + +{ + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", + "idShort": "Identification", + "submodelElements": [ + { + "modelType": "Property", + "category": "VARIABLE", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int", + "kind": "ConceptQualifier" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int", + "kind": "ConceptQualifier" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + }, + { + "modelType": "Property", + "category": "VARIABLE", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "value": "978-8234-234-342", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "978-8234-234-342" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "idShort": "InstanceId", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example asset identification submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" + } + ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/SubmodelElement.json b/dataformat-json/src/test/resources/SubmodelElement.json index fb11778ca..aa25cb3d2 100644 --- a/dataformat-json/src/test/resources/SubmodelElement.json +++ b/dataformat-json/src/test/resources/SubmodelElement.json @@ -1,55 +1,53 @@ - -{ - "modelType": "Property", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ], - "type": "ExternalReference" - }, - "value": "http://acplt.org/ValueId/ACPLT", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ACPLT" - } - ], - "type": "ExternalReference" - }, - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "value": "100", - "valueType": "xs:int" - }, - { - "type": "http://acplt.org/Qualifier/ExampleQualifier2", - "value": "50", - "valueType": "xs:int" - } - ], - "idShort": "ManufacturerName", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ], - "displayName": [ - { - "language": "en-us", - "text": "Manufacturer Name" - } - ] -} + +{ + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int", + "kind": "ConceptQualifier" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int", + "kind": "ConceptQualifier" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/SubmodelElementCollection.json b/dataformat-json/src/test/resources/SubmodelElementCollection.json index f0366f0f9..981979de9 100644 --- a/dataformat-json/src/test/resources/SubmodelElementCollection.json +++ b/dataformat-json/src/test/resources/SubmodelElementCollection.json @@ -1,82 +1,86 @@ -{ - "idShort": "ExampleSubmodelElementCollection", - "category": "PARAMETER", - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollection object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollection Element" - } - ], - "modelType": "SubmodelElementCollection", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" - } - ], - "type": "ExternalReference" - }, - "value": [ { - "modelType" : "Blob", - "contentType" : "application/pdf", - "semanticId" : { - "keys" : [ { - "type" : "GlobalReference", - "value" : "http://acplt.org/Blobs/ExampleBlob" - } ], - "type": "ExternalReference" - }, - "category" : "PARAMETER", - "description" : [ { - "language" : "en-us", - "text" : "Example Blob object" - }, { - "language" : "de", - "text" : "Beispiel Blob Element" - } ], - "idShort" : "ExampleBlob" - }, { - "modelType" : "File", - "contentType" : "application/pdf", - "semanticId" : { - "keys" : [ { - "type" : "GlobalReference", - "value" : "http://acplt.org/Files/ExampleFile" - } ], - "type": "ExternalReference" - }, - "category" : "PARAMETER", - "description" : [ { - "language" : "en-us", - "text" : "Example File object" - }, { - "language" : "de", - "text" : "Beispiel File Element" - } ], - "idShort" : "ExampleFile" - }, { - "modelType" : "ReferenceElement", - "semanticId" : { - "keys" : [ { - "type" : "GlobalReference", - "value" : "http://acplt.org/ReferenceElements/ExampleReferenceElement" - } ], - "type": "ExternalReference" - }, - "category" : "PARAMETER", - "description" : [ { - "language" : "en-us", - "text" : "Example Reference Element object" - }, { - "language" : "de", - "text" : "Beispiel Reference Element Element" - } ], - "idShort" : "ExampleReferenceElement" - } ] -} +{ + "idShort": "ExampleSubmodelElementCollection", + "category": "PARAMETER", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollection object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollection Element" + } + ], + "modelType": "SubmodelElementCollection", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" + } + ], + "type": "GlobalReference" + }, + "kind": "Template", + "value": [ { + "modelType" : "Blob", + "contentType" : "application/pdf", + "kind" : "Template", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "http://acplt.org/Blobs/ExampleBlob" + } ], + "type" : "GlobalReference" + }, + "category" : "PARAMETER", + "description" : [ { + "language" : "en-us", + "text" : "Example Blob object" + }, { + "language" : "de", + "text" : "Beispiel Blob Element" + } ], + "idShort" : "ExampleBlob" + }, { + "modelType" : "File", + "contentType" : "application/pdf", + "kind" : "Template", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "http://acplt.org/Files/ExampleFile" + } ], + "type" : "GlobalReference" + }, + "category" : "PARAMETER", + "description" : [ { + "language" : "en-us", + "text" : "Example File object" + }, { + "language" : "de", + "text" : "Beispiel File Element" + } ], + "idShort" : "ExampleFile" + }, { + "modelType" : "ReferenceElement", + "kind" : "Template", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } ], + "type" : "GlobalReference" + }, + "category" : "PARAMETER", + "description" : [ { + "language" : "en-us", + "text" : "Example Reference Element object" + }, { + "language" : "de", + "text" : "Beispiel Reference Element Element" + } ], + "idShort" : "ExampleReferenceElement" + } ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/SubmodelElementList.json b/dataformat-json/src/test/resources/SubmodelElementList.json index fc5dd9c06..7456c61c1 100644 --- a/dataformat-json/src/test/resources/SubmodelElementList.json +++ b/dataformat-json/src/test/resources/SubmodelElementList.json @@ -1,136 +1,141 @@ -{ - "idShort": "ExampleSubmodelElementListOrdered", - "category": "PARAMETER", - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementListOrdered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementListOrdered Element" - } - ], - "modelType": "SubmodelElementList", - "orderRelevant": true, - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" - } - ], - "type": "ExternalReference" - }, - "typeValueListElement": "SubmodelElement", - "value": [ - { - "idShort": "ExampleProperty", - "category": "CONSTANT", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ], - "modelType": "Property", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "ExternalReference" - }, - "valueType": "xs:string" - }, - { - "idShort": "ExampleMultiLanguageProperty", - "category": "CONSTANT", - "description": [ - { - "language": "en-us", - "text": "Example MultiLanguageProperty object" - }, - { - "language": "de", - "text": "Beispiel MultiLanguageProperty Element" - } - ], - "modelType": "MultiLanguageProperty", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" - } - ], - "type": "ExternalReference" - } - }, - { - "idShort": "ExampleRange", - "category": "PARAMETER", - "description": - [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ], - "modelType": "Range", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "ExternalReference" - }, - "valueType": "xs:int", - "max": "100" - }, - { - "idShort": "ExampleRange2", - "category": "PARAMETER", - "description": - [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ], - "modelType": "Range", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "ExternalReference" - }, - "valueType": "xs:int", - "min": "0" - } - ] -} +{ + "idShort": "ExampleSubmodelElementListOrdered", + "category": "PARAMETER", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementListOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementListOrdered Element" + } + ], + "modelType": "SubmodelElementList", + "orderRelevant": true, + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" + } + ], + "type": "GlobalReference" + }, + "kind": "Template", + "typeValueListElement": "SubmodelElement", + "value": [ + { + "idShort": "ExampleProperty", + "category": "CONSTANT", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ], + "modelType": "Property", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "kind": "Template", + "valueType": "xs:string" + }, + { + "idShort": "ExampleMultiLanguageProperty", + "category": "CONSTANT", + "description": [ + { + "language": "en-us", + "text": "Example MultiLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MultiLanguageProperty Element" + } + ], + "modelType": "MultiLanguageProperty", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "kind": "Template" + }, + { + "idShort": "ExampleRange", + "category": "PARAMETER", + "description": + [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ], + "modelType": "Range", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "kind": "Template", + "valueType": "xs:int", + "max": "100" + }, + { + "idShort": "ExampleRange2", + "category": "PARAMETER", + "description": + [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ], + "modelType": "Range", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "kind": "Template", + "valueType": "xs:int", + "min": "0" + } + ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json new file mode 100644 index 000000000..17183b3dc --- /dev/null +++ b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json @@ -0,0 +1,112 @@ +{ + "endpoints" : [ { + "protocolInformation" : { + "endpointAddress" : "defaultEndpointAddress", + "endpointProtocol" : "defaultEndpointProtocol", + "endpointProtocolVersion" : "defaultEndpointProtocolVersion", + "subprotocol" : "defaultSubprotocol", + "subprotocolBody" : "defaultSubprotocolBody", + "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding" + }, + "interface" : "defaultInterface" + } ], + "administration" : { + "revision" : "defaultAdministrativeInformationRevisionValue", + "version" : "defaultAdministrativeInformationVersionValue", + "embeddedDataSpecifications" : [ { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" + } ], + "type" : "GlobalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DataSpecificationIEC61360", + "preferredName" : [ ] + } + } ] + }, + "descriptions" : [ { + "language" : "en", + "text" : "defaultDescription" + } ], + "displayNames" : [ { + "language" : "en", + "text" : "defaultDisplayName" + } ], + "idShort" : "defaultIdShort", + "identification" : "identification", + "globalAssetId" : { + "keys" : [ { + "type" : "AssetAdministrationShell", + "value" : "defaultGlobalAssetId" + } ], + "type" : "ModelReference" + }, + "specificAssetIds" : { + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "eClassDefaultSemanticId" + } ], + "type" : "GlobalReference" + }, + "externalSubjectId" : { + "keys" : [ { + "type" : "AssetAdministrationShell", + "value" : "defaultSpecificAssetId" + } ], + "type" : "ModelReference" + }, + "name" : "defaultSpecificAssetIdName", + "value" : "http://example.company/myAsset" + }, + "submodelDescriptors" : [ { + "endpoints" : [ { + "protocolInformation" : { + "endpointAddress" : "defaultEndpointAddress", + "endpointProtocol" : "defaultEndpointProtocol", + "endpointProtocolVersion" : "defaultEndpointProtocolVersion", + "subprotocol" : "defaultSubprotocol", + "subprotocolBody" : "defaultSubprotocolBody", + "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding" + }, + "interface" : "defaultInterface" + } ], + "administration" : { + "revision" : "defaultAdministrativeInformationRevisionValue", + "version" : "defaultAdministrativeInformationVersionValue", + "embeddedDataSpecifications" : [ { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" + } ], + "type" : "GlobalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DataSpecificationIEC61360", + "preferredName" : [ ] + } + } ] + }, + "descriptions" : [ { + "language" : "en", + "text" : "defaultDescription" + } ], + "displayNames" : [ { + "language" : "en", + "text" : "defaultDisplayName" + } ], + "idShort" : "defaultIdShort", + "identification" : "identification", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "eClassDefaultSemanticId" + } ], + "type" : "GlobalReference" + } + } ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/assetAdministrationShellList.json b/dataformat-json/src/test/resources/assetAdministrationShellList.json new file mode 100644 index 000000000..bca2ea576 --- /dev/null +++ b/dataformat-json/src/test/resources/assetAdministrationShellList.json @@ -0,0 +1,108 @@ +[ + { + "idShort": "TestAssetAdministrationShell", + "description": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ], + "modelType": "AssetAdministrationShell", + "id": "https://acplt.org/Test_AssetAdministrationShell", + "administration": { + "version": "0.9", + "revision": "0" + }, + "derivedFrom": { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/TestAssetAdministrationShell2" + } + ], + "type": "GlobalReference" + }, + "assetInformation": { + "assetKind": "Instance", + "globalAssetId": { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" + } + ], + "type": "GlobalReference" + } + ] + }, + { + "idShort": "Test_AssetAdministrationShell_Mandatory", + "modelType": "AssetAdministrationShell", + "id": "https://acplt.org/Test_AssetAdministrationShell_Mandatory", + "assetInformation": { + "assetKind": "Instance", + "globalAssetId": { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Mandatory" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel2_Mandatory" + } + ], + "type": "GlobalReference" + } + ] + } +] diff --git a/dataformat-json/src/test/resources/empty_aas.json b/dataformat-json/src/test/resources/empty_aas.json new file mode 100644 index 000000000..7a73a41bf --- /dev/null +++ b/dataformat-json/src/test/resources/empty_aas.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/invalidJsonExample.json b/dataformat-json/src/test/resources/invalidJsonExample.json new file mode 100644 index 000000000..e9474c928 --- /dev/null +++ b/dataformat-json/src/test/resources/invalidJsonExample.json @@ -0,0 +1,468 @@ +{ + "assetAdministrationShells": [ + { + "modelType": "AssetAdministrationShell", + "idShort": "ExampleMotor", + "id": "http://customer.com/aas/9175_7013_7091_9168", + "assetInformation": { + "assetKind": "Instance", + "globalAssetId": { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "http://customer.com/assets/KHBVZJSQKIY" + } + ], + "type": "GlobalReference" + }, + "specificAssetIds": [ + { + "name": "EquipmentID", + "value": "538fd1b3-f99f-4a52-9c75-72e9fa921270", + "externalSubjectId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://customer.com/Systems/ERP/012" + } + ], + "type": "GlobalReference" + } + }, + { + "name": "DeviceID", + "value": "QjYgPggjwkiHk4RrQiYSLg==", + "externalSubjectId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://customer.com/Systems/IoT/1" + } + ], + "type": "GlobalReference" + } + } + ], + "thumbnail": { + "modelType": "File", + "kind": "Instance", + "idShort": "thumbnail", + "contentType": "image/png", + "path": "https://github.com/admin-shell/io/blob/master/verwaltungsschale-detail-part1.png" + } + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "http.//i40.customer.com/type/1/1/7A7104BDAB57E184" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://i40.customer.com/type/1/1/1A7B62B529F19152" + } + ], + "type": "GlobalReference" + } + ] + } + ], + "submodels": [ + { + "modelType": "Submodel", + "semanticId": { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#01-AFZ615#016" + } + ], + "type": "GlobalReference" + }, + "kind": "Instance", + "idShort": "TechnicalData", + "id": "http://i40.customer.com/type/1/1/7A7104BDAB57E184", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "0173-1#02-BAA120#008" + } + ], + "type": "GlobalReference" + }, + "idShort": "MaxRotationSpeed", + "category": "PARAMETER", + "value": "5000", + "valueType": "xs:integer" + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "idShort": "Documentation", + "id": "http://i40.customer.com/type/1/1/1A7B62B529F19152", + "submodelElements": [ + { + "modelType": "SubmodelElementCollection", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document" + } + ], + "type": "GlobalReference" + }, + "idShort": "OperatingManual", + "value": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title" + } + ] + }, + "idShort": "Title", + "value": "OperatingManual", + "valueType": "langString" + }, + { + "modelType": "File", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile" + } + ], + "type": "GlobalReference" + }, + "idShort": "DigitalFile_PDF", + "contentType": "application/pdf", + "value": "/aasx/OperatingManual.pdf" + } + ], + "ordered": false, + "allowDuplicates": false + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "idShort": "OperationalData", + "id": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" + } + ], + "type": "GlobalReference" + }, + "idShort": "RotationSpeed", + "category": "Variable", + "value": "4370", + "valueType": "xs:integer" + } + ] + } + ], + "conceptDescriptions": [ + { + "modelType": "ConceptDescription", + "idShort": "Title", + "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + { + "language": "EN", + "text": "Title" + }, + { + "language": "DE", + "text": "Titel" + } + ], + "shortNames": [ + { + "language": "EN", + "text": "Title" + }, + { + "language": "DE", + "text": "Titel" + } + ], + "unit": "", + "sourceOfDefinition": "", + "dataType": "StringTranslatable", + "definition": [ + { + "language": "DE", + "text": "SprachabhängigerTiteldesDokuments." + } + ] + } + } + ] + }, + { + "modelType": "ConceptDescription", + "idShort": "DigitalFile", + "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + { + "language": "EN", + "text": "DigitalFile" + }, + { + "language": "DE", + "text": "DigitaleDatei" + } + ], + "shortNames": [ + { + "language": "EN", + "text": "DigitalFile" + }, + { + "language": "DE", + "text": "DigitaleDatei" + } + ], + "unit": "", + "sourceOfDefinition": "", + "dataType": "String", + "definition": [ + { + "language": "DE", + "text": "Eine Datei, die die Document Version repräsentiert. Neben der obligatorischen PDF Datei können weitere Dateien angegeben werden." + } + ] + } + } + ] + }, + { + "modelType": "ConceptDescription", + "idShort": "MaxRotationSpeed", + "category": "PROPERTY", + "administration": { + "version": "", + "revision": "2" + }, + "id": "0173-1#02-BAA120#008", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + { + "language": "de", + "text": "max.Drehzahl" + }, + { + "language": "en", + "text": "Max.rotationspeed" + } + ], + "unit": "1/min", + "unitId": { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#05-AAA650#002" + } + ], + "type": "GlobalReference" + }, + "sourceOfDefinition": "", + "dataType": "RealMeasure", + "definition": [ + { + "language": "de", + "text": "HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf" + }, + { + "language": "en", + "text": "Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated" + } + ] + } + } + ] + }, + { + "modelType": "ConceptDescription", + "idShort": "RotationSpeed", + "category": "PROPERTY", + "id": "http://customer.com/cd/1/1/18EBD56F6B43D895", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + { + "language": "DE", + "text": "AktuelleDrehzahl" + }, + { + "language": "EN", + "text": "Actualrotationspeed" + } + ], + "shortNames": [ + { + "language": "DE", + "text": "AktuelleDrehzahl" + }, + { + "language": "EN", + "text": "ActualRotationSpeed" + } + ], + "unit": "1/min", + "unitId": { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#05-AAA650#002" + } + ], + "type": "GlobalReference" + }, + "sourceOfDefinition": "", + "dataType": "RealMeasure", + "definition": [ + { + "language": "DE", + "text": "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird" + }, + { + "language": "EN", + "text": "Actual rotationspeed with which the motor or feedingunit is operated" + } + ] + } + } + ] + }, + { + "idShort": "Document", + "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + ], + "shortNames": [ + { + "language": "EN", + "text": "Document" + }, + { + "language": "DE", + "text": "Dokument" + } + ], + "unit": "", + "sourceOfDefinition": "[ISO15519-1:2010]", + "dataType": "String", + "definition": [ + { + "language": "DE", + "text": "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann." + } + ] + } + } + ] + } + ] +} diff --git a/dataformat-json/src/test/resources/jsonExample.json b/dataformat-json/src/test/resources/jsonExample.json new file mode 100644 index 000000000..41fefacbd --- /dev/null +++ b/dataformat-json/src/test/resources/jsonExample.json @@ -0,0 +1,493 @@ + +{ + "assetAdministrationShells": [ + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "http://customer.com/assets/KHBVZJSQKIY" + } + ], + "type": "GlobalReference" + }, + "specificAssetIds": [ + { + "name": "EquipmentID", + "value": "538fd1b3-f99f-4a52-9c75-72e9fa921270", + "externalSubjectId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://customer.com/Systems/ERP/012" + } + ], + "type": "GlobalReference" + } + }, + { + "name": "DeviceID", + "value": "QjYgPggjwkiHk4RrQiYSLg==", + "externalSubjectId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://customer.com/Systems/IoT/1" + } + ], + "type": "GlobalReference" + } + } + ], + "thumbnail": { + "contentType": "image/png", + "path": "file:///master/verwaltungsschale-detail-part1.png" + } + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "http://i40.customer.com/type/1/1/7A7104BDAB57E184" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://i40.customer.com/type/1/1/1A7B62B529F19152" + } + ], + "type": "GlobalReference" + } + ], + "id": "http://customer.com/aas/9175_7013_7091_9168", + "idShort": "ExampleMotor" + } + ], + "conceptDescriptions": [ + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": + { + "modelType": "DataSpecificationIEC61360", + "dataType": "STRING_TRANSLATABLE", + "sourceOfDefinition": "ExampleString", + "unit": "ExampleString", + "definition": [ + { + "language": "EN", + "text": "SprachabhängigerTiteldesDokuments." + } + ], + "preferredName": [ + { + "language": "EN", + "text": "Title" + }, + { + "language": "DE", + "text": "Titel" + } + ], + "shortName": [ + { + "language": "EN", + "text": "Title" + }, + { + "language": "DE", + "text": "Titel" + } + ] + } + } + ], + "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title", + "idShort": "Title" + }, + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": + { + "modelType": "DataSpecificationIEC61360", + "dataType": "STRING", + "sourceOfDefinition": "ExampleString", + "unit": "ExampleString", + "definition": [ + { + "language": "EN", + "text": "A file representing the document version. In addition to the mandatory PDF file, other files can be specified." + } + ], + "preferredName": [ + { + "language": "EN", + "text": "DigitalFile" + }, + { + "language": "EN", + "text": "DigitalFile" + } + ], + "shortName": [ + { + "language": "EN", + "text": "DigitalFile" + }, + { + "language": "DE", + "text": "DigitaleDatei" + } + ] + } + } + ], + "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile", + "idShort": "DigitalFile" + }, + { + "modelType": "ConceptDescription", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": + { + "modelType": "DataSpecificationIEC61360", + "dataType": "REAL_MEASURE", + "sourceOfDefinition": "ExampleString", + "unit": "1/min", + "unitId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#05-AAA650#002" + } + ], + "type": "GlobalReference" + }, + "definition": [ + { + "language": "de", + "text": "HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf" + }, + { + "language": "EN", + "text": "Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated" + } + ], + "preferredName": [ + { + "language": "de", + "text": "max.Drehzahl" + }, + { + "language": "en", + "text": "Max.rotationspeed" + } + ] + } + } + ], + "administration": + { + "revision": "2.1", + "version": "2" + }, + "id": "0173-1#02-BAA120#008", + "category": "PROPERTY", + "idShort": "MaxRotationSpeed" + }, + { + "modelType": "ConceptDescription", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": + { + "modelType": "DataSpecificationIEC61360", + "dataType": "REAL_MEASURE", + "sourceOfDefinition": "ExampleString", + "unit": "1/min", + "unitId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#05-AAA650#002" + } + ], + "type": "GlobalReference" + }, + "definition": [ + { + "language": "DE", + "text": "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird" + }, + { + "language": "EN", + "text": "Actual rotationspeed with which the motor or feedingunit is operated" + } + ], + "preferredName": [ + { + "language": "DE", + "text": "AktuelleDrehzahl" + }, + { + "language": "EN", + "text": "Actualrotationspeed" + } + ], + "shortName": [ + { + "language": "DE", + "text": "AktuelleDrehzahl" + }, + { + "language": "EN", + "text": "ActualRotationSpeed" + } + ] + } + } + ], + "id": "http://customer.com/cd/1/1/18EBD56F6B43D895", + "category": "PROPERTY", + "idShort": "RotationSpeed" + }, + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": + { + "modelType": "DataSpecificationIEC61360", + "dataType": "STRING", + "sourceOfDefinition": "[ISO15519-1:2010]", + "unit": "ExampleString", + "definition": [ + { + "language": "EN", + "text": "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann." + } + ], + "preferredName": [ + { + "language": "EN", + "text": "Document" + } + ], + "shortName": [ + { + "language": "EN", + "text": "Document" + }, + { + "language": "DE", + "text": "Dokument" + } + ] + } + } + ], + "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document", + "idShort": "Document" + } + ], + "submodels": [ + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#01-AFZ615#016" + } + ], + "type": "GlobalReference" + }, + "id": "http://i40.customer.com/type/1/1/7A7104BDAB57E184", + "idShort": "TechnicalData", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "ConceptDescription", + "value": "0173-1#02-BAA120#008" + } + ], + "type": "GlobalReference" + }, + "value": "5000", + "valueType": "xs:integer", + "category": "PARAMETER", + "idShort": "MaxRotationSpeed" + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "id": "http://i40.customer.com/type/1/1/1A7B62B529F19152", + "idShort": "Documentation", + "submodelElements": [ + { + "modelType":"SubmodelElementCollection", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document" + } + ], + "type": "GlobalReference" + }, + "idShort": "OperatingManual", + "value": [ + { + "modelType": "Property", + "category": "VARIABLE", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title" + } + ], + "type": "GlobalReference" + }, + "value": "OperatingManual", + "valueType": "xs:string", + "idShort": "Title" + }, + { + "modelType": "File", + "category": "VARIABLE", + "contentType": "application/pdf", + "value": "file:///aasx/OperatingManual.pdf", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile" + } + ], + "type": "GlobalReference" + }, + "idShort": "DigitalFile_PDF" + } + ] + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "id": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935", + "idShort": "OperationalData", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" + } + ], + "type": "GlobalReference" + }, + "value": "4370", + "valueType": "xs:integer", + "category": "VARIABLE", + "idShort": "RotationSpeed" + } + ] + } + ] +} diff --git a/dataformat-json/src/test/resources/listOfSubmodelElements.json b/dataformat-json/src/test/resources/listOfSubmodelElements.json new file mode 100644 index 000000000..8073bcbe8 --- /dev/null +++ b/dataformat-json/src/test/resources/listOfSubmodelElements.json @@ -0,0 +1,92 @@ +[ + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int", + "kind": "ConceptQualifier" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int", + "kind": "ConceptQualifier" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + }, + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "value": "978-8234-234-342", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "978-8234-234-342" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "idShort": "InstanceId", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } +] diff --git a/dataformat-json/src/test/resources/submodelDescriptor.json b/dataformat-json/src/test/resources/submodelDescriptor.json new file mode 100644 index 000000000..d518b60e1 --- /dev/null +++ b/dataformat-json/src/test/resources/submodelDescriptor.json @@ -0,0 +1,47 @@ +{ + "endpoints" : [ { + "protocolInformation" : { + "endpointAddress" : "defaultEndpointAddress", + "endpointProtocol" : "defaultEndpointProtocol", + "endpointProtocolVersion" : "defaultEndpointProtocolVersion", + "subprotocol" : "defaultSubprotocol", + "subprotocolBody" : "defaultSubprotocolBody", + "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding" + }, + "interface" : "defaultInterface" + } ], + "administration" : { + "revision" : "defaultAdministrativeInformationRevisionValue", + "version" : "defaultAdministrativeInformationVersionValue", + "embeddedDataSpecifications" : [ { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" + } ], + "type" : "GlobalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DataSpecificationIEC61360", + "preferredName" : [ ] + } + } ] + }, + "descriptions" : [ { + "language" : "en", + "text" : "defaultDescription" + } ], + "displayNames" : [ { + "language" : "en", + "text" : "defaultDisplayName" + } ], + "idShort" : "defaultIdShort", + "identification" : "identification", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "eClassDefaultSemanticId" + } ], + "type" : "GlobalReference" + } +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/submodelElementListEmpty.json b/dataformat-json/src/test/resources/submodelElementListEmpty.json new file mode 100644 index 000000000..ca37a7d6a --- /dev/null +++ b/dataformat-json/src/test/resources/submodelElementListEmpty.json @@ -0,0 +1,6 @@ +{ + "modelType" : "SubmodelElementList", + "idShort" : "submodelElementList", + "orderRelevant" : true, + "kind": "Instance" +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/submodelList.json b/dataformat-json/src/test/resources/submodelList.json new file mode 100644 index 000000000..9337b3480 --- /dev/null +++ b/dataformat-json/src/test/resources/submodelList.json @@ -0,0 +1,297 @@ +[ + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", + "idShort": "Identification", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int", + "kind": "ConceptQualifier" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int", + "kind": "ConceptQualifier" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + }, + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "value": "978-8234-234-342", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "978-8234-234-342" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "idShort": "InstanceId", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example asset identification submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial", + "idShort": "BillOfMaterial", + "submodelElements": [ + { + "modelType": "Entity", + "kind": "Instance", + "entityType": "CoManagedEntity", + "statements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValue2", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValue2" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty2", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + }, + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + ], + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleEntity", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + }, + { + "modelType": "Entity", + "entityType": "SelfManagedEntity", + "kind": "Instance", + "globalAssetId": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset2" + } + ], + "type": "GlobalReference" + }, + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleEntity2", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example bill of material submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung" + } + ] + } +] diff --git a/dataformat-json/src/test/resources/test_demo_full_example.json b/dataformat-json/src/test/resources/test_demo_full_example.json new file mode 100644 index 000000000..5a6adcd08 --- /dev/null +++ b/dataformat-json/src/test/resources/test_demo_full_example.json @@ -0,0 +1,2878 @@ + +{ + "assetAdministrationShells": [ + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset" + } + ], + "type": "GlobalReference" + } + }, + "derivedFrom": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/TestAssetAdministrationShell2" + } + ], + "type": "GlobalReference" + }, + "submodels": [ + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" + } + ], + "type": "GlobalReference" + } + ], + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_AssetAdministrationShell", + "idShort": "TestAssetAdministrationShell", + "description": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Mandatory" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel2_Mandatory" + } + ], + "type": "GlobalReference" + } + ], + "id": "https://acplt.org/Test_AssetAdministrationShell_Mandatory", + "idShort": "Test_AssetAdministrationShell_Mandatory" + }, + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Mandatory" + } + ], + "type": "GlobalReference" + } + }, + "id": "https://acplt.org/Test_AssetAdministrationShell2_Mandatory", + "idShort": "Test_AssetAdministrationShell2_Mandatory" + }, + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Missing" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + } + ], + "type": "GlobalReference" + } + ], + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_AssetAdministrationShell_Missing", + "idShort": "TestAssetAdministrationShell", + "description": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + + } + ], + "conceptDescriptions": [ + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_ConceptDescription", + "idShort": "TestConceptDescription", + "isCaseOf": [ + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription" + } + ], + "type": "GlobalReference" + } + ], + "description": [ + { + "language": "en-us", + "text": "An example concept description for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-ConceptDescription für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "id": "https://acplt.org/Test_ConceptDescription_Mandatory", + "idShort": "Test_ConceptDescription_Mandatory" + }, + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_ConceptDescription_Missing", + "idShort": "TestConceptDescription1", + "description": [ + { + "language": "en-us", + "text": "An example concept description for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-ConceptDescription für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "http://acplt.org/DataSpecifciations/Example/Identification", + "idShort": "TestSpec_01", + "isCaseOf": [ + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ConceptDescriptionX" + } + ], + "type": "GlobalReference" + } + ], + "embeddedDataSpecifications": + [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "dataType": "REAL_MEASURE", + "sourceOfDefinition": "http://acplt.org/DataSpec/ExampleDef", + "symbol": "SU", + "unit": "SpaceUnit", + "unitId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Units/SpaceUnit" + } + ], + "type": "GlobalReference" + }, + "value": "TEST", + "valueFormat": "string", + "valueList": { + "valueReferencePairs": [ + { + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + } + }, + { + "value": "http://acplt.org/ValueId/ExampleValueId2", + "valueId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId2" + } + ], + "type": "GlobalReference" + } + } + ] + }, + "definition": [ + { + "language": "de", + "text": "Dies ist eine Data Specification für Testzwecke" + }, + { + "language": "en-us", + "text": "This is a DataSpecification for testing purposes" + } + ], + "levelType": "Max", + "preferredName": [ + { + "language": "de", + "text": "Test Specification" + }, + { + "language": "en-us", + "text": "TestSpecification" + } + ], + "shortName": [ + { + "language": "de", + "text": "Test Spec" + }, + { + "language": "en-us", + "text": "TestSpec" + } + ] + } + } + ] + } + ], + "submodels": [ + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", + "idShort": "Identification", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int", + "kind": "ConceptQualifier" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int", + "kind": "ConceptQualifier" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + + }, + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "value": "978-8234-234-342", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "978-8234-234-342" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "idShort": "InstanceId", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + + } + ], + "description": [ + { + "language": "en-us", + "text": "An example asset identification submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial", + "idShort": "BillOfMaterial", + "submodelElements": [ + { + "modelType": "Entity", + "kind": "Instance", + "entityType": "CoManagedEntity", + "statements": [ + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValue2", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValue2" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty2", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + }, + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + ], + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleEntity", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + + }, + { + "modelType": "Entity", + "kind": "Instance", + "entityType": "SelfManagedEntity", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset2" + } + ], + "type": "GlobalReference" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleEntity2", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + + } + ], + "description": [ + { + "language": "en-us", + "text": "An example bill of material submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_Submodel", + "idShort": "TestSubmodel", + "submodelElements": [ + { + "modelType": "RelationshipElement", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + }, + { + "type": "Entity", + "value": "ExampleEntity" + }, + { + "type": "Property", + "value": "ExampleProperty2" + } + ], + "type": "ModelReference" + }, + "description": [ + { + "language": "en-us", + "text": "Example RelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel RelationshipElement Element" + } + ] + + }, + { + "modelType": "AnnotatedRelationshipElement", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + }, + { + "type": "Entity", + "value": "ExampleEntity" + }, + { + "type": "Property", + "value": "ExampleProperty2" + } + ], + "type": "ModelReference" + }, + "annotations": [ + { + "modelType": "Property", + "kind": "Instance", + "value": "some example annotation", + "valueType": "xs:string", + "category": "PARAMETER", + "idShort": "ExampleProperty3" + } + ], + "description": [ + { + "language": "en-us", + "text": "Example AnnotatedRelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel AnnotatedRelationshipElement Element" + } + ] + + }, + { + "modelType": "Operation", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Operations/ExampleOperation" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleOperation", + "inoutputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty3", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "inputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty1", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "outputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty2", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "description": [ + { + "language": "en-us", + "text": "Example Operation object" + }, + { + "language": "de", + "text": "Beispiel Operation Element" + } + ] + + }, + { + "modelType": "Capability", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Capabilities/ExampleCapability" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleCapability", + "description": [ + { + "language": "en-us", + "text": "Example Capability object" + }, + { + "language": "de", + "text": "Beispiel Capability Element" + } + ] + + }, + { + "modelType": "BasicEventElement", + "kind": "Instance", + "observed": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Events/ExampleBasicEvent" + } + ], + "type": "GlobalReference" + }, + "direction": "INPUT", + "state": "ON", + "category": "PARAMETER", + "idShort": "ExampleBasicEvent", + "description": [ + { + "language": "en-us", + "text": "Example BasicEvent object" + }, + { + "language": "de", + "text": "Beispiel BasicEvent Element" + } + ], + "direction": "INPUT", + "state": "ON" + }, + { + "modelType": "SubmodelElementList", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementListOrdered", + "orderRelevant": true, + "description": [ + { + "language": "en-us", + "text": "Example ExampleSubmodelElementListOrdered object" + }, + { + "language": "de", + "text": "Beispiel ExampleSubmodelElementListOrdered Element" + } + ], + "typeValueListElement": "SubmodelElement", + "value": [ + { + "modelType": "Property", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + }, + { + "modelType": "MultiLanguageProperty", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleMultiLanguageValueId" + } + ], + "type": "GlobalReference" + }, + "category": "CONSTANT", + "idShort": "ExampleMultiLanguageProperty", + "value": [ + { + "language": "en-us", + "text": "Example value of a MultiLanguageProperty element" + }, + { + "language": "de", + "text": "Beispielswert für ein MultiLanguageProperty-Element" + } + ], + "description": [ + { + "language": "en-us", + "text": "Example MultiLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MultiLanguageProperty Element" + } + ] + + }, + { + "modelType": "Range", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "max": "100", + "min": "0", + "valueType": "xs:int", + "category": "PARAMETER", + "idShort": "ExampleRange", + "description": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + + } + ] + }, + { + "modelType": "SubmodelElementCollection", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementCollection", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollection object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollection Element" + } + ], + "value": [ + { + "modelType": "Blob", + "kind": "Instance", + + "contentType": "application/pdf", + "value": "AQIDBAU=", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Blobs/ExampleBlob" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleBlob", + "description": [ + { + "language": "en-us", + "text": "Example Blob object" + }, + { + "language": "de", + "text": "Beispiel Blob Element" + } + ] + + }, + { + "modelType": "File", + "kind": "Instance", + + "contentType": "application/pdf", + "value": "file:///TestFile.pdf", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Files/ExampleFile" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleFile", + "description": [ + { + "language": "en-us", + "text": "Example File object" + }, + { + "language": "de", + "text": "Beispiel File Element" + } + ] + + }, + { + "modelType": "ReferenceElement", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleReferenceElement", + "value": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "description": [ + { + "language": "en-us", + "text": "Example Reference Element object" + }, + { + "language": "de", + "text": "Beispiel Reference Element Element" + } + ] + + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Teilmodell für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "Submodel", + "kind": "Template", + "id": "https://acplt.org/Test_Submodel_Mandatory", + "idShort": "Test_Submodel_Mandatory", + "submodelElements": [ + { + "modelType": "RelationshipElement", + "kind": "Instance", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListUnordered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListUnordered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "ModelReference" + } + }, + { + "modelType": "AnnotatedRelationshipElement", + "kind": "Instance", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelElementCollection" + }, + { + "type": "Blob", + "value": "ExampleBlob" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListUnordered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "ModelReference" + } + }, + { + "modelType": "Operation", + "kind": "Template", + "idShort": "ExampleOperation" + }, + { + "modelType": "Capability", + "kind": "Instance", + + "idShort": "ExampleCapability" + }, + { + "modelType": "BasicEventElement", + "kind": "Instance", + + "observed": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListUnordered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "idShort": "ExampleBasicEvent", + "direction": "OUTPUT", + "state": "OFF" + }, + { + "modelType": "SubmodelElementList", + "kind": "Instance", + + "idShort": "ExampleSubmodelElementListUnordered", + "orderRelevant": false, + "typeValueListElement": "SubmodelElement", + "value": [ + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "valueType": "xs:string", + "idShort": "ExampleProperty" + }, + { + "modelType": "MultiLanguageProperty", + "kind": "Instance", + "category": "VARIABLE", + "idShort": "ExampleMultiLanguageProperty" + }, + { + "modelType": "Range", + "kind": "Instance", + "category": "VARIABLE", + "valueType": "xs:int", + "idShort": "ExampleRange" + } + ] + }, + { + "modelType": "SubmodelElementCollection", + "kind": "Instance", + "idShort": "ExampleSubmodelElementCollection", + "value": [ + { + "modelType": "Blob", + "kind": "Instance", + "category": "VARIABLE", + "contentType": "application/pdf", + "idShort": "ExampleBlob" + }, + { + "modelType": "File", + "kind": "Instance", + "category": "VARIABLE", + "contentType": "application/pdf", + "idShort": "ExampleFile" + }, + { + "modelType": "ReferenceElement", + "kind": "Instance", + "category": "VARIABLE", + "idShort": "ExampleReferenceElement" + } + ] + }, + { + "modelType": "SubmodelElementCollection", + "kind": "Instance", + "idShort": "ExampleSubmodelElementCollection2" + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "id": "https://acplt.org/Test_Submodel2_Mandatory", + "idShort": "Test_Submodel2_Mandatory" + }, + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_Submodel_Missing", + "idShort": "TestSubmodelMissing", + "submodelElements": [ + { + "modelType": "RelationshipElement", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "ModelReference" + }, + "description": [ + { + "language": "en-us", + "text": "Example RelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel RelationshipElement Element" + } + ] + + }, + { + "modelType": "AnnotatedRelationshipElement", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "ModelReference" + }, + "annotations": [ + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "value": "some example annotation", + "valueType": "xs:string", + "category": "PARAMETER", + "idShort": "ExampleProperty" + } + ], + "description": [ + { + "language": "en-us", + "text": "Example AnnotatedRelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel AnnotatedRelationshipElement Element" + } + ] + + }, + { + "modelType": "Operation", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Operations/ExampleOperation" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleOperation", + "inoutputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string", + "kind": "ConceptQualifier" + } + ], + "category": "CONSTANT", + "idShort": "ExampleProperty3", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "inputVariables": [ + { + "value": { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string", + "kind": "ConceptQualifier" + } + ], + "category": "CONSTANT", + "idShort": "ExampleProperty1", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + ], + "outputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string", + "kind": "ConceptQualifier" + } + ], + "category": "CONSTANT", + "idShort": "ExampleProperty2", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "description": [ + { + "language": "en-us", + "text": "Example Operation object" + }, + { + "language": "de", + "text": "Beispiel Operation Element" + } + ] + + }, + { + "modelType": "Capability", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Capabilities/ExampleCapability" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleCapability", + "description": [ + { + "language": "en-us", + "text": "Example Capability object" + }, + { + "language": "de", + "text": "Beispiel Capability Element" + } + ] + + }, + { + "modelType": "BasicEventElement", + "kind": "Instance", + + "observed": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Events/ExampleBasicEvent" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleBasicEvent", + "direction": "INPUT", + "state": "ON", + "description": [ + { + "language": "en-us", + "text": "Example BasicEvent object" + }, + { + "language": "de", + "text": "Beispiel BasicEvent Element" + } + ], + "direction": "INPUT", + "state": "ON" + }, + { + "kind": "Instance", + + "modelType": "SubmodelElementList", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementListOrdered", + "orderRelevant": true, + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementListOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementListOrdered Element" + } + ], + "typeValueListElement": "SubmodelElement", + "value": [ + { + "modelType": "Property", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string", + "kind": "ConceptQualifier" + } + ], + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + }, + { + "modelType": "MultiLanguageProperty", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "category": "CONSTANT", + "idShort": "ExampleMultiLanguageProperty", + "value": [ + { + "language": "en-us", + "text": "Example value of a MultiLanguageProperty element" + }, + { + "language": "de", + "text": "Beispielswert für ein MultiLanguageProperty-Element" + } + ], + "description": [ + { + "language": "en-us", + "text": "Example MultiLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MultiLanguageProperty Element" + } + ] + }, + { + "modelType": "Range", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "max": "100", + "min": "0", + "valueType": "xs:int", + "category": "PARAMETER", + "idShort": "ExampleRange", + "description": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + + } + ] + }, + { + "modelType": "SubmodelElementCollection", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementCollection", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollection object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollection Element" + } + ], + "value": [ + { + "modelType": "Blob", + "kind": "Instance", + + "contentType": "application/pdf", + "value": "AQIDBAU=", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Blobs/ExampleBlob" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleBlob", + "description": [ + { + "language": "en-us", + "text": "Example Blob object" + }, + { + "language": "de", + "text": "Beispiel Blob Element" + } + ] + + }, + { + "modelType": "File", + "kind": "Instance", + "contentType": "application/pdf", + "value": "file:///TestFile.pdf", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Files/ExampleFile" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleFile", + "description": [ + { + "language": "en-us", + "text": "Example File object" + }, + { + "language": "de", + "text": "Beispiel File Element" + } + ] + + }, + { + "modelType": "ReferenceElement", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleReferenceElement", + "value": { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelElementCollection" + }, + { + "type": "File", + "value": "ExampleFile" + } + ], + "type": "ModelReference" + }, + "description": [ + { + "language": "en-us", + "text": "Example Reference Element object" + }, + { + "language": "de", + "text": "Beispiel Reference Element Element" + } + ] + + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Teilmodell für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "Submodel", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_Submodel_Template", + "idShort": "TestSubmodelTemplate", + "submodelElements": [ + { + "modelType": "RelationshipElement", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Template" + }, + { + "type": "Operation", + "value": "ExampleOperation" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Template" + }, + { + "type": "Operation", + "value": "ExampleOperation" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "description": [ + { + "language": "en-us", + "text": "Example RelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel RelationshipElement Element" + } + ] + + }, + { + "modelType": "AnnotatedRelationshipElement", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Template" + }, + { + "type": "Operation", + "value": "ExampleOperation" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Template" + }, + { + "type": "Operation", + "value": "ExampleOperation" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "description": [ + { + "language": "en-us", + "text": "Example AnnotatedRelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel AnnotatedRelationshipElement Element" + } + ] + }, + { + "modelType": "Operation", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Operations/ExampleOperation" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleOperation", + "inoutputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "inputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "outputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "description": [ + { + "language": "en-us", + "text": "Example Operation object" + }, + { + "language": "de", + "text": "Beispiel Operation Element" + } + ] + + }, + { + "modelType": "Capability", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Capabilities/ExampleCapability" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleCapability", + "description": [ + { + "language": "en-us", + "text": "Example Capability object" + }, + { + "language": "de", + "text": "Beispiel Capability Element" + } + ] + + }, + { + "modelType": "BasicEventElement", + "observed": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Template" + }, + { + "type": "Operation", + "value": "ExampleOperation" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Events/ExampleBasicEvent" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleBasicEvent", + "direction": "OUTPUT", + "state": "OFF", + "description": [ + { + "language": "en-us", + "text": "Example BasicEvent object" + }, + { + "language": "de", + "text": "Beispiel BasicEvent Element" + } + ], + "direction": "OUTPUT", + "state": "OFF" + }, + { + "modelType": "SubmodelElementList", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementListOrdered", + "orderRelevant": true, + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementListOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementListOrdered Element" + } + ], + "typeValueListElement": "SubmodelElement", + "value": [ + { + "modelType": "Property", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + }, + { + "modelType": "MultiLanguageProperty", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "category": "CONSTANT", + "idShort": "ExampleMultiLanguageProperty", + "description": [ + { + "language": "en-us", + "text": "Example MultiLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MultiLanguageProperty Element" + } + ] + + }, + { + "modelType": "Range", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "max": "100", + "valueType": "xs:int", + "category": "PARAMETER", + "idShort": "ExampleRange", + "description": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + + }, + { + "modelType": "Range", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "min": "0", + "valueType": "xs:int", + "category": "PARAMETER", + "idShort": "ExampleRange2", + "description": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + + } + ] + }, + { + "modelType": "SubmodelElementCollection", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementCollection", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollection object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollection Element" + } + ], + "value": [ + { + "modelType": "Blob", + "contentType": "application/pdf", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Blobs/ExampleBlob" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleBlob", + "description": [ + { + "language": "en-us", + "text": "Example Blob object" + }, + { + "language": "de", + "text": "Beispiel Blob Element" + } + ] + + }, + { + "modelType": "File", + "contentType": "application/pdf", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Files/ExampleFile" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleFile", + "description": [ + { + "language": "en-us", + "text": "Example File object" + }, + { + "language": "de", + "text": "Beispiel File Element" + } + ] + + }, + { + "modelType": "ReferenceElement", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleReferenceElement", + "description": [ + { + "language": "en-us", + "text": "Example Reference Element object" + }, + { + "language": "de", + "text": "Beispiel Reference Element Element" + } + ] + + } + ] + }, + { + "modelType": "SubmodelElementCollection", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementCollection2", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollection object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollection Element" + } + ] + + } + ], + "description": [ + { + "language": "en-us", + "text": "An example submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Teilmodell für eine Test-Anwendung" + } + ] + + } + ] +} diff --git a/dataformat-json/src/test/resources/test_demo_full_example_withEmbeddedConceptDescription.json b/dataformat-json/src/test/resources/test_demo_full_example_withEmbeddedConceptDescription.json new file mode 100644 index 000000000..16a24778e --- /dev/null +++ b/dataformat-json/src/test/resources/test_demo_full_example_withEmbeddedConceptDescription.json @@ -0,0 +1,3135 @@ + +{ + "assetAdministrationShells": [ + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset" + } + ], + "type": "GlobalReference" + } + }, + "derivedFrom": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/TestAssetAdministrationShell2" + } + ], + "type": "GlobalReference" + }, + "submodels": [ + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" + } + ], + "type": "GlobalReference" + } + ], + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_AssetAdministrationShell", + "idShort": "TestAssetAdministrationShell", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Mandatory" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel2_Mandatory" + } + ], + "type": "GlobalReference" + } + ], + "id": "https://acplt.org/Test_AssetAdministrationShell_Mandatory", + "idShort": "Test_AssetAdministrationShell_Mandatory" + }, + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Mandatory" + } + ], + "type": "GlobalReference" + } + }, + "id": "https://acplt.org/Test_AssetAdministrationShell2_Mandatory", + "idShort": "Test_AssetAdministrationShell2_Mandatory" + }, + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Missing" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + } + ], + "type": "GlobalReference" + } + ], + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_AssetAdministrationShell_Missing", + "idShort": "TestAssetAdministrationShell", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + } + ], + "conceptDescriptions": [ + { + "modelType": "ConceptDescription", + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_ConceptDescription", + "idShort": "TestConceptDescription", + "isCaseOf": [ + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription" + } + ], + "type": "GlobalReference" + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": "ConceptDescription", + "id": "https://acplt.org/Test_ConceptDescription_Mandatory", + "idShort": "Test_ConceptDescription_Mandatory" + }, + { + "modelType": "ConceptDescription", + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_ConceptDescription_Missing", + "idShort": "TestConceptDescription1", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": "ConceptDescription", + "embeddedDataSpecifications": [ + { + "dataSpecification": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": + { + "dataType": "RealMeasure", + "sourceOfDefinition": "http://acplt.org/DataSpec/ExampleDef", + "symbol": "SU", + "unit": "SpaceUnit", + "unitId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Units/SpaceUnit" + } + ], + "type": "GlobalReference" + }, + "value": "TEST", + "valueFormat": "xs:string", + "valueList": + { + "valueReferencePairTypes": [ + { + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + } + }, + { + "value": "http://acplt.org/ValueId/ExampleValueId2", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId2" + } + ], + "type": "GlobalReference" + } + } + ] + }, + "definition": [ + { + "language": "de", + "text": "Dies ist eine Data Specification für Testzwecke" + }, + { + "language": "en-us", + "text": "This is a DataSpecification for testing purposes" + } + ], + "levelType": ["Min", "Max"], + "preferredName": [ + { + "language": "de", + "text": "Test Specification" + }, + { + "language": "en-us", + "text": "TestSpecification" + } + ], + "shortNames": [ + { + "language": "de", + "text": "Test Spec" + }, + { + "language": "en-us", + "text": "TestSpec" + } + ] + } + } + ], + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "http://acplt.org/DataSpecifciations/Example/Identification", + "idShort": "TestSpec_01", + "isCaseOf": [ + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ConceptDescriptionX" + } + ], + "type": "GlobalReference" + } + ] + } + ], + "submodels": [ + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", + "idShort": "Identification", + "submodelElements": [ + { + "modelType": "Property", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "modelType": "Qualifier", + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "Int" + }, + { + "modelType": + { + "name": "Qualifier" + }, + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "Int" + } + ], + "idShort": "ManufacturerName", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + }, + { + "modelType": "Property", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "value": "978-8234-234-342", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "978-8234-234-342" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "idShort": "InstanceId", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial", + "idShort": "BillOfMaterial", + "submodelElements": [ + { + "modelType": "Entity", + "entityType": "CoManagedEntity", + "statements": [ + { + "modelType": "Property", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValue2", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValue2" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty2", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + }, + { + "modelType": "Property", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + ], + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleEntity", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + }, + { + "modelType": + { + "name": "Entity" + }, + "entityType": "SelfManagedEntity", + "globalAssetId": + { + "keys": [ + { + + "type": "Asset", + "value": "https://acplt.org/Test_Asset2" + } + ], + "type": "GlobalReference" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleEntity2", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": + { + "name": "Submodel" + }, + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_Submodel", + "idShort": "TestSubmodel", + "submodelElements": [ + { + "modelType": + { + "name": "RelationshipElement" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + }, + { + "type": "Entity", + "value": "ExampleEntity" + }, + { + "type": "Property", + "value": "ExampleProperty2" + } + ], + "type": "GlobalReference" + }, +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example RelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel RelationshipElement Element" + } + ] + } + }, + { + "modelType": + { + "name": "AnnotatedRelationshipElement" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + }, + { + "type": "Entity", + "value": "ExampleEntity" + }, + { + "type": "Property", + "value": "ExampleProperty2" + } + ], + "type": "GlobalReference" + }, + "annotation": [ + { + "modelType": + { + "name": "Property" + }, + "kind": "Instance", + "value": "some example annotation", + "valueType": "xs:string", + "category": "Parameter", + "idShort": "ExampleProperty3" + } + ], +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example AnnotatedRelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel AnnotatedRelationshipElement Element" + } + ] + } + }, + { + "modelType": + { + "name": "Operation" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Operations/ExampleOperation" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleOperation", + "inoutputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty3", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], + "inputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty1", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], + "outputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty2", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Operation object" + }, + { + "language": "de", + "text": "Beispiel Operation Element" + } + ] + } + }, + { + "modelType": + { + "name": "Capability" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Capabilities/ExampleCapability" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleCapability", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Capability object" + }, + { + "language": "de", + "text": "Beispiel Capability Element" + } + ] + } + }, + { + "modelType": + { + "name": "BasicEventElement" + }, + "observed": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Events/ExampleBasicEvent" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleBasicEvent", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example BasicEvent object" + }, + { + "language": "de", + "text": "Beispiel BasicEvent Element" + } + ] + } + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionOrdered", + "ordered": true, + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionOrdered Element" + } + ] + }, + "value": [ + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + }, + { + "modelType": + { + "name": "MultiLanguageProperty" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleMultiLanguageValueId" + } + ], + "type": "GlobalReference" + }, + "category": "Constant", + "idShort": "ExampleMultiLanguageProperty", + "value": [ + { + "language": "en-us", + "text": "Example value of a MultiLanguageProperty element" + }, + { + "language": "de", + "text": "Beispielswert für ein MulitLanguageProperty-Element" + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example MulitLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MulitLanguageProperty Element" + } + ] + } + }, + { + "modelType": + { + "name": "Range" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "max": "100", + "min": "0", + "valueType": "Int", + "category": "Parameter", + "idShort": "ExampleRange", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + } + } + ] + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionUnordered", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionUnordered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionUnordered Element" + } + ] + }, + "value": [ + { + "modelType": + { + "name": "Blob" + }, + "mimeType": "application/pdf", + "value": "AQIDBAU=", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Blobs/ExampleBlob" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleBlob", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Blob object" + }, + { + "language": "de", + "text": "Beispiel Blob Element" + } + ] + } + }, + { + "modelType": + { + "name": "File" + }, + "mimeType": "application/pdf", + "value": "/TestFile.pdf", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Files/ExampleFile" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleFile", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example File object" + }, + { + "language": "de", + "text": "Beispiel File Element" + } + ] + } + }, + { + "modelType": + { + "name": "ReferenceElement" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleReferenceElement", + "value": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "idType": "IdShort", + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "idType": "IdShort", + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Reference Element object" + }, + { + "language": "de", + "text": "Beispiel Reference Element Element" + } + ] + } + } + ] + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": + { + "name": "Submodel" + }, + "kind": "Template", + "id": "https://acplt.org/Test_Submodel_Mandatory", + "idShort": "Test_Submodel_Mandatory", + "submodelElements": [ + { + "modelType": + { + "name": "RelationshipElement" + }, + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + } + }, + { + "modelType": + { + "name": "AnnotatedRelationshipElement" + }, + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + } + }, + { + "modelType": + { + "name": "Operation" + }, + "kind": "Template", + "idShort": "ExampleOperation" + }, + { + "modelType": + { + "name": "Capability" + }, + "idShort": "ExampleCapability" + }, + { + "modelType": + { + "name": "BasicEventElement" + }, + "observed": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleBasicEvent" + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "idShort": "ExampleSubmodelCollectionOrdered", + "ordered": true, + "value": [ + { + "modelType": + { + "name": "Property" + }, + "valueType": "xs:string", + "idShort": "ExampleProperty" + }, + { + "modelType": + { + "name": "MultiLanguageProperty" + }, + "idShort": "ExampleMultiLanguageProperty" + }, + { + "modelType": + { + "name": "Range" + }, + "valueType": "Int", + "idShort": "ExampleRange" + } + ] + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "idShort": "ExampleSubmodelCollectionUnordered", + "value": [ + { + "modelType": + { + "name": "Blob" + }, + "mimeType": "application/pdf", + "idShort": "ExampleBlob" + }, + { + "modelType": + { + "name": "File" + }, + "mimeType": "application/pdf", + "idShort": "ExampleFile" + }, + { + "modelType": + { + "name": "ReferenceElement" + }, + "idShort": "ExampleReferenceElement" + } + ] + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "idShort": "ExampleSubmodelCollectionUnordered2" + } + ] + }, + { + "modelType": + { + "name": "Submodel" + }, + "kind": "Instance", + "id": "https://acplt.org/Test_Submodel2_Mandatory", + "idShort": "Test_Submodel2_Mandatory" + }, + { + "modelType": + { + "name": "Submodel" + }, + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_Submodel_Missing", + "idShort": "TestSubmodel", + "submodelElements": [ + { + "modelType": + { + "name": "RelationshipElement" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example RelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel RelationshipElement Element" + } + ] + } + }, + { + "modelType": + { + "name": "AnnotatedRelationshipElement" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "annotation": [ + { + "modelType": + { + "name": "Property" + }, + "kind": "Instance", + "value": "some example annotation", + "valueType": "xs:string", + "category": "Parameter", + "idShort": "ExampleProperty" + } + ], +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example AnnotatedRelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel AnnotatedRelationshipElement Element" + } + ] + } + }, + { + "modelType": + { + "name": "Operation" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Operations/ExampleOperation" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleOperation", + "inoutputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "modelType": + { + "name": "Qualifier" + }, + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string" + } + ], + "category": "Constant", + "idShort": "ExampleProperty3", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], + "inputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "modelType": + { + "name": "Qualifier" + }, + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string" + } + ], + "category": "Constant", + "idShort": "ExampleProperty1", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], + "outputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "modelType": + { + "name": "Qualifier" + }, + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string" + } + ], + "category": "Constant", + "idShort": "ExampleProperty2", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Operation object" + }, + { + "language": "de", + "text": "Beispiel Operation Element" + } + ] + } + }, + { + "modelType": + { + "name": "Capability" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Capabilities/ExampleCapability" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleCapability", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Capability object" + }, + { + "language": "de", + "text": "Beispiel Capability Element" + } + ] + } + }, + { + "modelType": + { + "name": "BasicEventElement" + }, + "observed": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Events/ExampleBasicEvent" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleBasicEvent", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example BasicEvent object" + }, + { + "language": "de", + "text": "Beispiel BasicEvent Element" + } + ] + } + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionOrdered", + "ordered": true, + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionOrdered Element" + } + ] + }, + "value": [ + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "modelType": + { + "name": "Qualifier" + }, + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string" + } + ], + "category": "Constant", + "idShort": "ExampleProperty", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + }, + { + "modelType": + { + "name": "MultiLanguageProperty" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "category": "Constant", + "idShort": "ExampleMultiLanguageProperty", + "value": [ + { + "language": "en-us", + "text": "Example value of a MultiLanguageProperty element" + }, + { + "language": "de", + "text": "Beispielswert für ein MulitLanguageProperty-Element" + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example MulitLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MulitLanguageProperty Element" + } + ] + } + }, + { + "modelType": + { + "name": "Range" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "max": "100", + "min": "0", + "valueType": "Int", + "category": "Parameter", + "idShort": "ExampleRange", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + } + } + ] + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionUnordered", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionUnordered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionUnordered Element" + } + ] + }, + "value": [ + { + "modelType": + { + "name": "Blob" + }, + "mimeType": "application/pdf", + "value": "AQIDBAU=", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Blobs/ExampleBlob" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleBlob", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Blob object" + }, + { + "language": "de", + "text": "Beispiel Blob Element" + } + ] + } + }, + { + "modelType": + { + "name": "File" + }, + "mimeType": "application/pdf", + "value": "/TestFile.pdf", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Files/ExampleFile" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleFile", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example File object" + }, + { + "language": "de", + "text": "Beispiel File Element" + } + ] + } + }, + { + "modelType": + { + "name": "ReferenceElement" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleReferenceElement", + "value": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "idType": "IdShort", + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "idType": "IdShort", + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Reference Element object" + }, + { + "language": "de", + "text": "Beispiel Reference Element Element" + } + ] + } + } + ] + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": + { + "name": "Submodel" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_Submodel_Template", + "idShort": "TestSubmodel", + "submodelElements": [ + { + "modelType": + { + "name": "RelationshipElement" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example RelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel RelationshipElement Element" + } + ] + } + }, + { + "modelType": + { + "name": "AnnotatedRelationshipElement" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example AnnotatedRelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel AnnotatedRelationshipElement Element" + } + ] + } + }, + { + "modelType": + { + "name": "Operation" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Operations/ExampleOperation" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleOperation", + "inoutputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], + "inputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], + "outputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Operation object" + }, + { + "language": "de", + "text": "Beispiel Operation Element" + } + ] + } + }, + { + "modelType": + { + "name": "Capability" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Capabilities/ExampleCapability" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleCapability", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Capability object" + }, + { + "language": "de", + "text": "Beispiel Capability Element" + } + ] + } + }, + { + "modelType": + { + "name": "BasicEventElement" + }, + "observed": + { + "keys": [ + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Events/ExampleBasicEvent" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleBasicEvent", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example BasicEvent object" + }, + { + "language": "de", + "text": "Beispiel BasicEvent Element" + } + ] + } + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionOrdered", + "ordered": true, +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionOrdered Element" + } + ] + }, + "value": [ + { + "modelType": + { + "name": "Property" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + }, + { + "modelType": + { + "name": "MultiLanguageProperty" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "category": "Constant", + "idShort": "ExampleMultiLanguageProperty", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example MulitLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MulitLanguageProperty Element" + } + ] + } + }, + { + "modelType": + { + "name": "Range" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "max": "100", + "valueType": "Int", + "category": "Parameter", + "idShort": "ExampleRange", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + } + }, + { + "modelType": + { + "name": "Range" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "min": "0", + "valueType": "Int", + "category": "Parameter", + "idShort": "ExampleRange2", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + } + } + ] + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionUnordered", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionUnordered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionUnordered Element" + } + ] + }, + "value": [ + { + "modelType": + { + "name": "Blob" + }, + "mimeType": "application/pdf", + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Blobs/ExampleBlob" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleBlob", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Blob object" + }, + { + "language": "de", + "text": "Beispiel Blob Element" + } + ] + } + }, + { + "modelType": + { + "name": "File" + }, + "mimeType": "application/pdf", + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Files/ExampleFile" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleFile", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example File object" + }, + { + "language": "de", + "text": "Beispiel File Element" + } + ] + } + }, + { + "modelType": + { + "name": "ReferenceElement" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleReferenceElement", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Reference Element object" + }, + { + "language": "de", + "text": "Beispiel Reference Element Element" + } + ] + } + } + ] + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionUnordered2", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionUnordered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionUnordered Element" + } + ] + } + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + } + ] +} From 2bdb3bba68a36008dd677050d8ef39419f5d005c Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 29 Jun 2023 11:08:11 +0200 Subject: [PATCH 06/59] Create dataformat-rdf project --- dataformat-rdf/pom.xml | 45 + .../v3/dataformat/rdf/FallbackSerializer.java | 43 + .../v3/dataformat/rdf/IgnoreTypeMixIn.java | 23 + .../aas4j/v3/dataformat/rdf/JsonLDModule.java | 53 + .../v3/dataformat/rdf/JsonLDSerializer.java | 197 +++ .../rdf/JsonLDSerializerModifier.java | 45 + .../dataformat/rdf/JsonLdEnumSerializer.java | 89 ++ .../dataformat/rdf/LangStringSerializer.java | 54 + .../aas4j/v3/dataformat/rdf/Parser.java | 1171 +++++++++++++++++ .../aas4j/v3/dataformat/rdf/Serializer.java | 309 +++++ .../v3/dataformat/rdf/UriSerializer.java | 54 + .../rdf/custom/BigDecimalSerializer.java | 43 + .../rdf/custom/JsonLdEnumMixin.java | 24 + .../rdf/custom/LangStringMixin.java | 36 + .../rdf/custom/ReflectiveMixInResolver.java | 42 + .../XMLGregorianCalendarDeserializer.java | 50 + .../XMLGregorianCalendarSerializer.java | 48 + .../AdministrativeInformationMixin.java | 39 + .../AnnotatedRelationshipElementMixin.java | 34 + .../mixins/AssetAdministrationShellMixin.java | 48 + .../rdf/mixins/AssetInformationMixin.java | 61 + .../rdf/mixins/BasicEventElementMixin.java | 80 ++ .../v3/dataformat/rdf/mixins/BlobMixin.java | 39 + .../rdf/mixins/CapabilityMixin.java | 28 + .../rdf/mixins/ConceptDescriptionMixin.java | 34 + .../rdf/mixins/DataElementMixin.java | 38 + .../mixins/DataSpecificationContentMixin.java | 34 + .../DataSpecificationIEC61360Mixin.java | 107 ++ .../DataSpecificationPhysicalUnitMixin.java | 100 ++ .../EmbeddedDataSpecificationMixin.java | 45 + .../v3/dataformat/rdf/mixins/EntityMixin.java | 55 + .../rdf/mixins/EnvironmentMixin.java | 48 + .../rdf/mixins/EventElementMixin.java | 34 + .../rdf/mixins/EventMessageMixin.java | 28 + .../dataformat/rdf/mixins/ExtensionMixin.java | 51 + .../v3/dataformat/rdf/mixins/FileMixin.java | 39 + .../dataformat/rdf/mixins/FormulaMixin.java | 34 + .../rdf/mixins/HasDataSpecificationMixin.java | 50 + .../rdf/mixins/HasExtensionsMixin.java | 34 + .../dataformat/rdf/mixins/HasKindMixin.java | 40 + .../rdf/mixins/HasSemanticsMixin.java | 50 + .../rdf/mixins/IdentifiableMixin.java | 48 + .../mixins/IdentifierKeyValuePairMixin.java | 45 + .../rdf/mixins/IdentifierMixin.java | 32 + .../v3/dataformat/rdf/mixins/KeyMixin.java | 40 + .../mixins/MultiLanguagePropertyMixin.java | 41 + .../rdf/mixins/ObjectAttributesMixin.java | 34 + .../dataformat/rdf/mixins/OperationMixin.java | 45 + .../rdf/mixins/OperationVariableMixin.java | 33 + .../rdf/mixins/PolicyDecisionPointMixin.java | 33 + .../mixins/PolicyEnforcementPointsMixin.java | 33 + .../mixins/PolicyInformationPointsMixin.java | 40 + .../dataformat/rdf/mixins/PropertyMixin.java | 45 + .../rdf/mixins/QualifiableMixin.java | 41 + .../dataformat/rdf/mixins/QualifierMixin.java | 51 + .../v3/dataformat/rdf/mixins/RangeMixin.java | 45 + .../dataformat/rdf/mixins/ReferableMixin.java | 59 + .../rdf/mixins/ReferenceElementMixin.java | 33 + .../dataformat/rdf/mixins/ReferenceMixin.java | 42 + .../rdf/mixins/RelationshipElementMixin.java | 44 + .../dataformat/rdf/mixins/ResourceMixin.java | 41 + .../rdf/mixins/SpecificAssetIdMixin.java | 48 + .../rdf/mixins/SubjectAttributesMixin.java | 34 + .../SubmodelElementCollectionMixin.java | 46 + .../rdf/mixins/SubmodelElementListMixin.java | 62 + .../rdf/mixins/SubmodelElementMixin.java | 41 + .../dataformat/rdf/mixins/SubmodelMixin.java | 34 + .../dataformat/rdf/mixins/ValueListMixin.java | 37 + .../rdf/mixins/ValueReferencePairMixin.java | 39 + .../v3/dataformat/rdf/mixins/ViewMixin.java | 34 + .../rdf/preprocessing/BasePreprocessor.java | 54 + .../rdf/preprocessing/JsonPreprocessor.java | 43 + .../preprocessing/TypeNamePreprocessor.java | 195 +++ .../aas4j/v3/dataformat/rdf/ParserTest.java | 154 +++ .../v3/dataformat/rdf/SerializerTest.java | 101 ++ .../v3/dataformat/rdf/SerializerUtil.java | 46 + dataformat-rdf/src/test/resources/AASFull.ttl | 354 +++++ .../resources/AAS_Reference_shortExample.nt | 16 + .../resources/AAS_Reference_shortExample.ttl | 27 + .../AssetAdministrationShell_Example.ttl | 56 + .../src/test/resources/Complete_Example.ttl | 347 +++++ .../src/test/resources/Overall-Example.nt | 253 ++++ .../src/test/resources/ReferenceExample.ttl | 18 + .../Submodel_SubmodelElement_Example.ttl | 137 ++ .../Submodel_SubmodelElement_shortExample.nt | 25 + .../Submodel_SubmodelElement_shortExample.ttl | 42 + .../resources/example-from-serializer.jsonld | 88 ++ 87 files changed, 6632 insertions(+) create mode 100644 dataformat-rdf/pom.xml create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java create mode 100644 dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java create mode 100644 dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java create mode 100644 dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java create mode 100644 dataformat-rdf/src/test/resources/AASFull.ttl create mode 100644 dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt create mode 100644 dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl create mode 100644 dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl create mode 100644 dataformat-rdf/src/test/resources/Complete_Example.ttl create mode 100644 dataformat-rdf/src/test/resources/Overall-Example.nt create mode 100644 dataformat-rdf/src/test/resources/ReferenceExample.ttl create mode 100644 dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl create mode 100644 dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt create mode 100644 dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl create mode 100644 dataformat-rdf/src/test/resources/example-from-serializer.jsonld diff --git a/dataformat-rdf/pom.xml b/dataformat-rdf/pom.xml new file mode 100644 index 000000000..8d65df6de --- /dev/null +++ b/dataformat-rdf/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + org.eclipse.digitaltwin.aas4j + dataformat-parent + ${revision} + + dataformat-rdf + Asset Administration Shell RDF-Serializer + + + + ${groupId} + dataformat-core + ${revision} + + + ${groupId} + dataformat-core + ${revision} + tests + test + + + org.apache.jena + jena-arq + ${jena.version} + + + org.slf4j + slf4j-simple + ${slf4j.version} + test + + + pl.pragmatists + JUnitParams + ${junit-params.version} + test + + + diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java new file mode 100644 index 000000000..b787d56a2 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +import java.io.IOException; +import java.util.Map; + +public class FallbackSerializer extends StdSerializer> { + + + public FallbackSerializer() { + this(null); + } + + public FallbackSerializer(Class clazz) { + super(clazz); + } + + + @Override + public void serialize(Map value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeString(value.toString()); + } + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java new file mode 100644 index 000000000..4e42f6851 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import com.fasterxml.jackson.annotation.JsonIgnoreType; + +@JsonIgnoreType +public class IgnoreTypeMixIn { +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java new file mode 100644 index 000000000..3e0b3699e --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import com.fasterxml.jackson.databind.module.SimpleModule; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.BigDecimalSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.XMLGregorianCalendarDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.XMLGregorianCalendarSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +import java.math.BigDecimal; +import java.net.URI; +import java.util.Map; + + +import javax.xml.datatype.XMLGregorianCalendar; + + +/** + * Jackson module which provides support for JSON-LD serialization + */ +public class JsonLDModule extends SimpleModule { + + + public JsonLDModule(Map idMap) { + super(); + + setSerializerModifier(new JsonLDSerializerModifier(idMap)); + + addSerializer(XMLGregorianCalendar.class, new XMLGregorianCalendarSerializer()); + addDeserializer(XMLGregorianCalendar.class, new XMLGregorianCalendarDeserializer()); + addSerializer(BigDecimal.class, new BigDecimalSerializer()); + + addSerializer(URI.class, new UriSerializer()); + addSerializer(LangString.class, new LangStringSerializer()); + } + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java new file mode 100644 index 000000000..d59ef814d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.WritableTypeId; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.jsontype.TypeSerializer; +import com.fasterxml.jackson.databind.ser.BeanSerializer; +import com.fasterxml.jackson.databind.ser.std.BeanSerializerBase; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.math.BigInteger; +import java.util.*; +import java.util.stream.Stream; + + +public class JsonLDSerializer extends BeanSerializer { + + private final Logger logger = LoggerFactory.getLogger(JsonLDSerializer.class); + + private static int currentRecursionDepth = 0; + + static final Map contextItems = new HashMap<>(); + + private final Map idMap; + + JsonLDSerializer(BeanSerializerBase src, Map idMap) { + super(src); + this.idMap = Objects.requireNonNullElseGet(idMap, HashMap::new); + } + + + + @Override + public void serializeWithType(Object bean, JsonGenerator gen, SerializerProvider provider, TypeSerializer typeSer) throws IOException { + gen.setCurrentValue(bean); + + currentRecursionDepth++; + gen.writeStartObject(); + + if (currentRecursionDepth == 1) { + Map filteredContext = new HashMap<>(); + filterContextWrtBean(bean, filteredContext); + gen.writeObjectField("@context", filteredContext); + //gen.writeStringField("@context", "https://jira.iais.fraunhofer.de/stash/projects/ICTSL/repos/ids-infomodel-commons/raw/jsonld-context/3.0.0/context.jsonld"); // only add @context on top level + + } + + if(idMap.containsKey(bean)) + { + gen.writeStringField("@id", idMap.get(bean)); + } + else + { + String randomUri = "https://admin-shell.io/autogen/" + bean.getClass().getSimpleName() + "/" + UUID.randomUUID(); + idMap.put(bean, randomUri); + gen.writeStringField("@id", randomUri); + } + + WritableTypeId typeIdDef = _typeIdDef(typeSer, bean, JsonToken.START_OBJECT); + String resolvedTypeId = typeIdDef.id != null ? typeIdDef.id.toString() : typeSer.getTypeIdResolver().idFromValue(bean); + if (resolvedTypeId != null) { + gen.writeStringField(typeIdDef.asProperty, resolvedTypeId); + } + if (_propertyFilterId != null) { + serializeFieldsFiltered(bean, gen, provider); + } else { + serializeFields(bean, gen, provider); + } + gen.writeEndObject(); + currentRecursionDepth--; + } + + + private void filterContextWrtBean(Object bean, Map filteredContext) { + //Some default entries for AAS + filteredContext.put("aas", "https://admin-shell.io/aas/3/0/RC02/"); + //filteredContext.put("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/"); + //filteredContext.put("phys_unit", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/"); + + if(bean == null || bean.getClass().getName().equals("com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl") || bean.getClass().getName().equals("org.apache.jena.ext.xerces.jaxp.datatype.XMLGregorianCalendarImpl") || bean.getClass() == BigInteger.class) return; // XMLGregorianCalendarImpl causes infinite recursion + + //Check if RdfResource or TypedLiteral is used. They contain a field called "type" which can reference to any namespace + //Therefore it is vital to also check the value of the type field for prefixes that need to be included in the context + if(bean.getClass().getSimpleName().equals("LangString")) + { + //LangString is of type rdf:langString, so this must be present + filteredContext.put("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); + } + contextItems.forEach((p, u) -> { + JsonTypeName typeNameAnnotation = bean.getClass().getAnnotation(JsonTypeName.class); + if(typeNameAnnotation != null && typeNameAnnotation.value().contains(p)) { + filteredContext.put(p, u); + } + Stream.of(bean.getClass().getMethods()).forEach(m -> { + JsonProperty propertyAnnotation = m.getAnnotation(JsonProperty.class); + if(propertyAnnotation != null && propertyAnnotation.value().contains(p)) { + filteredContext.put(p, u); + } + }); + }); + Stream.of(bean.getClass().getMethods()).forEach(m -> { + // run though all properties and check annotations. These annotations should contain the prefixes + JsonProperty prop = m.getAnnotation(JsonProperty.class); + if(prop != null) + { + for(Map.Entry entry : contextItems.entrySet()) + { + if(prop.value().startsWith(entry.getKey())) + { + filteredContext.put(entry.getKey(), entry.getValue()); + break; + } + } + } + }); + // run through fields recursively + for(Field f : getAllFields(new HashSet<>(), bean.getClass())) { + + if(Collection.class.isAssignableFrom(f.getType())) + { + try { + if(f.getType().getName().startsWith("java.") && !f.getType().getName().startsWith("java.util")) continue; + boolean accessible = f.isAccessible(); + f.setAccessible(true); + Collection c = (Collection) f.get(bean); + if(c == null) { + continue; + } + for(Object o : c) + { + filterContextWrtBean(o, filteredContext); + } + f.setAccessible(accessible); + } + catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + + if (f.getType().isPrimitive() || f.getType().isEnum() || f.getType().isArray() + || f.getType().getName().contains("java.") + || f.getType().getName().contains("javax.")) continue; + + try { + boolean wasAccessible = f.isAccessible(); + f.setAccessible(true); + filterContextWrtBean(f.get(bean), filteredContext); + f.setAccessible(wasAccessible); + } catch (IllegalAccessException ignored) { + //logger.error("setting accessible failed"); //We can catch that here, as IllegalReflectiveAccess cannot occur on our own packages + } + + //f.trySetAccessible(wasAccessible); + + } + + } + + /** + * This function retrieves a set of all available fields of a class, including inherited fields + * @param fields Set to which discovered fields will be added. An empty HashSet should do the trick + * @param type The class for which fields should be discovered + * @return set of all available fields + */ + private static Set getAllFields(Set fields, Class type) { + fields.addAll(Arrays.asList(type.getDeclaredFields())); + + if (type.getSuperclass() != null) { + getAllFields(fields, type.getSuperclass()); + } + + return fields; + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java new file mode 100644 index 000000000..d998ac5c9 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + + +import com.fasterxml.jackson.databind.BeanDescription; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializationConfig; +import com.fasterxml.jackson.databind.ser.BeanSerializerModifier; +import com.fasterxml.jackson.databind.ser.std.BeanSerializerBase; + +import java.util.Map; + + +public class JsonLDSerializerModifier extends BeanSerializerModifier { + + private final Map idMap; + + public JsonLDSerializerModifier(Map idMap) { + this.idMap = idMap; + } + + @Override + public JsonSerializer modifySerializer(SerializationConfig config, BeanDescription beanDesc, JsonSerializer serializer) { + if (serializer instanceof BeanSerializerBase) { + return new JsonLDSerializer((BeanSerializerBase) serializer, idMap); + } else { + return serializer; + } + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java new file mode 100644 index 000000000..bbcf27772 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + +import java.io.IOException; + +public class JsonLdEnumSerializer extends JsonSerializer> { + + + @Override + public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { + //Generated Enum classes of the admin shell have @IRI annotations, which need to be used to provide proper RDF + if(value.getClass().isEnum() && value.getClass().getName().startsWith("org.eclipse.digitaltwin.aas4j.")) + { + //Try to get annotation value to get the IRI used in the ontology + if(value.getClass().getAnnotation(IRI.class) != null && value.getClass().getAnnotation(IRI.class).value().length > 0) + { + gen.writeStartObject(); + gen.writeStringField("@type", value.getClass().getAnnotation(IRI.class).value()[0]); + + //Try to extract exact IRI of the enum value, if present + try { + var annotation = value.getClass().getField(value.name()).getAnnotation(IRI.class); + if(annotation != null && annotation.value().length > 0) + { + gen.writeStringField("@id", annotation.value()[0]); + } + else + { + //Didn't find an @IRI annotation - fall back to using class annotation + field name + gen.writeStringField("@id", translate(value.getClass(), value.name())); + } + } + //Should be impossible + catch (NoSuchFieldException e) + { + //Didn't find an @IRI annotation - fall back to using class annotation + field name + gen.writeStringField("@id", translate(value.getClass(), value.name())); + } + gen.writeEndObject(); + } + else + { + gen.writeString(translate(value.getClass(), value.name())); + } + + + } else { + provider.findValueSerializer(Enum.class).serialize(value, gen, provider); + } + } + + + + public static String translate(Class enumClass, String input) { + String[] iriValues = enumClass.getAnnotation(IRI.class).value(); + String result = ""; + if(iriValues.length > 0) + { + result = iriValues[0]; + if(!result.endsWith("/")) + { + result += "/"; + } + } + result += input; + return result; + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java new file mode 100644 index 000000000..53a03bb85 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import java.io.IOException; + + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +public class LangStringSerializer extends StdSerializer { + + + public LangStringSerializer() { + this(null); + } + + public LangStringSerializer(Class clazz) { + super(clazz); + } + + + @Override + public void serialize(LangString value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeStartObject(); + if(value.getLanguage() != null && !value.getLanguage().isEmpty()) + { + gen.writeStringField("@language", value.getLanguage()); + } + else + { + gen.writeStringField("@type", "rdf:langString"); + } + gen.writeStringField("@value", value.getText()); + gen.writeEndObject(); + } + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java new file mode 100644 index 000000000..80582d6b5 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java @@ -0,0 +1,1171 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangString; +import org.apache.jena.datatypes.DatatypeFormatException; +import org.apache.jena.query.*; +import org.apache.jena.rdf.model.*; +import org.apache.jena.riot.Lang; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.riot.RDFLanguages; +import org.apache.jena.riot.RiotException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.Duration; +import javax.xml.datatype.XMLGregorianCalendar; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.lang.reflect.*; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.ZonedDateTime; +import java.time.format.DateTimeParseException; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * Internal class to handle the parsing of JSON-LD into java objects + * @author maboeckmann + */ +class Parser { + + private final Logger logger = LoggerFactory.getLogger(Parser.class); + + private static final URI blankNodeIdPropertyUri = URI.create("https://admin-shell.io/aas/blankNodeId"); + + static Map knownNamespaces = new HashMap<>(); + + /** + * Main internal method for creating a java object from a given RDF graph and a URI of the object to handle + * @param inputModel Model on which queries are to be evaluated from which information can be retrieved + * @param objectUri URI of the object to be handled + * @param targetClass Variable containing the class which should be returned + * @param Class which should be returned + * @return Object of desired class, filled with the values extracted from inputModel + * @throws IOException thrown if the parsing fails + */ + private T handleObject(Model inputModel, String objectUri, Class targetClass) throws IOException { + try { + + //if(!targetClass.getSimpleName().endsWith("Impl")) //This would not work for "TypedLiteral", "RdfResource" and so on + //Check whether we are dealing with an instantiable class (i.e. no interface and no abstract class) + boolean currentObjectIsBlankNode = false; + if (targetClass.isInterface() || Modifier.isAbstract(targetClass.getModifiers())) { + //We don't know the desired class yet (current targetClass is not instantiable). This is only known for the root object + ArrayList> implementingClasses = getImplementingClasses(targetClass); + String queryString; + //Get a list of all "rdf:type" statements in our model + //In case of a blank node, the "object URI" will just be a string and no valid URI. In that case, we need a different query syntax + try { + new URL(objectUri); + } + catch (MalformedURLException e) + { + currentObjectIsBlankNode = true; + } + if(currentObjectIsBlankNode) + { + //Object is a blank node, so the subject URI cannot be used + queryString = "SELECT ?type { ?s <" + blankNodeIdPropertyUri + "> \"" + objectUri + "\" ; a ?type . }"; + } + else + { + //Not a blank node, so we can work with the subject URI + queryString = "SELECT ?type { BIND(<" + objectUri + "> AS ?s). ?s a ?type . }"; + } + Query query = QueryFactory.create(queryString); + QueryExecution queryExecution = QueryExecutionFactory.create(query, inputModel); + ResultSet resultSet = queryExecution.execSelect(); + + if (!resultSet.hasNext()) { + queryExecution.close(); + throw new IOException("Could not extract class of child object. ID: " + objectUri); + } + + //Class candidateClass = null; + + String fullName = "No triple present indicating type."; + while (resultSet.hasNext()) { + QuerySolution solution = resultSet.nextSolution(); + fullName = solution.get("type").toString(); + + //Expected URI is something like https://w3id.org/idsa/core/ClassName (and we want ClassName) + String className = fullName.substring(fullName.lastIndexOf('/') + 1); + + //Some namespaces use "#" instead of "/" + if (className.contains("#")) { + className = className.substring(className.lastIndexOf("#") + 1); + } + + for (Class currentClass : implementingClasses) { + //Is this class instantiable? + if (!currentClass.isInterface() && !Modifier.isAbstract(currentClass.getModifiers())) { + //candidateClass = currentClass; + if (currentClass.getSimpleName().equals(className) || currentClass.getSimpleName().equals(Serializer.implementingClassesNamePrefix + className + Serializer.implementingClassesNameSuffix)) { + targetClass = (Class) currentClass; + break; + } + } + } + } + queryExecution.close(); + //Did we find "the" class, i.e. instantiable and name matches? + if (targetClass.isInterface() || Modifier.isAbstract(targetClass.getModifiers())) { + //No, the current targetClass cannot be instantiated. Do we have a candidate class? + //if (candidateClass != null) { + throw new IOException("Did not find an instantiable class for " + objectUri + " matching expected class name (" + targetClass.getSimpleName() + "). Object has type: " + fullName); + //targetClass = (Class) candidateClass; + //} + } + } + + //Enums have no constructors + if(targetClass.isEnum()) + { + return handleEnum(targetClass, objectUri); + } + + //Get constructor (which is package private for our classes) and make it accessible + Constructor constructor = targetClass.getDeclaredConstructor(); + constructor.setAccessible(true); + + //Instantiate new object, which will be returned at the end + T returnObject = constructor.newInstance(); + + //Get methods + Method[] methods = returnObject.getClass().getDeclaredMethods(); + + //Store methods in map. Key is the name of the RDF property without ids prefix + Map methodMap = new HashMap<>(); + + //Get all relevant methods (setters, but not for label, comment or external properties) + Arrays.stream(methods).filter(method -> { + String name = method.getName(); + //Filter out irrelevant methods + return name.startsWith("set") && !name.equals("setProperty") && !name.equals("setComment") && !name.equals("setLabel"); // && !name.equals("setId"); + }).forEach(method -> { + //Remove "set" part + String reducedName = method.getName().substring(3); + + //Turn first character to lower case + char[] c = reducedName.toCharArray(); + c[0] = Character.toLowerCase(c[0]); + String finalName = new String(c); + methodMap.put(finalName, method); + + }); + + //There is no "setId" method in our CodeGen generated classes, so we get the field + /* TODO: No "id" field yet + Field idField = returnObject.getClass().getDeclaredField("id"); + + //Store whether or not it was accessible, so that we can undo making it accessible + boolean wasAccessible = idField.isAccessible(); + idField.setAccessible(true); + + //Set the ID of the object to be identical with the objectUri parameter + idField.set(returnObject, new URI(objectUri)); + idField.setAccessible(wasAccessible); + */ + + //Is this a trivial class with 0 fields? If so, the generated query would be "SELECT { }", which is illegal + if(methodMap.isEmpty()) + { + return returnObject; + } + + + //A list which stores all those parameter names which may occur only once (i.e. those occurring in the GROUP BY clause) + List groupByKeys = new ArrayList<>(); + + StringBuilder queryStringBuilder = new StringBuilder(); + + for(Map.Entry entry : knownNamespaces.entrySet()) + { + queryStringBuilder.append("PREFIX ").append(entry.getKey()); + if(!entry.getKey().endsWith(":")) + { + queryStringBuilder.append(":"); + } + queryStringBuilder.append(" <").append(entry.getValue()).append(">\n"); + } + queryStringBuilder.append("SELECT"); + methodMap.forEach((key1, value) -> { + //Is the return type some sort of List? + if (Collection.class.isAssignableFrom(value.getParameterTypes()[0])) { + boolean isTypedLiteral = false; + //Yes, it is assignable multiple times. Concatenate multiple values together using some delimiter + try { + //ArrayLists are generics. We need to extract the name of the generic parameter as string and interpret that + String typeName = extractTypeNameFromCollection(value.getGenericParameterTypes()[0]); + + if (typeName.endsWith("LangString")) + isTypedLiteral = true; + } catch (IOException e) { + e.printStackTrace(); + } + if (isTypedLiteral) { + queryStringBuilder.append(" (GROUP_CONCAT(CONCAT('\"',?").append(key1).append(",'\"@', lang(?").append(key1).append("));separator=\"||\") AS ?").append(key1).append("sLang) "); + } + queryStringBuilder.append(" (GROUP_CONCAT(?").append(key1).append(";separator=\"||\") AS ?").append(key1).append("s) "); + + //Additional case for blank nodes + queryStringBuilder.append(" (GROUP_CONCAT(?").append(key1).append("Blank;separator=\"||\") AS ?").append(key1).append("sBlank) "); + + + } else { + //No, it's not a list. No need to aggregate + queryStringBuilder.append(" ?").append(key1); + //We will have to GROUP BY this variable though... + groupByKeys.add(key1); + } + }); + //Start the "WHERE" part - Fuseki does not expect the "WHERE" keyword, but just an "{" + queryStringBuilder.append(" { "); + + //In case of blank nodes, we can't work with the subject URI + if(currentObjectIsBlankNode) + { + queryStringBuilder.append("?s <").append(blankNodeIdPropertyUri).append("> \"").append(objectUri).append("\" ;"); + } + else + { + queryStringBuilder.append(" <").append(objectUri).append(">"); + } + + //Make sure that the object is of the correct type + //This is particularly relevant in case of all fields being optional -- then one could simply parse a random object + queryStringBuilder.append(" a ").append(wrapIfUri(targetClass.getAnnotation(IRI.class).value()[0])).append(". "); + + for (Map.Entry entry : methodMap.entrySet()) { + //Is this a field which is annotated by NOT NULL? + //Attempt to find a field matching the setter method name + //E.g. for "setSomething", we search for a field with name "_something" (IDS way) and "something" + Field field = getFieldByName(targetClass, entry.getKey()); + + + //In AAS, every field is optional, as there are no validation annotations in the model + queryStringBuilder.append(" OPTIONAL {"); + + if(currentObjectIsBlankNode) + { + queryStringBuilder.append(" ?s "); + } + else { + queryStringBuilder.append(" <").append(objectUri).append("> "); //subject, as passed to the function + } + //For the field, get the JsonAlias annotation (present for all classes generated by the CodeGen tool) + //Find the annotation value containing a colon and interpret this as "prefix:predicate" + boolean foundAnnotation = false; + if(field.getAnnotation(IRI.class) != null) { + Optional currentAnnotation = Arrays.stream(field.getAnnotation(IRI.class).value()).map(this::wrapIfUri).filter(annotation -> annotation.contains(":")).findFirst(); + currentAnnotation.ifPresent(queryStringBuilder::append); + foundAnnotation = true; + } + if(!foundAnnotation) + { + logger.warn("Failed to retrieve JsonAlias for field " + field + ". Assuming aas:" + entry.getKey()); + queryStringBuilder.append("aas:").append(entry.getKey()); + } + //if(isBlank(?entry.getKey(), use value of artificial, use original value) + queryStringBuilder.append(" ?").append(entry.getKey()).append(" ."); //object + + //In case of the object being a blank node, we construct a second result variable with the blank node id + queryStringBuilder.append("OPTIONAL { ?").append(entry.getKey()).append(" <").append(blankNodeIdPropertyUri).append("> ?").append(entry.getKey()).append("Blank . } "); + + queryStringBuilder.append("} "); + } + + + queryStringBuilder.append(" } "); + + //Do we need to group? We do, if there is at least one property which can occur multiple times + //We added all those properties, which may only occur once, to the groupByKeys list + if (!groupByKeys.isEmpty()) { + queryStringBuilder.append("GROUP BY"); + for (String key : groupByKeys) { + queryStringBuilder.append(" ?").append(key); + } + } + + String queryString = queryStringBuilder.toString(); + + StringBuilder queryForOtherProperties = new StringBuilder(); + //Query for all unknown properties and their values + //Select properties and values only + + if(!targetClass.equals(LangString.class)) { //LangString has no additional properties map. Skip this step + + //CONSTRUCT { ?s ?p ?o } { ?s ?p ?o. FILTER(?p NOT IN (list of ids properties)) } + for (Map.Entry entry : knownNamespaces.entrySet()) { + queryForOtherProperties.append("PREFIX ").append(entry.getKey()); + if (!entry.getKey().endsWith(":")) { + queryForOtherProperties.append(":"); + } + queryForOtherProperties.append(" <").append(entry.getValue()).append(">\n"); + } + + + //Respect ALL properties and values + queryForOtherProperties.append(" SELECT ?p ?o { <").append(objectUri).append("> ?p ?o .\n"); + + //Exclude known properties + queryForOtherProperties.append("FILTER (?p NOT IN (rdf:type"); + + //Predicates usually look like: .append("ids:").append(entry.getKey()) + for (Map.Entry entry : methodMap.entrySet()) { + queryForOtherProperties.append(", "); + + Field field = getFieldByName(targetClass, entry.getKey()); + Optional currentAnnotation = Arrays.stream(field.getAnnotation(IRI.class).value()).filter(annotation -> annotation.contains(":")).filter(s -> s.length() > 1).findFirst(); + if (currentAnnotation.isPresent()) { + queryForOtherProperties.append(wrapIfUri(currentAnnotation.get())); + } else { + logger.warn("Failed to retrieve JsonAlias for field " + field + ". Assuming aas:" + entry.getKey()); + queryForOtherProperties.append("aas:").append(entry.getKey()); + } + } + + queryForOtherProperties.append(")). } "); + + + //Now that we searched for all "known properties", let's search for all unrecognized content and append it to a generic properties map + + Query externalPropertiesQuery = QueryFactory.create(queryForOtherProperties.toString()); + QueryExecution externalPropertiesQueryExecution = QueryExecutionFactory.create(externalPropertiesQuery, inputModel); + ResultSet externalPropertiesResultSet = externalPropertiesQueryExecution.execSelect(); + + // now as all declared instances and classes are treated, which are also represented in the respective java + // dependency, take care about the ones within foreign namespaces and add those to the 'properties' field + // note that not all models (e.g. AAS) have such methods. In case they do not exist, skip adding external properties + + try { + Method setProperty = returnObject.getClass().getDeclaredMethod("setProperty", String.class, Object.class); + Method getProperties = returnObject.getClass().getDeclaredMethod("getProperties"); + + while (externalPropertiesResultSet.hasNext()) { + QuerySolution externalPropertySolution = externalPropertiesResultSet.next(); + + HashMap currentProperties = (HashMap) getProperties.invoke(returnObject); + + //Avoid NullPointerException + if (currentProperties == null) { + currentProperties = new HashMap<>(); + } + + String propertyUri = externalPropertySolution.get("p").toString(); + + //Does this key already exist? If yes, we need to store the value as array to not override them + if (currentProperties.containsKey(propertyUri)) { + //If it is not an array list yet, turn it into one + if (!(currentProperties.get(propertyUri) instanceof ArrayList)) { + ArrayList newList = new ArrayList<>(); + newList.add(currentProperties.get(propertyUri)); + currentProperties.put(propertyUri, newList); + } + } + + //Literals and complex objects need to be handled differently + //Literals can be treated as flat values, whereas complex objects require recursive calls + if (externalPropertySolution.get("o").isLiteral()) { + Object o = handleForeignLiteral(externalPropertySolution.getLiteral("o")); + //If it is already an ArrayList, add new value to it + if (currentProperties.containsKey(propertyUri)) { + ArrayList currentPropertyArray = ((ArrayList) currentProperties.get(propertyUri)); + currentPropertyArray.add(o); + setProperty.invoke(returnObject, propertyUri, currentPropertyArray); + } + //Otherwise save as new plain value + else { + setProperty.invoke(returnObject, propertyUri, o); + } + } else { + //It is a complex object. Distinguish whether or not we need to store as array + HashMap subMap = handleForeignNode(externalPropertySolution.getResource("o"), new HashMap<>(), inputModel); + subMap.put("@id", externalPropertySolution.getResource("o").getURI()); + if (currentProperties.containsKey(propertyUri)) { + ArrayList currentPropertyArray = ((ArrayList) currentProperties.get(propertyUri)); + currentPropertyArray.add(subMap); + setProperty.invoke(returnObject, propertyUri, currentPropertyArray); + } else { + setProperty.invoke(returnObject, propertyUri, subMap); + } + } + } + externalPropertiesQueryExecution.close(); + } + catch (NoSuchMethodException ignored) + { + //Method does not exist, skip + } + } + + + + Query query; + try { + query = QueryFactory.create(queryString); + } + catch (QueryParseException e) + { + logger.error(queryString); + throw e; + } + + //Evaluate query + QueryExecution queryExecution = QueryExecutionFactory.create(query, inputModel); + ResultSet resultSet = queryExecution.execSelect(); + + + if (!resultSet.hasNext()) { + queryExecution.close(); + //no content... + return returnObject; + } + + //SPARQL binding present, iterate over result and construct return object + while (resultSet.hasNext()) { + QuerySolution querySolution = resultSet.next(); + + //Check if there are fields which have more values than allowed + if (resultSet.hasNext()) { + String value1 = "", value2 = "", parameterName = ""; + QuerySolution querySolution2 = resultSet.next(); + Iterator varNamesIt = querySolution2.varNames(); + while(varNamesIt.hasNext()) + { + String varName = varNamesIt.next(); + if(querySolution.contains(varName)) + { + if(!querySolution.get(varName).equals(querySolution2.get(varName))) + { + parameterName = varName; + value1 = querySolution.get(varName).toString(); + value2 = querySolution2.get(varName).toString(); + break; + } + } + } + if(!value1.isEmpty()) + { + throw new IOException(objectUri + " has multiple values for " + parameterName + ", which is not allowed. Values are: " + value1 + " and " + value2); + } + throw new IOException("Multiple bindings for SPARQL query which should only have one binding. Input contains multiple values for a field which may occur only once."); + } + + //No value occurs more often than allowed + for (Map.Entry entry : methodMap.entrySet()) { + + //What is this method setting? Get the expected parameter type and check whether it is some complex sub-object and whether this is a list + Class currentType = entry.getValue().getParameterTypes()[0]; + + String sparqlParameterName = entry.getKey(); + + if (Collection.class.isAssignableFrom(currentType)) { + sparqlParameterName += "s"; //plural form for the concatenated values + } + if(!querySolution.contains(sparqlParameterName)) + { + sparqlParameterName += "Blank"; //If not present, try to go with the option for blank nodes instead + //TODO: Note: This would not yield full results yet in case some of the values are encapsulated + // in blank nodes and some are not, for the same property + } + if (querySolution.contains(sparqlParameterName)) { + String currentSparqlBinding = querySolution.get(sparqlParameterName).toString(); + + boolean objectIsBlankNode = querySolution.get(sparqlParameterName).isResource() && querySolution.get(sparqlParameterName).asNode().isBlank(); + String blankNodeId = ""; + //If the object is a blank node, we will struggle to make follow-up queries starting at the blank node as subject + //For that case, we add some artificial identifiers here + if(objectIsBlankNode) { + blankNodeId = querySolution.get(sparqlParameterName).asNode().getBlankNodeId().toString(); + } + if (currentType.isEnum()) { + //Two possibilities: + //1: The URI of the enum value is given directly e.g. ?s ?p + //2: The URI of the enum value is encapsulated in a blank node, e.g. + // ?s ?p [ a demo:myEnum, demo:enumValue ] + if(objectIsBlankNode) + { + + Query innerEnumQuery = QueryFactory.create("SELECT ?type { ?s <" + blankNodeIdPropertyUri + "> + \"" + blankNodeId + "\" ; a ?type } "); + QueryExecution innerEnumQueryExecution = QueryExecutionFactory.create(innerEnumQuery, inputModel); + ResultSet innerEnumQueryExecutionResultSet = innerEnumQueryExecution.execSelect(); + + //Only throw this if there is no successful execution + IOException anyIOException = null; + boolean oneSuccessfulEnumFound = false; + while(innerEnumQueryExecutionResultSet.hasNext()) + { + try { + entry.getValue().invoke(returnObject, handleEnum(currentType, innerEnumQueryExecutionResultSet.next().get("type").toString())); + oneSuccessfulEnumFound = true; + break; //Stop after the first successful execution + } + catch (IOException e) //There might be errors, if multiple types are present, see example above + { + anyIOException = e; + } + } + //If nothing worked, but something failed (i.e. there exists a problematic element, but no proper element), we throw an exception + if(anyIOException != null && !oneSuccessfulEnumFound) + throw new IOException("Could not parse Enum. ", anyIOException); + innerEnumQueryExecution.close(); + } + else { + entry.getValue().invoke(returnObject, handleEnum(currentType, currentSparqlBinding)); + } + continue; + } + + + //There is a binding. If it is a complex sub-object, we need to recursively call this function + if (Collection.class.isAssignableFrom(currentType)) { + //We are working with ArrayLists. + //Here, we need to work with the GenericParameterTypes instead to find out what kind of ArrayList we are dealing with + String typeName = extractTypeNameFromCollection(entry.getValue().getGenericParameterTypes()[0]); + if (isArrayListTypePrimitive(entry.getValue().getGenericParameterTypes()[0])) { + if (typeName.endsWith("LangString")) { + try { + currentSparqlBinding = querySolution.get(sparqlParameterName + "Lang").toString(); + } catch (NullPointerException e) { + //logger.warn("Failed to retrieve localized/typed values of " + currentSparqlBinding + ". Make sure that namespaces used in this property are known and valid. Proceeding without localized values and interpreting as string."); + //logger.warn("Query was: " + queryString); + //logger.warn("Attempted to fetch: " + sparqlParameterName + "Lang"); + } + } + ArrayList list = new ArrayList<>(); + //Two pipes were used as delimiter above + //Introduce set to deduplicate + Set allElements = new HashSet<>(Arrays.asList(currentSparqlBinding.split("\\|\\|"))); + for (String s : allElements) { + Literal literal; + //querySolution.get(sparqlParameterName). + if (s.endsWith("@")) { + s = s.substring(2, s.length() - 3); + literal = ResourceFactory.createStringLiteral(s); + } else if (s.startsWith("\\")) { + //turn something like \"my Desc 1\"@en to "my Desc 1"@en + s = s.substring(1).replace("\\\"@", "\"@"); + literal = ResourceFactory.createLangLiteral(s.substring(1, s.lastIndexOf("@") - 1), s.substring(s.lastIndexOf("@") + 1)); + } else { + literal = ResourceFactory.createPlainLiteral(s); + } + + //Is the type of the ArrayList some built in Java primitive? + + if (builtInMap.containsKey(typeName)) { + //Yes, it is. We MUST NOT call Class.forName(name)! + list.add(handlePrimitive(builtInMap.get(typeName), literal, null)); + } else { + //Not a Java primitive, we may call Class.forName(name) + list.add(handlePrimitive(Class.forName(typeName), literal, s)); + } + } + entry.getValue().invoke(returnObject, list); + } else { + //List of complex sub-objects, such as a list of Resources in a ResourceCatalog + ArrayList list = new ArrayList<>(); + Set allElements = new HashSet<>(Arrays.asList(currentSparqlBinding.split("\\|\\|"))); + for (String s : allElements) { + if (Class.forName(typeName).isEnum()) { + list.add(handleEnum(Class.forName(typeName), s)); + } else { + list.add(handleObject(inputModel, s, Class.forName(typeName))); + } + } + entry.getValue().invoke(returnObject, list); + } + } + + //Not an ArrayList of objects expected, but rather one object + else { + //Our implementation of checking for primitives (i.e. also includes URLs, Strings, XMLGregorianCalendars, ...) + if (isPrimitive(currentType)) { + + Literal literal = null; + try { + literal = querySolution.getLiteral(sparqlParameterName); + } catch (Exception ignored) { + } + + entry.getValue().invoke(returnObject, handlePrimitive(currentType, literal, currentSparqlBinding)); + + } else { + //Not a primitive object, but a complex sub-object. Recursively call this function to handle it + if (objectIsBlankNode) { + entry.getValue().invoke(returnObject, handleObject(inputModel, blankNodeId, entry.getValue().getParameterTypes()[0])); + } else { + + entry.getValue().invoke(returnObject, handleObject(inputModel, currentSparqlBinding, entry.getValue().getParameterTypes()[0])); + } + } + } + } + + } + } + queryExecution.close(); + + return returnObject; + } catch (NoSuchMethodException | NullPointerException | IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchFieldException | URISyntaxException | DatatypeConfigurationException | ClassNotFoundException e) { + throw new IOException("Failed to instantiate desired class (" + targetClass.getName() + ")", e); + } + } + + /** + * This function wraps a URI with "<" ">", if needed, to avoid errors about "unknown namespace http(s):" + * @param input Input URI, possibly a prefixed value + * @return If this is a full URI, starting with http or https, the URI will be encapsulated in "<" ">" + */ + private String wrapIfUri(String input) + { + if(input.startsWith("http://") || input.startsWith("https://")) + { + return "<" + input + ">"; + } + else { + return input; + } + } + + private Object handleForeignLiteral(Literal literal) throws URISyntaxException { + if(literal.getLanguage() != null && !literal.getLanguage().equals("")) + { + return new DefaultLangString.Builder().text(literal.getValue().toString()).language(literal.getLanguage()).build(); + } + //If not, does it have some datatype URI? + //else if(literal.getDatatypeURI() != null && !literal.getDatatypeURI().equals("")) + //{ + // return new TypedLiteral(literal.getString(), new URI(literal.getDatatypeURI())); + //} + //If both is not true, add it as normal string + else + { + return literal.getString(); + } + } + + private HashMap handleForeignNode(RDFNode node, HashMap map, Model model) throws IOException, URISyntaxException { + //Make sure it is not a literal. If it were, we would not know the property name and could not add this to the map + //Literals must be handled "one recursion step above" + if(node.isLiteral()) + { + throw new IOException("Literal passed to handleForeignNode. Must be non-literal RDF node"); + } + + //Run SPARQL query retrieving all information (only one hop!) about this node + String queryString = "SELECT ?s ?p ?o { BIND(<" + node.asNode().getURI() + "> AS ?s) . ?s ?p ?o . } "; + Query query = QueryFactory.create(queryString); + QueryExecution queryExecution = QueryExecutionFactory.create(query, model); + ResultSet resultSet = queryExecution.execSelect(); + + + + //Handle outgoing properties of this foreign node + while(resultSet.hasNext()) + { + QuerySolution querySolution = resultSet.next(); + + String propertyUri = querySolution.get("p").toString(); + + if(map.containsKey(propertyUri)) { + //If it is not an array list yet, turn it into one + if (!(map.get(propertyUri) instanceof ArrayList)) { + ArrayList newList = new ArrayList<>(); + newList.add(map.get(propertyUri)); + map.put(propertyUri, newList); + } + } + + //Check the type of object we have. If it is a literal, just add it as "flat value" to the map + if(querySolution.get("o").isLiteral()) + { + //Handle some small literal. This function will turn this into a TypedLiteral if appropriate + Object o = handleForeignLiteral(querySolution.getLiteral("o")); + if(map.containsKey(propertyUri)) + { + map.put(querySolution.get("p").toString(), ((ArrayList)map.get(propertyUri)).add(o)); + } + else + { + map.put(querySolution.get("p").toString(), o); + } + } + + //If it is not a literal, we need to call this function recursively. Create new map for sub object + else + { + //logger.info("Calling handleForeignNode for " + querySolution.getResource("o").toString()); + if(querySolution.getResource("s").toString().equals(querySolution.getResource("o").toString())) + { + logger.warn("Found self-reference on " + querySolution.getResource("s").toString() + " via predicate " + querySolution.getResource("p").toString() + " ."); + continue; + } + HashMap subMap = handleForeignNode(querySolution.getResource("o"), new HashMap<>(), model); + subMap.put("@id", querySolution.getResource("o").getURI()); + if(map.containsKey(propertyUri)) + { + map.put(querySolution.get("p").toString(), ((ArrayList)map.get(propertyUri)).add(subMap)); + } + else { + map.put(querySolution.get("p").toString(), subMap); + } + } + } + queryExecution.close(); + return map; + } + + + /** + * Utility function, used to obtain the field corresponding to a setter function + * @param targetClass Class object in which we search for a field + * @param fieldName Guessed name of the field to search for + * @return Field object matching the name (possibly with leading underscore) + * @throws NoSuchFieldException thrown, if no such field exists + */ + private Field getFieldByName(Class targetClass, String fieldName) throws NoSuchFieldException { + try { + return targetClass.getDeclaredField("_" + fieldName); + } catch (NoSuchFieldException e) { + try { + return targetClass.getDeclaredField(fieldName); + } catch (NoSuchFieldException e2) { + try { + return targetClass.getDeclaredField("_" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1)); + } + catch (NoSuchFieldException e3) + { + throw new NoSuchFieldException("Failed to find field which is set by method " + fieldName); + } + } + } + } + + /** + * Internal function to create a single enum object from a given desired class and a URL + * @param enumClass The enum class + * @param url The URL of the enum value + * @param Enum class + * @return Value of enumClass matching the input URL + * @throws IOException thrown if no matching enum value could be found + */ + private T handleEnum(Class enumClass, String url) throws IOException { + if (!enumClass.isEnum()) { + throw new RuntimeException("Non-Enum class passed to handleEnum function."); + } + T[] constants = enumClass.getEnumConstants(); + if(url.contains("/")) + { + url = url.substring(url.lastIndexOf("/") + 1); + } + for (T constant : constants) { + //We artificially added some underscores in the AAS ontology. TODO: This might be a bit dangerous for other ontologies, which really contain underscores in enum names + if (url.equalsIgnoreCase(constant.toString()) || url.equalsIgnoreCase(constant.toString().replace("_", ""))) { + return constant; + } + } + throw new IOException("Failed to find matching enum value for " + url + " . Available enums are: " + Arrays.stream(constants).map(Object::toString).collect(Collectors.joining(", "))); + } + + /** + * Function for handling a rather primitive object, i.e. not a complex sub-object (e.g. URI, TypedLiteral, GregorianCalendar values, ...) + * @param currentType Input Class (or primitive) + * @param literal Value as literal (can be null in some cases) + * @param currentSparqlBinding Value as SPARQL Binding (can be null in some cases) + * @return Object of type currentType + * @throws URISyntaxException thrown, if currentType is URI, but the value cannot be parsed to a URI + * @throws DatatypeConfigurationException thrown, if currentType is XMLGregorianCalendar or Duration, but parsing fails + * @throws IOException thrown, if no matching "simple class" could be found + */ + private Object handlePrimitive(Class currentType, Literal literal, String currentSparqlBinding) throws URISyntaxException, DatatypeConfigurationException, IOException { + //Java way of checking for primitives, i.e. int, char, float, double, ... + if (currentType.isPrimitive()) { + if (literal == null) { + throw new IOException("Trying to handle Java primitive, but got no literal value"); + } + //If it is an actual primitive, there is no need to instantiate anything. Just give it to the function + switch (currentType.getSimpleName()) { + case "int": + return literal.getInt(); + case "boolean": + return literal.getBoolean(); + case "long": + return literal.getLong(); + case "short": + return literal.getShort(); + case "float": + return literal.getFloat(); + case "double": + return literal.getDouble(); + case "byte": + return literal.getByte(); + } + } + + //Check for the more complex literals + + //URI + if (URI.class.isAssignableFrom(currentType)) { + return new URI(currentSparqlBinding); + } + + //String + if (String.class.isAssignableFrom(currentType)) { + return currentSparqlBinding; + } + + //XMLGregorianCalendar + if (XMLGregorianCalendar.class.isAssignableFrom(currentType)) { + //Try parsing this as dateTimeStamp (most specific). If seconds / timezone is missing, DatatypeFormatException will be thrown + try { + return DatatypeFactory.newInstance().newXMLGregorianCalendar(GregorianCalendar.from(ZonedDateTime.parse(literal.getValue().toString()))); + } + catch (DatatypeFormatException | DateTimeParseException ignored) + { + //Not a valid dateTimeStamp. Try parsing just to Date + try { + Date date = new SimpleDateFormat().parse(literal.getValue().toString()); + GregorianCalendar calendar = new GregorianCalendar(); + calendar.setTime(date); + return DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar); + } + catch (ParseException | DateTimeParseException | DatatypeFormatException e2) + { + //Do NOT use literal.getValue(), as that can already cause yet another DatatypeFormatException + throw new IOException("Could not turn " + literal.getString() + " into " + literal.getDatatypeURI(), e2); + } + } + } + + //TypedLiteral + if (LangString.class.isAssignableFrom(currentType)) { + //Either a language tagged string OR literal with type. Only one allowed + if (!literal.getLanguage().equals("")) { + return new DefaultLangString.Builder().text(literal.getValue().toString()).language(literal.getLanguage()).build(); + } + return new DefaultLangString.Builder().text(currentSparqlBinding).language("en-us").build(); // TODO: find a better language tag + } + + //BigInteger + if (BigInteger.class.isAssignableFrom(currentType)) { + return new BigInteger(literal.getString()); + } + + //BigDecimal + if (BigDecimal.class.isAssignableFrom(currentType)) { + return new BigDecimal(literal.getString()); + } + + //byte[] + if (byte[].class.isAssignableFrom(currentType)) { + return currentSparqlBinding.getBytes(); + } + + //Duration + if (Duration.class.isAssignableFrom(currentType)) { + return DatatypeFactory.newInstance().newDuration(currentSparqlBinding); + } + + throw new IOException("Unrecognized primitive type: " + currentType.getName()); + } + + /** + * This list contains all primitive Java types + */ + private final Map> builtInMap = new HashMap<>(); + { + builtInMap.put("int", Integer.TYPE); + builtInMap.put("long", Long.TYPE); + builtInMap.put("double", Double.TYPE); + builtInMap.put("float", Float.TYPE); + builtInMap.put("bool", Boolean.TYPE); + builtInMap.put("char", Character.TYPE); + builtInMap.put("byte", Byte.TYPE); + builtInMap.put("void", Void.TYPE); + builtInMap.put("short", Short.TYPE); + } + + private boolean isArrayListTypePrimitive(Type t) throws IOException { + String typeName = extractTypeNameFromCollection(t); + + try { + //Do not try to call Class.forName(primitive) -- that would throw an exception + if (builtInMap.containsKey(typeName)) return true; + return isPrimitive(Class.forName(typeName)); + } catch (ClassNotFoundException e) { + throw new IOException("Unable to retrieve class from generic", e); + } + } + + private String extractTypeNameFromCollection(Type t) throws IOException { + String typeName = t.getTypeName(); + if (!typeName.startsWith("java.util.ArrayList<") && !typeName.startsWith("java.util.List<") && !typeName.startsWith("java.util.Collection<")) { + throw new IOException("Illegal argument encountered while interpreting type parameter"); + } + //"" or super instead of extends + if(typeName.contains("?")) + { + //last space is where we want to cut off (right after the "extends"), as well as removing the last closing braces + return typeName.substring(typeName.lastIndexOf(" ") + 1, typeName.length() - 1); + } + //No extends + else + { + return typeName.substring(typeName.indexOf("<") + 1, typeName.indexOf(">")); + } + } + + private boolean isPrimitive(Class input) throws IOException { + //Collections are not simple + if (Collection.class.isAssignableFrom(input)) { + throw new IOException("Encountered collection in isPrimitive. Use isArrayListTypePrimitive instead"); + } + + //check for: plain/typed literal, XMLGregorianCalendar, byte[], RdfResource + //covers int, long, short, float, double, boolean, byte + if (input.isPrimitive()) return true; + + return (URI.class.isAssignableFrom(input) || + String.class.isAssignableFrom(input) || + XMLGregorianCalendar.class.isAssignableFrom(input) || + LangString.class.isAssignableFrom(input) || + BigInteger.class.isAssignableFrom(input) || + BigDecimal.class.isAssignableFrom(input) || + byte[].class.isAssignableFrom(input) || + Duration.class.isAssignableFrom(input)); + } + + /** + * Entry point to this class. Takes an RDF Model and a desired target class (can be an interface) + * @param rdfModel RDF input to be parsed + * @param targetClass Desired target class (something as abstract as "Message.class" is allowed) + * @param Desired target class + * @return Object of desired target class, representing the values contained in input message + * @throws IOException if the parsing of the message fails + */ + T parseMessage(Model rdfModel, Class targetClass) throws IOException { + addArtificialBlankNodeLabels(rdfModel); + ArrayList> implementingClasses = getImplementingClasses(targetClass); + + // Query to retrieve all instances in the input graph that have a class assignment + // Assumption: if the class name (?type) is equal to the target class, this should be the + // instance we actually want to parse + String queryString = "SELECT ?id ?type { ?id a ?type . }"; + Query query = QueryFactory.create(queryString); + QueryExecution queryExecution = QueryExecutionFactory.create(query, rdfModel); + ResultSet resultSet = queryExecution.execSelect(); + + if (!resultSet.hasNext()) { + throw new IOException("Could not extract class from input message"); + } + + Map> returnCandidates = new HashMap<>(); + + while (resultSet.hasNext()) { + QuerySolution solution = resultSet.nextSolution(); + String fullName = solution.get("type").toString(); + String className = fullName.substring(fullName.lastIndexOf('/') + 1); + + //In case of hash-namespaces + if(className.contains("#")) { + className = className.substring(className.lastIndexOf("#")); + } + + //For legacy purposes... + if (className.startsWith("ids:") || className.startsWith("aas:")) { + className = className.substring(4); + } + + for (Class currentClass : implementingClasses) { + if (currentClass.getSimpleName().equals(Serializer.implementingClassesNamePrefix + className + Serializer.implementingClassesNameSuffix)) { + returnCandidates.put(solution.get("id").toString(), currentClass); + } + } + //if (returnCandidates.size() > 0) break; + } + queryExecution.close(); + + if (returnCandidates.size() == 0) { + throw new IOException("Could not transform input to an appropriate implementing class for " + targetClass.getName()); + } + + //At this point, we parsed the model and know to which implementing class we want to parse + //Check if there are several options available + if(returnCandidates.size() > 1) + { + String bestCandidateId = null; + Class bestCandidateClass = null; + long bestNumRelations = -1L; + for(Map.Entry> entry : returnCandidates.entrySet()) + { + String determineBestCandidateQueryString = "CONSTRUCT { ?s ?p ?o . ?o ?p2 ?o2 . ?o2 ?p3 ?o3 . ?o3 ?p4 ?o4 . ?o4 ?p5 ?o5 . }" + + " WHERE {" + + " BIND(<" + entry.getKey() + "> AS ?s). ?s ?p ?o ." + + " OPTIONAL {?o ?p2 ?o2 . OPTIONAL {?o2 ?p3 ?o3 . OPTIONAL {?o3 ?p4 ?o4 . OPTIONAL {?o4 ?p5 ?o5 . } } } } }"; + Query determineBestCandidateQuery = QueryFactory.create(determineBestCandidateQueryString); + QueryExecution determineBestCandidateQueryExecution = QueryExecutionFactory.create(determineBestCandidateQuery, rdfModel); + long graphSize = determineBestCandidateQueryExecution.execConstruct().size(); + if(graphSize > bestNumRelations) + { + bestNumRelations = graphSize; + bestCandidateId = entry.getKey(); + bestCandidateClass = entry.getValue(); + } + + determineBestCandidateQueryExecution.close(); + + } + logger.debug("The RDF graph contains multiple objects which can be parsed to " + targetClass.getSimpleName() + ". Determined " + bestCandidateId + " as best candidate."); + return (T) handleObject(rdfModel, bestCandidateId, bestCandidateClass); + } + + //We only reach this spot, if there is exactly one return candidate. Let's return it + Map.Entry> singularEntry = returnCandidates.entrySet().iterator().next(); + return (T) handleObject(rdfModel, singularEntry.getKey(), singularEntry.getValue()); + + } + + + /** + * Entry point to this class. Takes a message and a desired target class (can be an interface) + * @param message Object to be parsed. Note that the name is misleading: One can also parse non-message IDS objects with this function + * @param targetClass Desired target class (something as abstract as "Message.class" is allowed) + * @param Desired target class + * @return Object of desired target class, representing the values contained in input message + * @throws IOException if the parsing of the message fails + */ + T parseMessage(String message, Class targetClass) throws IOException { + Model model = readMessage(message); + return parseMessage(model, targetClass); + } + + /** + * Entry point to this class. Takes a message and a desired target class (can be an interface) + * @param message Object to be parsed. Note that the name is misleading: One can also parse non-message IDS objects with this function + * @param targetClass Desired target class (something as abstract as "Message.class" is allowed) + * @param serializationFormat Input RDF format + * @param Desired target class + * @return Object of desired target class, representing the values contained in input message + * @throws IOException if the parsing of the message fails + */ + T parseMessage(String message, Class targetClass, Lang serializationFormat) throws IOException { + Model model = readMessage(message, serializationFormat); + return parseMessage(model, targetClass); + } + + /** + * Reads a message into an Apache Jena model, guessing the input language. + * Note: Guessing the language may cause some error messages during parsing attempts + * + * @param message Message to be read + * @return The model of the message + */ + private Model readMessage(String message) throws IOException { + + List supportedLanguages = new ArrayList<>( + Arrays.asList( + RDFLanguages.JSONLD, //JSON-LD first + RDFLanguages.TURTLE, //N-TRIPLE is a subset of Turtle + RDFLanguages.RDFXML + )); + + for (Lang lang : supportedLanguages) { + try { + return readMessage(message, lang); + } catch (IOException ignored) { + } + } + throw new IOException("Could not parse string as any supported RDF format (JSON-LD, Turtle/N-Triple, RDF-XML)."); + } + + /** + * Reads a message into an Apache Jena model, guessing the input language. + * Note: Guessing the language may cause some error messages during parsing attempts + * + * @param message Message to be read + * @param language The RDF serialization of the input. Supported formats are JSON-LD, N-Triple, Turtle, and RDF-XML + * @return The model of the message + */ + private Model readMessage(String message, Lang language) throws IOException { + + Model targetModel = ModelFactory.createDefaultModel(); + + try { + RDFDataMgr.read(targetModel, new ByteArrayInputStream(message.getBytes()), language); + } + catch (RiotException e) + { + throw new IOException("Failed to parse input as " + language, e); + } + return targetModel; + } + + /** + * Get a list of all subclasses (by JsonSubTypes annotation) which can be instantiated + * @param someClass Input class of which implementable subclasses need to be found + * @return ArrayList of instantiable subclasses + */ + ArrayList> getImplementingClasses(Class someClass) { + ArrayList> result = new ArrayList<>(); + KnownSubtypes subTypeAnnotation = someClass.getAnnotation(KnownSubtypes.class); + if (subTypeAnnotation != null) { + KnownSubtypes.Type[] types = subTypeAnnotation.value(); + for (KnownSubtypes.Type type : types) { + result.addAll(getImplementingClasses(type.value())); + } + } + if (!someClass.isInterface() && !Modifier.isAbstract(someClass.getModifiers())) { + result.add(Serializer.customImplementationMap.getOrDefault(someClass, someClass)); + } + return result; + } + + private void addArtificialBlankNodeLabels(Model m) + { + //Get all blank nodes + Query q = QueryFactory.create("SELECT DISTINCT ?s { ?s ?p ?o . FILTER(isBlank(?s)) } "); + QueryExecution qe = QueryExecutionFactory.create(q, m); + ResultSet rs = qe.execSelect(); + List statementsToAdd = new ArrayList<>(); + while(rs.hasNext()) + { + QuerySolution qs = rs.next(); + statementsToAdd.add(ResourceFactory.createStatement(qs.get("?s").asResource(), + ResourceFactory.createProperty(blankNodeIdPropertyUri.toString()), + ResourceFactory.createStringLiteral(qs.get("?s").toString()))); + } + qe.close(); + m.add(statementsToAdd); + } + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java new file mode 100644 index 000000000..ebdf6c1cc --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing.JsonPreprocessor; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing.TypeNamePreprocessor; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.ReflectiveMixInResolver; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.riot.Lang; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.riot.RDFLanguages; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.*; + +public class Serializer implements org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer, Deserializer { + + private static final ObjectMapper mapper = new ObjectMapper(); + private final List preprocessors; + private final Logger logger = LoggerFactory.getLogger(Serializer.class); + + public static String implementingClassesNamePrefix = "Default"; + public static String implementingClassesNameSuffix = ""; + + static Map, Class> customImplementationMap = new HashMap<>(); + + private static boolean charsetWarningPrinted = false; + + public Serializer() { + mapper.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL); + mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + mapper.setMixInResolver(new ReflectiveMixInResolver()); + + preprocessors = new ArrayList<>(); + this.addPreprocessor(new TypeNamePreprocessor()); + + if(!Charset.defaultCharset().equals(StandardCharsets.UTF_8) && !charsetWarningPrinted) + { + charsetWarningPrinted = true; + logger.warn("Standard Charset is set to " + Charset.defaultCharset() + " - expecting " + StandardCharsets.UTF_8 + ". Some characters might not be displayed correctly.\nThis warning is only printed once"); + } + + //Default namespaces for AAS + addKnownNamespace("xsd", "http://www.w3.org/2001/XMLSchema#"); + addKnownNamespace("owl", "http://www.w3.org/2002/07/owl#"); + addKnownNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); + addKnownNamespace("aas", "https://admin-shell.io/aas/3/0/RC02/"); + //addKnownNamespace("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/"); + //addKnownNamespace("phys_unit", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/"); + + } + + /** + * Serializes an object to an RDF representation. In order to support RDF, the input instance must be + * annotated using AAS Metamodel annotations. Default format is Turtle (TTL). + * + * @param instance the instance to be serialized + * @return RDF serialization of the provided object graph + * @throws IOException if the serialization fails + */ + public String serialize(Object instance) throws IOException { + return serialize(instance, RDFLanguages.TTL, new HashMap<>()); + } + + /** + * Serializes an object to an RDF representation of a given RDF serialization format. In order to support RDF, the + * input instance must be annotated using AAS Metamodel annotations. + * + * @param instance the instance to be serialized + * @param format the RDF format to be returned (only RDFLanguages.TTL, RDFLanguages.JSONLD, RDFLanguages.RDFXML) + * @return RDF serialization of the provided object graph + * @throws IOException if the serialization fails + */ + public synchronized String serialize(Object instance, Lang format) throws IOException { + return serialize(instance, format, new HashMap<>() ); + } + + + //Synchronized is required for thread safety. Without it, context elements might be missing in case of multiple simultaneous calls to this function + public synchronized String serialize(Object instance, Lang format, Map idMap) throws IOException { + if (format != RDFLanguages.JSONLD && format != RDFLanguages.TURTLE && format != RDFLanguages.RDFXML) { + throw new IOException("RDFFormat " + format + " is currently not supported by the serializer."); + } + mapper.registerModule(new JsonLDModule(idMap)); + String jsonLD = (instance instanceof Collection) + ? serializeCollection((Collection) instance) + : mapper.writerWithDefaultPrettyPrinter().writeValueAsString(instance); + if (format == RDFLanguages.JSONLD) return jsonLD; + else return convertJsonLdToOtherRdfFormat(jsonLD, format); + } + + private String serializeCollection(Collection collection) throws IOException { + String lineSep = System.lineSeparator(); + StringBuilder jsonLDBuilder = new StringBuilder(); + + if (collection.isEmpty()) { + jsonLDBuilder.append("[]"); + } else { + jsonLDBuilder.append("["); + jsonLDBuilder.append(lineSep); + for (Object item : collection) { + jsonLDBuilder.append(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(item)); + jsonLDBuilder.append(","); + jsonLDBuilder.append(lineSep); + } + int lastComma = jsonLDBuilder.lastIndexOf(","); + jsonLDBuilder.replace(lastComma, lastComma + 1, ""); + jsonLDBuilder.append("]"); + } + jsonLDBuilder.append(lineSep); + + return jsonLDBuilder.toString(); + } + + public String convertJsonLdToOtherRdfFormat(String jsonLd, Lang format) { + Model model = ModelFactory.createDefaultModel(); + RDFDataMgr.read(model, new ByteArrayInputStream(jsonLd.getBytes()), RDFLanguages.JSONLD); + + ByteArrayOutputStream os = new ByteArrayOutputStream(); + RDFDataMgr.write(os, model, format); + return os.toString(); + } + + public String serializePlainJson(Object instance) throws JsonProcessingException { + return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(instance); + } + + /** + * Inverse method of "serialize" + * + * @param serialization JSON(-LD) string + * @param valueType class of top level type + * @param deserialized type + * @return an object representing the provided JSON(-LD) structure + * @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF + */ + public T deserialize(String serialization, Class valueType) throws DeserializationException { + try { + return new Parser().parseMessage(serialization, valueType); + } + catch (IOException e) + { + throw new DeserializationException("Failed to deserialize input.", e); + } + } + + /** + * Inverse method of "serialize" + * + * @param serialization JSON(-LD) string + * @param valueType class of top level type + * @param serializationFormat RDF input format + * @param deserialized type + * @return an object representing the provided JSON(-LD) structure + * @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF + */ + public T deserialize(String serialization, Class valueType, Lang serializationFormat) throws DeserializationException { + try { + + return new Parser().parseMessage(serialization, valueType, serializationFormat); + } + catch (IOException e) + { + throw new DeserializationException("Failed to deserialize input.", e); + } + } + + /** + * Inverse method of "serialize" + * + * @param rdfModel Input RDF Model to be turned into an Instance of the IDS Java classes + * @param valueType class of top level type + * @param deserialized type + * @return an object representing the provided JSON(-LD) structure + * @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF + */ + public T deserialize(Model rdfModel, Class valueType) throws DeserializationException { + try { + return new Parser().parseMessage(rdfModel, valueType); + } + catch (IOException e) + { + throw new DeserializationException("Failed to deserialize input.", e); + } + } + + /** + * Allows to add further known namespaces to the message parser. Allows parsing to Java objects with JsonSubTypes annotations with other prefixes than "ids:". + * @param prefix Prefix to be added + * @param namespaceUrl URL of the prefix + */ + public static void addKnownNamespace(String prefix, String namespaceUrl) + { + Parser.knownNamespaces.put(prefix, namespaceUrl); + JsonLDSerializer.contextItems.put(prefix, namespaceUrl); + } + + /** + * Method to add a preprocessor for deserialization. + *

+ * Important note: The preprocessors are executed in the same order they were added. + * + * @param preprocessor the preprocessor to add + */ + public void addPreprocessor(JsonPreprocessor preprocessor) { + preprocessors.add(preprocessor); + } + + /** + * Method to add a preprocessor for deserialization. + *

+ * Important note: The preprocessors are executed in the same order they were added. + * + * @param preprocessor the preprocessor to add + * @param validate set whether the preprocessors output should be checked by RDF4j + */ + public void addPreprocessor(JsonPreprocessor preprocessor, boolean validate) { + preprocessor.enableRDFValidation(validate); + addPreprocessor(preprocessor); + } + + /** + * remove a preprocessor if no longer needed + * + * @param preprocessor the preprocessor to remove + */ + public void removePreprocessor(JsonPreprocessor preprocessor) { + preprocessors.remove(preprocessor); + } + + @Override + public String write(Environment aasEnvironment) throws SerializationException { + try { + return serialize(aasEnvironment); + } + catch (IOException e) + { + throw new SerializationException("Failed to serialize environment.", e); + } + } + + public String write(Environment aasEnvironment, Lang format) throws SerializationException { + return write(aasEnvironment, format, new HashMap<>()); + } + + public String write(Environment aasEnvironment, Lang format, Map idMap) throws SerializationException { + try { + return serialize(aasEnvironment, format, idMap); + } + catch (IOException e) + { + throw new SerializationException("Failed to serialize environment.", e); + } + } + @Override + public Environment read(String value) throws DeserializationException { + try { + return new Parser().parseMessage(value, Environment.class); + } + catch (IOException e) + { + throw new DeserializationException("Could not deserialize to environment.", e); + } + } + + public Environment read(String value, Lang serializationFormat) throws DeserializationException { + try { + return new Parser().parseMessage(value, Environment.class, serializationFormat); + } + catch (IOException e) + { + throw new DeserializationException("Could not deserialize to environment.", e); + } + } + + @Override + public void useImplementation(Class aasInterface, Class implementation) { + customImplementationMap.put(aasInterface, implementation); + //throw new NotImplementedException("Custom implementation support not yet implemented"); + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java new file mode 100644 index 000000000..972b02561 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import java.io.IOException; +import java.net.URI; + + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonStreamContext; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +public class UriSerializer extends StdSerializer { + + + public UriSerializer() { + this(null); + } + + public UriSerializer(Class clazz) { + super(clazz); + } + + + @Override + public void serialize(URI value, JsonGenerator gen, SerializerProvider provider) throws IOException { + String serializedUri = value.toString(); + // String idPattern = "{\"@id\": \"" + serializedUri + "\"}"; + JsonStreamContext context = gen.getOutputContext(); + if (context.getCurrentName() != null && context.getCurrentName().contains("@id")) { + gen.writeString(serializedUri); + } else { + gen.writeStartObject(); + gen.writeStringField("@id", serializedUri); + gen.writeEndObject(); + } + } + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java new file mode 100644 index 000000000..d2e04c6db --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +import java.io.IOException; +import java.math.BigDecimal; + +public class BigDecimalSerializer extends StdSerializer { + + public BigDecimalSerializer() { + this(null); + } + + public BigDecimalSerializer(Class clazz) { + super(clazz); + } + + @Override + public void serialize(BigDecimal value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeStartObject(); + gen.writeStringField("@value", value.toString()); + gen.writeStringField("@type", "http://www.w3.org/2001/XMLSchema#decimal"); + gen.writeEndObject(); + } +} \ No newline at end of file diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java new file mode 100644 index 000000000..47ff2ec1d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.JsonLdEnumSerializer; + +@JsonSerialize(using = JsonLdEnumSerializer.class) +public class JsonLdEnumMixin { +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java new file mode 100644 index 000000000..c60d62dc9 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + + +import java.util.List; + +@JsonTypeName("rdf:langString") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface LangStringMixin { + @JsonProperty("@value") + public String getValue(); + + @JsonProperty("@language") + public String getLanguage(); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java new file mode 100644 index 000000000..e7eb1a61c --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; + +import com.fasterxml.jackson.databind.introspect.ClassIntrospector; + +public class ReflectiveMixInResolver implements ClassIntrospector.MixInResolver { + + @Override + public Class findMixInClassFor(Class cls) { + if (cls.isEnum()) + { + return JsonLdEnumMixin.class; + } + try { + return Class.forName("org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins." + cls.getSimpleName() + "Mixin"); + } + catch (ClassNotFoundException ignored) + { + return null; + } + } + + @Override + public ClassIntrospector.MixInResolver copy() { + return new ReflectiveMixInResolver(); + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java new file mode 100644 index 000000000..94c0f9d08 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.XMLGregorianCalendar; +import java.io.IOException; +import java.time.ZonedDateTime; +import java.util.GregorianCalendar; + +public class XMLGregorianCalendarDeserializer extends StdDeserializer { + + public XMLGregorianCalendarDeserializer() { + this(XMLGregorianCalendar.class); + } + + public XMLGregorianCalendarDeserializer(Class clazz) { + super(clazz); + } + + @Override + public XMLGregorianCalendar deserialize(JsonParser p, DeserializationContext context) throws IOException { + XMLGregorianCalendar xgc = null; + try { + xgc = DatatypeFactory.newInstance().newXMLGregorianCalendar(GregorianCalendar.from(ZonedDateTime.parse(p.getValueAsString()))); + } catch (DatatypeConfigurationException e) { + e.printStackTrace(); + } + return xgc; + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java new file mode 100644 index 000000000..a4cfb571c --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +import javax.xml.datatype.XMLGregorianCalendar; +import java.io.IOException; +import java.text.SimpleDateFormat; + +public class XMLGregorianCalendarSerializer extends StdSerializer { + + public XMLGregorianCalendarSerializer() { + this(null); + } + + public XMLGregorianCalendarSerializer(Class clazz) { + super(clazz); + } + + @Override + public void serialize(XMLGregorianCalendar value, JsonGenerator gen, SerializerProvider provider) throws IOException { + SimpleDateFormat xsdDateTimeStampFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"); + xsdDateTimeStampFormat.setCalendar(value.toGregorianCalendar()); + String xsdDateTimeStampFormatted = xsdDateTimeStampFormat.format(value.toGregorianCalendar().getTime()); + gen.writeStartObject(); + gen.writeStringField("@value", xsdDateTimeStampFormatted); + gen.writeStringField("@type", "http://www.w3.org/2001/XMLSchema#dateTimeStamp"); + gen.writeEndObject(); + + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java new file mode 100644 index 000000000..f3b92a6e0 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:AdministrativeInformation") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface AdministrativeInformationMixin extends HasDataSpecificationMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") + String getVersion(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") + void setVersion(String version); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") + String getRevision(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") + void setRevision(String revision); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java new file mode 100644 index 000000000..44edbc177 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; + +import java.util.List; + +@JsonTypeName("aas:AnnotatedRelationshipElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface AnnotatedRelationshipElementMixin extends RelationshipElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotation") + List getAnnotations(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotation") + void setAnnotations(List annotations); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java new file mode 100644 index 000000000..306463292 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:AssetAdministrationShell") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface AssetAdministrationShellMixin extends HasDataSpecificationMixin, IdentifiableMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") + AssetInformation getAssetInformation(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") + void setAssetInformation(AssetInformation assetInformation); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") + Reference getDerivedFrom(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") + void setDerivedFrom(Reference derivedFrom); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodel") + List getSubmodels(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodel") + void setSubmodels(List submodels); + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java new file mode 100644 index 000000000..45f2afe13 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:AssetInformation") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface AssetInformationMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") + AssetKind getAssetKind(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") + void setAssetKind(AssetKind assetKind); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") + Reference getGlobalAssetId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") + void setGlobalAssetId(Reference globalAssetId); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") + List getSpecificAssetIds(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") + void setSpecificAssetIds(List specificAssetIds); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/billOfMaterial") + List getBillOfMaterials(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/billOfMaterial") + void setBillOfMaterials(List billOfMaterials); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") + File getDefaultThumbnail(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") + void setDefaultThumbnail(File defaultThumbnail); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java new file mode 100644 index 000000000..2690318f6 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Direction; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + +@JsonTypeName("aas:BasicEventElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface BasicEventElementMixin extends EventElementMixin { + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") + Direction getDirection(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") + void setDirection(Direction direction); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") + String getLastUpdate(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") + void setLastUpdate(String lastUpdate); + + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") + String getMaxInterval(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") + void setMaxInterval(String maxInterval); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") + Reference getMessageBroker(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") + void setMessageBroker(Reference messageBroker); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") + String getMessageTopic(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") + void setMessageTopic(String messageTopic); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") + String getMinInterval(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") + void setMinInterval(String minInterval); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") + Reference getObserved(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") + void setObserved(Reference observed); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") + StateOfEvent getState(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") + void setState(StateOfEvent state); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java new file mode 100644 index 000000000..dfb2e7a6d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:Blob") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface BlobMixin extends DataElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") + String getContentType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") + void setConentType(String mimeType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/value") + byte[] getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/value") + void setValue(byte[] value); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java new file mode 100644 index 000000000..1991a410d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:Capability") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface CapabilityMixin extends SubmodelElementMixin { + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java new file mode 100644 index 000000000..196244ecd --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:ConceptDescription") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ConceptDescriptionMixin extends HasDataSpecificationMixin, IdentifiableMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") + List getIsCaseOf(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") + void setIsCaseOf(List isCaseOf); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java new file mode 100644 index 000000000..abc0d5f1d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + + +@JsonTypeName("aas:DataElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = File.class), + @JsonSubTypes.Type(value = Blob.class), + @JsonSubTypes.Type(value = MultiLanguageProperty.class), + @JsonSubTypes.Type(value = Property.class), + @JsonSubTypes.Type(value = Range.class), + @JsonSubTypes.Type(value = ReferenceElement.class) +}) +public interface DataElementMixin extends SubmodelElementMixin { + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java new file mode 100644 index 000000000..ecef45ebc --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + +import java.util.List; + +@JsonTypeName("aas:DataSpecificationContent") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = DataSpecificationIEC61360.class) +}) +public interface DataSpecificationContentMixin { + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java new file mode 100644 index 000000000..13c3b6aec --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + +import java.util.List; + +@JsonTypeName("aas:DataSpecificationIEC61360") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface DataSpecificationIEC61360Mixin extends DataSpecificationContentMixin { + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") + public DataTypeIEC61360 getDataType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") + public void setDataType(DataTypeIEC61360 dataType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + public List getDefinition(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + public void setDefinitions(List definition); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + public LevelType getLevelType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + public void setLevelType(LevelType levelType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + public List getPreferredName(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + public void setPreferredName(List preferredName); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + public List getShortName(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + public void setShortName(List shortName); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") + public String getSourceOfDefinition(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") + public void setSourceOfDefinition(String sourceOfDefinition); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") + public String getSymbol(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") + public void setSymbol(String symbol); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + public String getUnit(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + public void setUnit(String unit); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + public Reference getUnitId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + public void setUnitId(Reference unitId); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") + public String getValueFormat(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") + public void setValueFormat(String valueFormat); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + public String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + public void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") + public ValueList getValueList(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") + public void setValueList(ValueList valueList); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueId") + public Reference getValueId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueId") + public void setValueId(Reference valueId); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java new file mode 100644 index 000000000..8caf8a712 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +import java.util.List; + +@JsonTypeName("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface DataSpecificationPhysicalUnitMixin { + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") + String getConversionFactor(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") + void setConversionFactor(String conversionFactor); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/definition") + List getDefinitions(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/definition") + void setDefinitions(List definitions); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") + String getDinNotation(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") + void setDinNotation(String dinNotation); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") + String getEceCode(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") + void setEceCode(String eceCode); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceName") + String getEceName(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceName") + void setEceName(String eceName); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/nistName") + String getNistName(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/nistName") + void setNistName(String nistName); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siName") + String getSiName(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siName") + void setSiName(String siName); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") + String getSiNotation(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") + void setSiNotation(String siNotation); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") + String getRegistrationAuthorityId(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") + void setRegistrationAuthorityId(String registrationAuthorityId); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/supplier") + String getSupplier(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/supplier") + void setSupplier(String supplier); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitName") + String getUnitName(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitName") + void setUnitName(String unitName); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") + String getUnitSymbol(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") + void setUnitSymbol(String unitSymbol); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java new file mode 100644 index 000000000..af4615037 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:EmbeddedDataSpecification") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface EmbeddedDataSpecificationMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") + public DataSpecificationIEC61360 getDataSpecificationContent(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") + public void setDataSpecificationContent(DataSpecificationIEC61360 dataSpecificationContent); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") + public Reference getDataSpecification(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") + public void setDataSpecification(Reference dataSpecification); + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java new file mode 100644 index 000000000..c99abc22d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.List; + +@JsonTypeName("aas:Entity") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface EntityMixin extends SubmodelElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") + Reference getGlobalAssetId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") + void setGlobalAssetId(Reference globalAssetId); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") + SpecificAssetId getSpecificAssetId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") + void setSpecificAssetId(SpecificAssetId specificAssetId); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") + EntityType getEntityType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") + void setEntityType(EntityType entityType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/statement") + List getStatements(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/statement") + void setStatements(List statements); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java new file mode 100644 index 000000000..d11186246 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + +import java.util.List; + +@JsonTypeName("aas:Environment") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface EnvironmentMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") + List getAssetAdministrationShells(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") + void setAssetAdministrationShells(List assetAdministrationShells); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") + List getConceptDescriptions(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") + void setConceptDescriptions(List conceptDescriptions); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") + List getSubmodels(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") + void setSubmodels(List submodels); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java new file mode 100644 index 000000000..242a382b8 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; + + +@JsonTypeName("aas:EventElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = BasicEventElement.class) +}) +public interface EventElementMixin extends SubmodelElementMixin { + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java new file mode 100644 index 000000000..cf749d68b --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:EventMessage") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface EventMessageMixin extends SubmodelElementMixin { + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java new file mode 100644 index 000000000..49d8ef044 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:Extension") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ExtensionMixin extends HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/name") + String getName(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/name") + void setName(String name); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") + String getValueType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") + void setValueType(String valueType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/value") + void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") + Reference getRefersTo(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") + void setRefersTo(Reference refersTo); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java new file mode 100644 index 000000000..b3d153445 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:File") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface FileMixin extends DataElementMixin, SubmodelElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/contentType") + String getContentType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/contentType") + void setContentType(String contentType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/value") + void setValue(String value); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java new file mode 100644 index 000000000..a8005ea52 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:Formula") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface FormulaMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Formula/dependsOn") + List getDependsOns(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Formula/dependsOn") + void setDependsOns(List dependsOns); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java new file mode 100644 index 000000000..9663339aa --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + + +import java.util.List; + +@JsonTypeName("aas:HasDataSpecification") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Submodel.class), + @JsonSubTypes.Type(value = AdministrativeInformation.class), + @JsonSubTypes.Type(value = AssetAdministrationShell.class), + @JsonSubTypes.Type(value = ConceptDescription.class), + @JsonSubTypes.Type(value = SubmodelElement.class) +}) +public interface HasDataSpecificationMixin { + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiations") + List getDataSpecifications(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiations") + void setDataSpecifications(List dataSpecifications); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + List getEmbeddedDataSpecifications(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + void setEmbeddedDataSpecifications(List embeddedDataSpecifications); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java new file mode 100644 index 000000000..734ee4bbf --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; + +import java.util.List; + +@JsonTypeName("aas:HasExtensions") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface HasExtensionsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension") + List getExtensions(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension") + void setExtensions(List extensions); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java new file mode 100644 index 000000000..23a5c6a05 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +@JsonTypeName("aas:HasKind") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Submodel.class), + @JsonSubTypes.Type(value = SubmodelElement.class) +}) +public interface HasKindMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + ModelingKind getKind(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + void setKind(ModelingKind kind); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java new file mode 100644 index 000000000..588ad4c8e --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + +import java.util.List; + + +@JsonTypeName("aas:HasSemantics") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Submodel.class), + @JsonSubTypes.Type(value = SpecificAssetId.class), + @JsonSubTypes.Type(value = SubmodelElement.class), + @JsonSubTypes.Type(value = Qualifier.class), + @JsonSubTypes.Type(value = Extension.class) +}) +public interface HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + Reference getSemanticId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + void setSemanticId(Reference semanticId); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + List getSupplementalSemanticIds(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + void setSupplementalSemanticIds(List references); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java new file mode 100644 index 000000000..4e165f986 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + +@JsonTypeName("aas:Identifiable") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Submodel.class), + @JsonSubTypes.Type(value = AssetAdministrationShell.class), + @JsonSubTypes.Type(value = ConceptDescription.class) +}) +public interface IdentifiableMixin extends ReferableMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") + AdministrativeInformation getAdministration(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") + void setAdministration(AdministrativeInformation administration); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") + String getId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") + void setId(String id); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java new file mode 100644 index 000000000..7c7f55f2a --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:IdentifierKeyValuePair") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface IdentifierKeyValuePairMixin extends HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/key") + String getKey(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/key") + void setKey(String key); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/value") + void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/externalSubjectId") + Reference getExternalSubjectId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/externalSubjectId") + void setExternalSubjectId(Reference externalSubjectId); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java new file mode 100644 index 000000000..1416e89a7 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:Identifier") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface IdentifierMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifier/identifier") + String getIdentifier(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifier/identifier") + void setIdentifier(String identifier); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java new file mode 100644 index 000000000..1d1c5c763 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; + +@JsonTypeName("aas:Key") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface KeyMixin { + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/type") + KeyTypes getType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/type") + void setType(KeyTypes type); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/value") + void setValue(String value); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java new file mode 100644 index 000000000..562facc00 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:MultiLanguageProperty") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface MultiLanguagePropertyMixin extends DataElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") + List getValues(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") + void setValues(List values); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") + Reference getValueId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") + void setValueId(Reference valueId); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java new file mode 100644 index 000000000..95e005f22 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:ObjectAttributes") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ObjectAttributesMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ObjectAttributes/objectAttribute") + List getObjectAttributes(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ObjectAttributes/objectAttribute") + void setObjectAttributes(List objectAttributes); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java new file mode 100644 index 000000000..3ad6ca03d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; + +import java.util.List; + +@JsonTypeName("aas:Operation") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface OperationMixin extends SubmodelElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariable") + List getInputVariables(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariable") + void setInputVariables(List inputVariables); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariable") + List getInoutputVariables(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariable") + void setInoutputVariables(List inoutputVariables); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariable") + List getOutputVariables(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariable") + void setOutputVariables(List outputVariables); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java new file mode 100644 index 000000000..76e45277b --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +@JsonTypeName("aas:OperationVariable") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface OperationVariableMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") + SubmodelElement getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") + void setValue(SubmodelElement value); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java new file mode 100644 index 000000000..fade7f4e7 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:PolicyDecisionPoint") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface PolicyDecisionPointMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyDecisionPoint/externalPolicyDecisionPoints") + boolean getExternalPolicyDecisionPoints(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyDecisionPoint/externalPolicyDecisionPoints") + void setExternalPolicyDecisionPoints(boolean externalPolicyDecisionPoints); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java new file mode 100644 index 000000000..331c8a872 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:PolicyEnforcementPoints") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface PolicyEnforcementPointsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyEnforcementPoints/externalPolicyEnforcementPoint") + boolean getExternalPolicyEnforcementPoint(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyEnforcementPoints/externalPolicyEnforcementPoint") + void setExternalPolicyEnforcementPoint(boolean externalPolicyEnforcementPoint); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java new file mode 100644 index 000000000..817bb2f5c --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:PolicyInformationPoints") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface PolicyInformationPointsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/externalInformationPoints") + boolean getExternalInformationPoints(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/externalInformationPoints") + void setExternalInformationPoints(boolean externalInformationPoints); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/internalInformationPoint") + List getInternalInformationPoints(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/internalInformationPoint") + void setInternalInformationPoints(List internalInformationPoints); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java new file mode 100644 index 000000000..7658c2e2c --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:Property") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface PropertyMixin extends DataElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueType") + String getValueType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueType") + void setValueType(String valueType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/value") + void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueId") + Reference getValueId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueId") + void setValueId(Reference valueId); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java new file mode 100644 index 000000000..739dfc67f --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; + +import java.util.List; + +@JsonTypeName("aas:Qualifiable") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Submodel.class), + @JsonSubTypes.Type(value = SubmodelElement.class) +}) +public interface QualifiableMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifier") + List getQualifiers(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifier") + void setQualifiers(List qualifiers); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java new file mode 100644 index 000000000..899cbe893 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:Qualifier") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface QualifierMixin extends HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") + String getType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") + void setType(String type); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") + String getValueType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") + void setValueType(String valueType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") + void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") + Reference getValueId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") + void setValueId(Reference valueId); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java new file mode 100644 index 000000000..fb38aafc5 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:Range") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface RangeMixin extends DataElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/valueType") + String getValueType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/valueType") + void setValueType(String valueType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/max") + String getMax(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/max") + void setMax(String max); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/min") + String getMin(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/min") + void setMin(String min); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java new file mode 100644 index 000000000..c31908a5d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.List; + +@JsonTypeName("aas:Referable") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Identifiable.class), + @JsonSubTypes.Type(value = SubmodelElement.class) +}) +public interface ReferableMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/category") + String getCategory(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/category") + void setCategory(String category); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/description") + List getDescription(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/description") + void setDescription(List description); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + List getDisplayName(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + void setDisplayName(List displayName); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + String getIdShort(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + void setIdShort(String idShort); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java new file mode 100644 index 000000000..0a4cb3668 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:ReferenceElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ReferenceElementMixin extends DataElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") + Reference getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") + void setValue(Reference value); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java new file mode 100644 index 000000000..bd836cf9d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + +import java.util.List; + +@JsonTypeName("aas:Reference") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ReferenceMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/keys") + List getKeys(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/keys") + void setKeys(List keys); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/type") + ReferenceTypes getType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/type") + void setType(ReferenceTypes type); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java new file mode 100644 index 000000000..d523598ab --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:RelationshipElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = AnnotatedRelationshipElement.class) +}) +public interface RelationshipElementMixin extends SubmodelElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") + Reference getFirst(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") + void setFirst(Reference first); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") + Reference getSecond(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") + void setSecond(Reference second); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java new file mode 100644 index 000000000..6f535d8a2 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; + +import java.util.List; + +@JsonTypeName("aas:Resource") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ResourceMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") + String getContentType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") + void setContentType(String contentType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/path") + String getPath(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/path") + void setPath(String path); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java new file mode 100644 index 000000000..940f36639 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; + +@JsonTypeName("aas:SpecificAssetId") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface SpecificAssetIdMixin extends HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") + String getName(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") + void setName(String name); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") + void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") + Reference getExternalSubjectId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") + void setExternalSubjectId(Reference reference); + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java new file mode 100644 index 000000000..6ee1af3b6 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; + +import java.util.List; + +@JsonTypeName("aas:SubjectAttributes") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface SubjectAttributesMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubjectAttributes/subjectAttribute") + List getSubjectAttributes(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubjectAttributes/subjectAttribute") + void setSubjectAttributes(List subjectAttributes); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java new file mode 100644 index 000000000..f9559be87 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.Collection; + +@JsonTypeName("aas:SubmodelElementCollection") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface SubmodelElementCollectionMixin extends SubmodelElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/allowDuplicates") + boolean getAllowDuplicates(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/allowDuplicates") + void setAllowDuplicates(boolean allowDuplicates); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/ordered") + boolean getOrdered(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/ordered") + void setOrdered(boolean ordered); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") + Collection getValues(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") + void setValues(Collection values); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java new file mode 100644 index 000000000..2b754f2c1 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + +import java.util.List; + +@JsonTypeName("aas:SubmodelElementList") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface SubmodelElementListMixin extends SubmodelElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") + boolean getOrderRelevant(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") + void setOrderRelevant(boolean orderRelevant); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") + Reference getSemanticIdListElement(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") + void setSemanticIdListElement(Reference semanticIdListElement); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") + AasSubmodelElements getTypeValueListElement(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") + void setTypeValueListElement(AasSubmodelElements typeValueListElement); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") + List getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") + void setValue(List value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") + DataTypeDefXsd getValueTypeListElement(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") + void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java new file mode 100644 index 000000000..f8f878da4 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + + +@JsonTypeName("aas:SubmodelElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = RelationshipElement.class), + @JsonSubTypes.Type(value = DataElement.class), + @JsonSubTypes.Type(value = File.class), + @JsonSubTypes.Type(value = Capability.class), + @JsonSubTypes.Type(value = Entity.class), + @JsonSubTypes.Type(value = EventElement.class), + @JsonSubTypes.Type(value = EventPayload.class), + @JsonSubTypes.Type(value = Operation.class), + @JsonSubTypes.Type(value = SubmodelElementCollection.class) +}) +public interface SubmodelElementMixin extends ReferableMixin, QualifiableMixin, HasDataSpecificationMixin, HasKindMixin, HasSemanticsMixin { + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java new file mode 100644 index 000000000..a5dcc9a8b --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.List; + +@JsonTypeName("aas:Submodel") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface SubmodelMixin extends QualifiableMixin, HasDataSpecificationMixin, IdentifiableMixin, HasKindMixin, HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElement") + List getSubmodelElements(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElement") + void setSubmodelElements(List submodelElements); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java new file mode 100644 index 000000000..5d7ac5811 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; + +import java.util.List; + + +@JsonTypeName("aas:ValueList") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ValueListMixin { + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") + List getValueReferencePairs(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") + void setValueReferencePairs(List valueReferencePairs); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java new file mode 100644 index 000000000..fc75ff057 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:ValueReferencePair") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ValueReferencePairMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") + void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") + Reference getValueId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") + void setValueId(Reference valueId); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java new file mode 100644 index 000000000..dcae112eb --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:View") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ViewMixin extends ReferableMixin, HasDataSpecificationMixin, HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/View/containedElement") + List getContainedElements(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/View/containedElement") + void setContainedElements(List containedElements); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java new file mode 100644 index 000000000..209b9e98f --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing; + + +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.riot.RDFLanguages; + + +import java.io.ByteArrayInputStream; +import java.io.IOException; + +/** + * basic implementation of {@code JsonPreprocessor} that encapsulates validation. + * By default, validation is disabled for performance reasons (@context has to be downloaded each time). + */ +public abstract class BasePreprocessor implements JsonPreprocessor { + + private boolean validate = false; + + + @Override + public final String preprocess(String input) throws IOException { + String result = preprocess_impl(input); + if(validate) { + Model m = ModelFactory.createDefaultModel(); + RDFDataMgr.read(m, new ByteArrayInputStream(result.getBytes()), RDFLanguages.JSONLD); + } + return result; + } + + abstract String preprocess_impl(String input) throws IOException; + + @Override + public void enableRDFValidation(boolean validate) { + this.validate = validate; + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java new file mode 100644 index 000000000..eb99ac8b3 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing; + +import java.io.IOException; + +/** + * Interface for JSON-LD preprocessors which should transform JSON-LD inputs + * before they are deserialized by Jackson. + * + * Implementations used at the same time must not interfere with each other. + */ +public interface JsonPreprocessor { + + /** + * preprocessing method + * @param input of the transformation, the original JSON-LD + * @return the transformation´s result + * @throws IOException if preprocessing fails, e.g. because the input is not valid RDF + */ + public String preprocess(String input) throws IOException; + + /** + * specify wheter the transformation's result should be validated to + * be parsable by RDF4j + * @param validate enable/disable switch + */ + public void enableRDFValidation(boolean validate); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java new file mode 100644 index 000000000..e117d0359 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; + +public class TypeNamePreprocessor extends BasePreprocessor { + + private static final Map prefixes; + + static { + prefixes = new HashMap<>(); + prefixes.put("ids:", "https://w3id.org/idsa/core/"); + prefixes.put("idsc:", "https://w3id.org/idsa/code/"); + prefixes.put("info:", "http://www.fraunhofer.de/fraunhofer-digital/infomodell#"); + prefixes.put("kdsf:", "http://kerndatensatz-forschung.de/version1/technisches_datenmodell/owl/Basis#"); + } + + @Override + String preprocess_impl(String input) throws IOException { + ObjectMapper mapper = new ObjectMapper(); + Map inMap = mapper.readValue(input, Map.class); + Map outMap = unifyTypeURIPrefix(inMap); + return mapper.writeValueAsString(outMap); + } + + + private Map unifyTypeURIPrefix(Map in) { + Map out = new LinkedHashMap<>(); + in.forEach((k,v) -> { + if(v instanceof String && k instanceof String && k.equals("@type")) { + + + // if key is @type and value is a string: add 'ids:' if no other namespace at the value + AtomicReference modifiableValue = new AtomicReference<>((String) v); + prefixes.forEach((p, u) -> modifiableValue.set(modifiableValue.get().replace(u, p))); // replace full URI with prefix + if(! (modifiableValue.get().startsWith("ids:") + || modifiableValue.get().startsWith("idsc:") + || modifiableValue.get().startsWith("info:") + || modifiableValue.get().startsWith("kdsf:") + || modifiableValue.get().startsWith("xsd:") + || modifiableValue.get().startsWith("http://") + || modifiableValue.get().startsWith("https://"))) { + modifiableValue.set("ids:".concat(modifiableValue.get())); // default to ids prefix for backwards compatibility + } + out.put(k, modifiableValue.get()); + + + } else if(v instanceof Map) { + AtomicReference modifiableKey = new AtomicReference<>((String) k); + + prefixes.forEach((prefix, uri) -> modifiableKey.set(modifiableKey.get().replace(uri, prefix))); // replace full URI with prefix + if(! (modifiableKey.get().startsWith("ids:") + || modifiableKey.get().startsWith("info:") + || modifiableKey.get().startsWith("kdsf:") + || modifiableKey.get().startsWith("http://") + || modifiableKey.get().startsWith("https://") + || modifiableKey.get().startsWith("@context"))) { + modifiableKey.set("ids:".concat(modifiableKey.get())); // default to ids prefix for backwards compatibility + } + + + // shorten an @id Map + if (((Map) v).containsKey("@id") && ((Map) v).keySet().size() == 1) { + Map idMap = new LinkedHashMap<>(); + idMap.put(k, ((Map) v).get("@id")); + + out.putAll(unifyTypeURIPrefix(idMap)); + + } else if (((Map) v).containsKey("@value") && + ((Map) v).containsKey("@type")) + { + if( ((Map) v).get("@type").toString().contains("dateTime") ) + { + + // shorten an @value Map with xsd:dateTimes + Object date = ((Map) v).get("@value"); + out.put(modifiableKey, date); + } + else if(((Map) v).get("@type").toString().equals("xsd:integer")) + { + int value = Integer.parseInt(((Map) v).get("@value").toString()); + out.put(modifiableKey, value); + } + else { //Do the same as below + out.put(modifiableKey, unifyTypeURIPrefix((Map) v)); + } + + } else { + + out.put(modifiableKey, unifyTypeURIPrefix((Map) v)); + + + } + + } else if(v instanceof ArrayList) { + + + AtomicReference modifiableKey = new AtomicReference<>((String) k); + prefixes.forEach((p, u) -> modifiableKey.set(modifiableKey.get().replace(u, p))); // replace full URI with prefix + if(! (modifiableKey.get().startsWith("ids:") + || modifiableKey.get().startsWith("info:") + || modifiableKey.get().startsWith("kdsf:") + || modifiableKey.get().startsWith("http://") + || modifiableKey.get().startsWith("https://"))) { + modifiableKey.set("ids:".concat(modifiableKey.get())); // default to ids prefix for backwards compatibility + } + + Iterator iter = new ArrayList((ArrayList) v).iterator(); //making a copy of the old array so the iterator does not get confused by the element deletions + while (iter.hasNext()) { + Object child = iter.next(); + if (child instanceof Map && ((Map) child).containsKey("@id") && ((Map) child).keySet().size() == 1) { + ((ArrayList) v).remove(child); + ((ArrayList) v).add(((Map) child).get("@id")); + } + } + + out.put(modifiableKey, unifyTypeURIPrefix((ArrayList) v)); // TODO: What happens with an Array inside the Array? + + + } else { + + + AtomicReference modifiableKey = new AtomicReference<>((String) k); + prefixes.forEach((p, u) -> modifiableKey.set(modifiableKey.get().replace(u, p))); // replace full URI with prefix + if(! (modifiableKey.get().startsWith("ids:") + || modifiableKey.get().startsWith("info:") + || modifiableKey.get().startsWith("kdsf:") + || modifiableKey.get().startsWith("http://") + || modifiableKey.get().startsWith("https://") + || modifiableKey.get().startsWith("@"))) { + //in the context definition, a pair might look like this: "ids" : "http://www.someURL.com" + //Here, we start with "ids", not "ids:". So we also need to check that the key is not contained in our prefixes + if(!prefixes.containsKey(modifiableKey.get() + ":")) { + modifiableKey.set("ids:".concat(modifiableKey.get())); // default to ids prefix for backwards compatibility + } + } + + out.put(modifiableKey, v); // modify nothing if not @type or a map + } + }); + return out; + } + + + private ArrayList unifyTypeURIPrefix(ArrayList in) { + ArrayList out = new ArrayList<>(); + + Iterator iter = in.iterator(); + + while (iter.hasNext()) { + Object v = iter.next(); + if(v instanceof Map) { + + + if (!((Map) v).isEmpty()) + out.add( unifyTypeURIPrefix((Map) v)); + + + } else if (v instanceof String) { + + out.add(v); // modify nothing if not @type or a map + } else { + out.add(v); + } + } + return out; + } + + + + +} diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java new file mode 100644 index 000000000..8d603f749 --- /dev/null +++ b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; + +import org.apache.jena.riot.RDFLanguages; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; + +import junitparams.JUnitParamsRunner; +import junitparams.Parameters; + +import java.io.IOException; + +@RunWith(JUnitParamsRunner.class) +public class ParserTest { + + @Test + public void parseAasEnvironmentTest() throws IOException, DeserializationException { + String aasEnvAsString = SerializerUtil.readResourceToString("example-from-serializer.jsonld"); + Environment aasEnv = new Serializer().read(aasEnvAsString); + Assert.assertEquals(1, aasEnv.getSubmodels().size()); + Assert.assertEquals(1, aasEnv.getAssetAdministrationShells().get(0).getDescription().size()); + Assert.assertEquals(2, aasEnv.getAssetAdministrationShells().get(0).getDisplayName().size()); + + Assert.assertEquals("de", aasEnv.getAssetAdministrationShells().get(0).getDisplayName().get(0).getLanguage()); + Assert.assertEquals("en", aasEnv.getAssetAdministrationShells().get(0).getDisplayName().get(1).getLanguage()); + Assert.assertNotNull(aasEnv.getAssetAdministrationShells().get(0).getDescription().get(0).getLanguage()); + + } + + @Test + @Ignore + public void parseFullTurtleEnvironmentTest() throws IOException, DeserializationException { + String aasEnvAsString = SerializerUtil.readResourceToString("AASFull.ttl"); + Environment environment = new Serializer().read(aasEnvAsString); + + // TODO continue providing a correct AASFull Turtle representation + // TODO test for LangStrings + Assert.assertEquals(AASFull.ENVIRONMENT, environment); + } + + + @Test + @Parameters({"AAS_Reference_shortExample.ttl", "AssetAdministrationShell_Example.ttl", + "Complete_Example.ttl", "ReferenceExample.ttl" /*, "KapitalVerwaltungsschaleExample.ttl"*/}) + public void parseAasTurtleSchemaExamplesTest(String file) throws IOException, DeserializationException { + Serializer serializer = new Serializer(); + + AssetAdministrationShell aas = serializer.deserialize(SerializerUtil.readResourceToString(file),AssetAdministrationShell.class, RDFLanguages.TURTLE); + + Assert.assertNotNull(aas.getAssetInformation().getAssetKind()); + } + + @Test + @Parameters({ "AAS_Reference_shortExample.nt", "Overall-Example.nt"}) + public void parseAasNtriplesSchemaExamplesTest(String file) throws IOException, DeserializationException { + Serializer serializer = new Serializer(); + + AssetAdministrationShell aas = serializer.deserialize(SerializerUtil.readResourceToString(file), AssetAdministrationShell.class, RDFLanguages.TURTLE); + + Assert.assertNotNull(aas.getAssetInformation().getAssetKind()); + } + + @Test + @Parameters({"Submodel_SubmodelElement_Example.ttl"}) + public void parseSubmodelSchemaExamplesTest(String file) throws IOException, DeserializationException { + Serializer serializer = new Serializer(); + //These work + + Submodel submodel = serializer.deserialize(SerializerUtil.readResourceToString(file), Submodel.class, RDFLanguages.TURTLE); + + Assert.assertNotNull(submodel.getSubmodelElements().get(0).getIdShort()); + + + //The following examples do not work yet, as they are semantically problematic + //serializer.deserialize(SerializerUtil.readResourceToString("Submodel_SubmodelElement_shortExample.ttl"), Reference.class, RDFLanguages.TURTLE); + //serializer.deserialize(SerializerUtil.readResourceToString("Submodel_SubmodelElement_shortExample.nt"), Reference.class, RDFLanguages.NTRIPLES); + } + + + + + @Test + public void deserializeConceptDescription() throws IOException, DeserializationException { + String conceptDescription = "{\n" + + " \"@context\" : {\n" + + " \"aas\" : \"https://admin-shell.io/aas/3/0/RC02/\",\n" + + " \"phys_unit\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/\",\n" + + " \"iec61360\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/\"\n" + + " },\n" + + " \"@id\" : \"https://admin-shell.io/autogen/DefaultConceptDescription/c6bd22b3-6487-49d2-a86d-e3834d22ceb9\",\n" + + " \"@type\" : \"aas:ConceptDescription\",\n" + + " \"isCaseOf\" : [ ],\n" + + " \"https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension\" : [ ],\n" + + " \"https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications\" : [ {\n" + + " \"@id\" : \"https://admin-shell.io/autogen/DefaultDataSpecification/f461858c-8981-4141-bac3-6aee56977017\",\n" + + " \"@type\" : \"aas:EmbeddedDataSpecification\",\n" + + " \"https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecifiation\" : {\n" + + " \"@id\" : \"https://admin-shell.io/autogen/DefaultReference/41ee5bcc-adde-4a5a-bfb5-ace237247d0c\",\n" + + " \"@type\" : \"aas:Reference\",\n" + + " \"https://admin-shell.io/aas/3/0/RC02/Reference/key\" : [ {\n" + + " \"@id\" : \"https://admin-shell.io/autogen/DefaultKey/234b457f-0e8f-46b3-8e73-f850a79269f1\",\n" + + " \"@type\" : \"aas:Key\",\n" + + " \"https://admin-shell.io/aas/3/0/RC02/Key/value\" : \"https://example.org\"\n" + + " } ]\n" + + " },\n" + + " \"https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent\" : {\n" + + " \"@id\" : \"https://admin-shell.io/autogen/DefaultDataSpecificationIEC61360/457288b3-77e1-474a-ab74-866bdcafd914\",\n" + + " \"@type\" : \"iec61360:DataSpecificationIEC61360\",\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType\" : {\n" + + " \"@type\" : \"https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360\",\n" + + " \"@id\" : \"https://admin-shell.io/aas/3/0/RC02/RATIONAL\"\n" + + " },\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition\" : [ ],\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName\" : [ ],\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName\" : [ ]\n" + + " },\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecification/id\" : \"http://example.org/DataSpecification1\"\n" + + " } ]\n" + + "}"; + + Serializer serializer = new Serializer(); + ConceptDescription c = serializer.deserialize(conceptDescription, ConceptDescription.class); + + Assert.assertNotNull(c); + } + + +} diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java new file mode 100644 index 000000000..2d7d56c03 --- /dev/null +++ b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.apache.jena.riot.RDFLanguages; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class SerializerTest { + + //TODO: Optional: Prefixes instead of full URIs + //TODO: Optional: Do not serialize empty collections + + @Test + public void serializeEnvironment() throws IOException, DeserializationException { + + AssetAdministrationShell aas = new DefaultAssetAdministrationShell.Builder() + .assetInformation(new DefaultAssetInformation.Builder() + .assetKind(AssetKind.INSTANCE) + .build()) + .description(Arrays.asList(new DefaultLangString.Builder().text("This is a test AAS").language("en-us").build())) + .displayName(Arrays.asList( + new DefaultLangString.Builder().text("Anzeigename 2").language("de").build(), + new DefaultLangString.Builder().text("Display Name 1").language("en").build() + )) + .build(); + + Submodel submodel = new DefaultSubmodel.Builder() + .description(Arrays.asList(new DefaultLangString.Builder().text("My Submodel").language("en-us").build())) + .displayName(Arrays.asList( + new DefaultLangString.Builder().text("First Submodel Element name").language("en").build(), + new DefaultLangString.Builder().text("Second Submodel Element name").language("en").build() + )) + .category("Example category") + .build(); + + ConceptDescription conceptDescription = new DefaultConceptDescription.Builder() + .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() + .dataSpecification(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .value("https://example.org") + .build()) + .build()) + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .dataType(DataTypeIEC61360.RATIONAL) + .build()) + .build()) + .build(); + + List aasList = new ArrayList<>(Collections.singletonList(aas)); + Environment aasEnv = new DefaultEnvironment.Builder() + .assetAdministrationShells(aasList) + .submodels(submodel) + .conceptDescriptions(conceptDescription) + .build(); + + String output = new Serializer().serialize(aasEnv, RDFLanguages.JSONLD); + //System.out.println(output); + + Assert.assertTrue(output.contains("@context")); + // Assert.assertTrue(output.contains("rdf:")); // TODO: why should the output contain the 'rdf' prefix? + Assert.assertTrue(output.contains("\"@type\" : \"aas:Environment\"")); + Assert.assertTrue(output.contains("\"@type\" : \"aas:AssetAdministrationShell\"")); + Assert.assertTrue(output.contains("\"@type\" : \"aas:Submodel\"")); + Assert.assertTrue(output.contains("\"@type\" : \"aas:ConceptDescription\"")); + + Environment environment = new Serializer().deserialize(output, Environment.class); + Assert.assertNotNull(environment); + + // Assert.assertTrue(aasEnv.equals(environment)); // TODO: Serialising and parsing to/from RDF looses the sequence of e.g. LangStrings, therefore this test fails also for semantically equal objects + } +} diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java new file mode 100644 index 000000000..b738b7278 --- /dev/null +++ b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + + +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; + +import org.apache.commons.io.IOUtils; + +/** + * Helper class for Serializer Tests + * + * @author sbader + * + */ +public class SerializerUtil { + + public static String readResourceToString(String resourceName) throws IOException { + ClassLoader classloader = Thread.currentThread().getContextClassLoader(); + InputStream is = classloader.getResourceAsStream(resourceName); + StringWriter writer = new StringWriter(); + IOUtils.copy(is, writer, "UTF-8"); + return writer.toString(); + } + + public static String stripWhitespaces(String input) { + return input.replaceAll("\\s+", ""); + } + +} diff --git a/dataformat-rdf/src/test/resources/AASFull.ttl b/dataformat-rdf/src/test/resources/AASFull.ttl new file mode 100644 index 000000000..8c11c4546 --- /dev/null +++ b/dataformat-rdf/src/test/resources/AASFull.ttl @@ -0,0 +1,354 @@ +@prefix aas: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xs: . + +# AAS Environment + rdf:type aas:Environment ; + ; + ; + ; +. + + +# Asset Administration Shell + rdf:type aas:AssetAdministrationShell ; + "ExampleMotor"^^xs:string ; + rdfs:label "ExampleMotor"^^xs:string ; + "A very short description of the AAS instance"@en ; + rdfs:comment "A very short description of the AAS instance."^^xs:string ; + "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; + [ + rdf:type ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; + ] ; + ] ; + ; + ]; + + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ] + ]; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; + ] + ]; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^xs:string ; + ] + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "TechnicalData"^^xs:string ; + rdfs:label "TechnicalData"^^xs:string ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#01-AFZ615#016"^^xs:string ; + ] ; + ] ; + + + [ + rdf:type aas:Property ; + rdfs:label "MaxRotationSpeed"^^xs:string ; + "MaxRotationSpeed"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#02-BAA120#008"^^xs:string ; + ] ; + ]; + "5000"^^xs:string ; + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "OperationalData"^^xs:string ; + rdfs:label "OperationalData"^^xs:string ; + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; + ; + + [ + rdf:type aas:Property ; + rdfs:label "RotationSpeed"^^xs:string ; + "RotationSpeed"^^xs:string ; + ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://customer.com/cd/1/1/18EBD56F6B43D895"^^xs:string ; + ] + + ]; + "4370"^^xs:string ; + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "Documentation"^^xs:string ; + rdfs:label "Documentation"^^xs:string ; + " ; + [ + rdf:type aas:SubmodelElementList ; + "OperatingManual"^^xs:string ; + rdfs:label "OperatingManual"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; + ] + ] ; + ; + [ + rdf:type aas:SubmodelElementCollection ; + [ + rdf:type ; + rdf:subject ; + rdfs:label "Title"^^xs:string ; + "application/pdf" ; + "file:///aas/OperatingManual.pdf"^^xs:string ; # TODO + "Title"^^xs:string ; + "CONSTANT"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; + ] + ] ; + ; + ] + ]; + [ + rdf:type aas:SubmodelElementCollection ; + [ + rdf:type aas:File; + rdf:subject ; + rdfs:label "DigitalFile_PDF"^^xs:string ; + "application/pdf" ; + "file:///aasx/OperatingManual.pdf"^^xs:string ; + "DigitalFile_PDF"^^xs:string ; + "CONSTANT"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^xs:string ; + ] + ] ; + ; + ]; + ] ; + ; + ] ; +. + + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "MaxRotationSpeed"^^xs:string ; + rdfs:label "MaxRotationSpeed"^^xs:string ; + "PARAMETER"^^xs:string ; + "0173-1#02-BAA120#008"^^xs:string ; + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; +. + + rdf:type aas:DataSpecificationIEC61360 ; + "Max. rotation speed"@en, "max. Drehzahl"@de ; + "1/min"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#05-AAA650#002"^^xs:string ; + ] ; + ] ; + ; + "Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf"@de, "Greatest permissible rotation speed with which the motor or feeding unit may be operated"@en ; + . + + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "RotationSpeed"^^xs:string ; + rdfs:label "RotationSpeed"^^xs:string ; + "PROPERTY"^^xs:string ; + "https://customer.com/cd/18EBD56F6B43D895/RotationSpeed"^^xs:string ; + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] . + + rdf:type aas:DataSpecificationIEC61360 ; + "Actual rotation speed"@en, "Aktuelle Drehzahl"@de ; + "1/min"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#05-AAA650#002"^^xs:string ; + ] ; + ] ; + ; + "Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird."@de, "Actual rotation speed with which the motor or feeding unit is operated."@en ; +. + + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "Document"^^xs:string ; + rdfs:label "Document"^^xs:string ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; + + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; +. + + rdf:type aas:DataSpecificationIEC61360 ; + "Document"@en, "Dokument"@de ; + "Document"@en ; + "[ISO 15519-1:2010]"^^xs:string ; + ; + "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann."@de ; +. + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "Title"^^xs:string ; + rdfs:label "Title"^^xs:string ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; + + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; + . + + rdf:type aas:DataSpecificationIEC61360 ; + "Titel"@en, "Titel"@de ; + "Titel"@en ; + ; + "Sprachabhängiger Titel des Dokuments."@de ; +. + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "DigitalFile"^^xs:string ; + rdfs:label "DigitalFile"^^xs:string ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile"^^xs:string ; + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; +. + + + rdf:type aas:DataSpecificationIEC61360 ; + "Digital File"@en ; + "DigitalFile"@en ; + ; + "Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden."@de ; +. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt b/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt new file mode 100644 index 000000000..65b752bdc --- /dev/null +++ b/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt @@ -0,0 +1,16 @@ + . + "ExampleMotor"^^ . + "ExampleMotor"^^ . + "A very short description of the AAS instance"@en . + "A very short description of the AAS instance."^^ . + "https://customer.com/aas/9175_7013_7091_9168"^^ . + _:AssetInformation . +_:AssetInformation . +_:AssetInformation _:GlobalAssetId . +_:AssetInformation . +_:GlobalAssetId . +_:GlobalAssetId . +_:GlobalAssetId _:Key . +_:Key . +_:Key . +_:Key "https://customer.com/assets/KHBVZJSQKIY"^^ . \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl b/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl new file mode 100644 index 000000000..e22b250fd --- /dev/null +++ b/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl @@ -0,0 +1,27 @@ +@prefix : . +@prefix aas: . +@prefix rdf: . +@prefix rdfs: . +@prefix xs: . + + + rdf:type aas:AssetAdministrationShell ; + "ExampleMotor"^^xs:string ; + rdfs:label "ExampleMotor"^^xs:string ; + "A very short description of the AAS instance"@en ; + rdfs:comment "A very short description of the AAS instance."^^xs:string ; + "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; + [ + rdf:type ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; + ] ; + ] ; + ; + ]; +. diff --git a/dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl b/dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl new file mode 100644 index 000000000..e5f25bfe6 --- /dev/null +++ b/dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl @@ -0,0 +1,56 @@ +@prefix aas: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xs: . + + +# Asset Administration Shell + rdf:type aas:AssetAdministrationShell ; + "ExampleMotor"^^xs:string ; + rdfs:label "ExampleMotor"^^xs:string ; + "A very short description of the AAS instance"@en ; + rdfs:comment "A very short description of the AAS instance."^^xs:string ; + "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; + [ + rdf:type ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; + ] ; + ] ; + ; + ]; + + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ] + ]; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; + ] + ]; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^xs:string ; + ] + ]; +. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Complete_Example.ttl b/dataformat-rdf/src/test/resources/Complete_Example.ttl new file mode 100644 index 000000000..0c800f8d1 --- /dev/null +++ b/dataformat-rdf/src/test/resources/Complete_Example.ttl @@ -0,0 +1,347 @@ +@prefix aas: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xs: . + + +# Asset Administration Shell + rdf:type aas:AssetAdministrationShell ; + "ExampleMotor"^^xs:string ; + rdfs:label "ExampleMotor"^^xs:string ; + "A very short description of the AAS instance"@en ; + rdfs:comment "A very short description of the AAS instance."^^xs:string ; + "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; + [ + rdf:type ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; + ] ; + ] ; + ; + ]; + + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ] + ]; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; + ] + ]; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^xs:string ; + ] + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "TechnicalData"^^xs:string ; + rdfs:label "TechnicalData"^^xs:string ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#01-AFZ615#016"^^xs:string ; + ] ; + ] ; + + + [ + rdf:type aas:Property ; + rdfs:label "MaxRotationSpeed"^^xs:string ; + "MaxRotationSpeed"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#02-BAA120#008"^^xs:string ; + ] ; + ]; + "5000"^^xs:string ; + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "OperationalData"^^xs:string ; + rdfs:label "OperationalData"^^xs:string ; + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; + ; + + [ + rdf:type aas:Property ; + rdfs:label "RotationSpeed"^^xs:string ; + "RotationSpeed"^^xs:string ; + ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://customer.com/cd/1/1/18EBD56F6B43D895"^^xs:string ; + ] + + ]; + "4370"^^xs:string ; + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "Documentation"^^xs:string ; + rdfs:label "Documentation"^^xs:string ; + " ; + [ + rdf:type aas:SubmodelElementList ; + "OperatingManual"^^xs:string ; + rdfs:label "OperatingManual"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; + ] + ] ; + ; + [ + rdf:type aas:SubmodelElementCollection ; + [ + rdf:type ; + rdf:subject ; + rdfs:label "Title"^^xs:string ; + "application/pdf" ; + "file:///aas/OperatingManual.pdf"^^xs:string ; # TODO + "Title"^^xs:string ; + "CONSTANT"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; + ] + ] ; + ; + ] + ]; + [ + rdf:type aas:SubmodelElementCollection ; + [ + rdf:type aas:File; + rdf:subject ; + rdfs:label "DigitalFile_PDF"^^xs:string ; + "application/pdf" ; + "file:///aasx/OperatingManual.pdf"^^xs:string ; + "DigitalFile_PDF"^^xs:string ; + "CONSTANT"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^xs:string ; + ] + ] ; + ; + ]; + ] ; + ; + ] ; +. + + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "MaxRotationSpeed"^^xs:string ; + rdfs:label "MaxRotationSpeed"^^xs:string ; + "PARAMETER"^^xs:string ; + "0173-1#02-BAA120#008"^^xs:string ; + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; +. + + rdf:type aas:DataSpecificationIEC61360 ; + "Max. rotation speed"@en, "max. Drehzahl"@de ; + "1/min"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#05-AAA650#002"^^xs:string ; + ] ; + ] ; + ; + "Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf"@de, "Greatest permissible rotation speed with which the motor or feeding unit may be operated"@en ; + . + + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "RotationSpeed"^^xs:string ; + rdfs:label "RotationSpeed"^^xs:string ; + "PROPERTY"^^xs:string ; + "https://customer.com/cd/18EBD56F6B43D895/RotationSpeed"^^xs:string ; + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] . + + rdf:type aas:DataSpecificationIEC61360 ; + "Actual rotation speed"@en, "Aktuelle Drehzahl"@de ; + "1/min"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#05-AAA650#002"^^xs:string ; + ] ; + ] ; + ; + "Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird."@de, "Actual rotation speed with which the motor or feeding unit is operated."@en ; +. + + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "Document"^^xs:string ; + rdfs:label "Document"^^xs:string ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; + + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; +. + + rdf:type aas:DataSpecificationIEC61360 ; + "Document"@en, "Dokument"@de ; + "Document"@en ; + "[ISO 15519-1:2010]"^^xs:string ; + ; + "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann."@de ; +. + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "Title"^^xs:string ; + rdfs:label "Title"^^xs:string ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; + + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; + . + + rdf:type aas:DataSpecificationIEC61360 ; + "Titel"@en, "Titel"@de ; + "Titel"@en ; + ; + "Sprachabhängiger Titel des Dokuments."@de ; +. + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "DigitalFile"^^xs:string ; + rdfs:label "DigitalFile"^^xs:string ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile"^^xs:string ; + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; +. + + + rdf:type aas:DataSpecificationIEC61360 ; + "Digital File"@en ; + "DigitalFile"@en ; + ; + "Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden."@de ; +. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Overall-Example.nt b/dataformat-rdf/src/test/resources/Overall-Example.nt new file mode 100644 index 000000000..3921c9aff --- /dev/null +++ b/dataformat-rdf/src/test/resources/Overall-Example.nt @@ -0,0 +1,253 @@ + . + "ExampleMotor"^^ . + "ExampleMotor"^^ . + "A very short description of the AAS instance"@en . + "A very short description of the AAS instance."^^ . + "https://customer.com/aas/9175_7013_7091_9168"^^ . + _:AssetInformation . + _:Submodel1 . + _:Submodel2 . + _:Submodel3 . +_:AssetInformation . +_:AssetInformation _:GlobalAssetId1 . +_:AssetInformation . +_:GlobalAssetId1 . +_:GlobalAssetId1 . +_:GlobalAssetId1 _:Key1 . +_:Key1 . +_:Key1 . +_:Key1 "https://customer.com/assets/KHBVZJSQKIY"^^ . +_:Submodel1 . +_:Submodel1 . +_:Submodel1 _:Key2 . +_:Key2 . +_:Key2 . +_:Key2 "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^ . +_:Submodel2 . +_:Submodel2 . +_:Submodel2 _:Key3 . +_:Key3 . +_:Key3 . +_:Key3 "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^ . +_:Submodel3 . +_:Submodel3 . +_:Submodel3 _:Key4 . +_:Key4 . +_:Key4 . +_:Key4 "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^ . + . + "TechnicalData"^^ . + "TechnicalData"^^ . + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^ . + . + _:SemanticId1 . + _:SubmodelElement1 . +_:SemanticId1 . +_:SemanticId1 . +_:SemanticId1 _:Key5 . +_:Key5 . +_:Key5 . +_:Key5 "0173-1#01-AFZ615#016"^^ . +_:SubmodelElement1 . +_:SubmodelElement1 "MaxRotationSpeed"^^ . +_:SubmodelElement1 "MaxRotationSpeed"^^ . +_:SubmodelElement1 . +_:SubmodelElement1 _:ValueId1 . +_:SubmodelElement1 "5000"^^ . +_:ValueId1 . +_:ValueId1 . +_:ValueId1 _:Key6 . +_:Key6 . +_:Key6 . +_:Key6 "0173-1#02-BAA120#008"^^ . + . + "OperationalData"^^ . + "OperationalData"^^ . + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^ . + . + _:SubmodelElement2 . +_:SubmodelElement2 . +_:SubmodelElement2 "RotationSpeed"^^ . +_:SubmodelElement2 "RotationSpeed"^^ . +_:SubmodelElement2 . +_:SubmodelElement2 . +_:SubmodelElement2 _:ValueId2 . +_:SubmodelElement2 "4370"^^ . +_:ValueId2 . +_:ValueId2 . +_:ValueId2 _:Key7 . +_:Key7 . +_:Key7 . +_:Key7 "http://customer.com/cd/1/1/18EBD56F6B43D895"^^ . + . + "Documentation"^^ . + "Documentation"^^ . + " . + . + _:SubmodelElement3 . +_:SubmodelElement3 . +_:SubmodelElement3 "OperatingManual"^^ . +_:SubmodelElement3 "OperatingManual"^^ . +_:SubmodelElement3 _:SemanticIdListElement1 . +_:SubmodelElement3 . +_:SubmodelElement3 _:Value1 . +_:SubmodelElement3 _:Value3 . +_:SubmodelElement3 . +_:SemanticIdListElement1 . +_:SemanticIdListElement1 . +_:SemanticIdListElement1 _:Key8 . +_:Key8 . +_:Key8 . +_:Key8 "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^ . +_:Value1 . +_:Value1 _:Value2 . +_:Value2 . +_:Value2 . +_:Value2 "Title"^^ . +_:Value2 "application/pdf" . +_:Value2 "file:///aas/OperatingManual.pdf"^^ . +_:Value2 "Title"^^ . +_:Value2 "CONSTANT"^^ . +_:Value2 _:SemanticId2 . +_:Value2 . +_:SemanticId2 . +_:SemanticId2 . +_:SemanticId2 _:Key9 . +_:Key9 . +_:Key9 . +_:Key9 "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^ . +_:Value3 . +_:Value3 _:Value4 . +_:Value4 . +_:Value4 . +_:Value4 "DigitalFile_PDF"^^ . +_:Value4 "application/pdf" . +_:Value4 "file:///aasx/OperatingManual.pdf"^^ . +_:Value4 "DigitalFile_PDF"^^ . +_:Value4 "CONSTANT"^^ . +_:Value4 _:SemanticId3. +_:Value4 . +_:SemanticId3 . +_:SemanticId3 . +_:SemanticId3 _:Key10 . +_:Key10 . +_:Key10 . +_:Key10 "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^ . + . + "MaxRotationSpeed"^^ . + "MaxRotationSpeed"^^ . + "PARAMETER"^^ . + "0173-1#02-BAA120#008"^^ . + _:EmbeddedDataSpecification1 . +_:EmbeddedDataSpecification1 . +_:EmbeddedDataSpecification1 _:DataSpecification1 . +_:EmbeddedDataSpecification1 . +_:DataSpecification1 . +_:DataSpecification1 . +_:DataSpecification1 _:Key11 . +_:Key11 . +_:Key11 . +_:Key11 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . + . + "Max. rotation speed"@en . + "max. Drehzahl"@de . + "1/min"^^ . + _:UnitId1 . + . + "H\u00F6chste zul\u00E4ssige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf"@de . + "Greatest permissible rotation speed with which the motor or feeding unit may be operated"@en . +_:UnitId1 . +_:UnitId1 . +_:UnitId1 _:Key12 . +_:Key12 . +_:Key12 . +_:Key12 "0173-1#05-AAA650#002"^^ . + . + "RotationSpeed"^^ . + "RotationSpeed"^^ . + "PROPERTY"^^ . + "https://customer.com/cd/18EBD56F6B43D895/RotationSpeed"^^ . + _:EmbeddedDataSpecification2 . +_:EmbeddedDataSpecification2 . +_:EmbeddedDataSpecification2 _:DataSpecification2 . +_:EmbeddedDataSpecification2 . +_:DataSpecification2 . +_:DataSpecification2 . +_:DataSpecification2 _:Key13 . +_:Key13 . +_:Key13 . +_:Key13 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . + . + "Actual rotation speed"@en . + "Aktuelle Drehzahl"@de . + "1/min"^^ . + _:UnitId2 . + . + "Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird."@de . + "Actual rotation speed with which the motor or feeding unit is operated."@en . +_:UnitId2 . +_:UnitId2 . +_:UnitId2 _:Key14 . +_:Key14 . +_:Key14 . +_:Key14 "0173-1#05-AAA650#002"^^ . + . + "Document"^^ . + "Document"^^ . + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^ . + _:EmbeddedDataSpecification3 . +_:EmbeddedDataSpecification3 . +_:EmbeddedDataSpecification3 _:DataSpecification3 . +_:EmbeddedDataSpecification3 . +_:DataSpecification3 . +_:DataSpecification3 . +_:DataSpecification3 _:Key15 . +_:Key15 . +_:Key15 . +_:Key15 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . + . + "Document"@en . + "Dokument"@de . + "Document"@en . + "[ISO 15519-1:2010]"^^ . + . + "Feste und geordnete Menge von f\u00FCr die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann."@de . + . + "Title"^^ . + "Title"^^ . + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^ . + _:EmbeddedDataSpecification4 . +_:EmbeddedDataSpecification4 . +_:EmbeddedDataSpecification4 _:DataSpecification4 . +_:EmbeddedDataSpecification4 . +_:DataSpecification4 . +_:DataSpecification4 . +_:DataSpecification4 _:Key16 . +_:Key16 . +_:Key16 . +_:Key16 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . + . + "Titel"@en . + "Titel"@de . + "Titel"@en . + . + "Sprachabh\u00E4ngiger Titel des Dokuments."@de . + . + "DigitalFile"^^ . + "DigitalFile"^^ . + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile"^^ . + _:EmbeddedDataSpecification5 . +_:EmbeddedDataSpecification5 . +_:EmbeddedDataSpecification5 _:DataSpecification5 . +_:EmbeddedDataSpecification5 . +_:DataSpecification5 . +_:DataSpecification5 . +_:DataSpecification5 _:Key17 . +_:Key17 . +_:Key17 . +_:Key17 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . + . + "Digital File"@en . + "DigitalFile"@en . + . + "Eine Datei, die die DocumentVersion repr\u00E4sentiert. Neben der obligatorischen PDF/A Datei k\u00F6nnen weitere Dateien angegeben werden."@de . \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/ReferenceExample.ttl b/dataformat-rdf/src/test/resources/ReferenceExample.ttl new file mode 100644 index 000000000..a18db83e5 --- /dev/null +++ b/dataformat-rdf/src/test/resources/ReferenceExample.ttl @@ -0,0 +1,18 @@ +@prefix xs: . + +# 1) Reference with KeyElements + a ; + [ + a ; + ; + [ + a ; + ; + [ + a ; + ; + "http://customer.com/assets/KHBVZJSQKIY"^^xs:string ; + ] + ] + ] ; +. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl new file mode 100644 index 000000000..3e50807d6 --- /dev/null +++ b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl @@ -0,0 +1,137 @@ +@prefix aas: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xs: . + + + +# Submodel + rdf:type aas:Submodel ; + "TechnicalData"^^xs:string ; + rdfs:label "TechnicalData"^^xs:string ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#01-AFZ615#016"^^xs:string ; + ] ; + ] ; + + + [ + rdf:type aas:Property ; + rdfs:label "MaxRotationSpeed"^^xs:string ; + "MaxRotationSpeed"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#02-BAA120#008"^^xs:string ; + ] ; + ]; + "5000"^^xs:string ; + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "OperationalData"^^xs:string ; + rdfs:label "OperationalData"^^xs:string ; + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; + ; + + [ + rdf:type aas:Property ; + rdfs:label "RotationSpeed"^^xs:string ; + "RotationSpeed"^^xs:string ; + ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://customer.com/cd/1/1/18EBD56F6B43D895"^^xs:string ; + ] + + ]; + "4370"^^xs:string ; + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "Documentation"^^xs:string ; + rdfs:label "Documentation"^^xs:string ; + " ; + [ + rdf:type aas:SubmodelElementList ; + "OperatingManual"^^xs:string ; + rdfs:label "OperatingManual"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; + ] + ] ; + ; + [ + rdf:type aas:SubmodelElementCollection ; + [ + rdf:type ; + rdf:subject ; + rdfs:label "Title"^^xs:string ; + "application/pdf" ; + "file:///aas/OperatingManual.pdf"^^xs:string ; # TODO + "Title"^^xs:string ; + "CONSTANT"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; + ] + ] ; + ; + ] + ]; + [ + rdf:type aas:SubmodelElementCollection ; + [ + rdf:type aas:File; + rdf:subject ; + rdfs:label "DigitalFile_PDF"^^xs:string ; + "application/pdf" ; + "file:///aasx/OperatingManual.pdf"^^xs:string ; + "DigitalFile_PDF"^^xs:string ; + "CONSTANT"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^xs:string ; + ] + ] ; + ; + ]; + ] ; + ; + ] ; +. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt new file mode 100644 index 000000000..2733f1131 --- /dev/null +++ b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt @@ -0,0 +1,25 @@ + . + "TechnicalData"^^ . + "TechnicalData"^^ . + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^ . + . + _:SemanticId . + _:SubmodelElements . +_:SemanticId . +_:SemanticId . +_:SemanticId _:Key1 . +_:Key1 . +_:Key1 . +_:Key1 "0173-1#01-AFZ615#016"^^ . +_:SubmodelElements . +_:SubmodelElements "MaxRotationSpeed"^^ . +_:SubmodelElements "MaxRotationSpeed"^^ . +_:SubmodelElements . +_:SubmodelElements _:ValueId . +_:SubmodelElements "5000"^^ . +_:ValueId . +_:ValueId . +_:ValueId _:Key2 . +_:Key2 . +_:Key2 . +_:Key2 "0173-1#02-BAA120#008"^^ . \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl new file mode 100644 index 000000000..9c1d7f8c4 --- /dev/null +++ b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl @@ -0,0 +1,42 @@ +@prefix aas: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xs: . + + + +# Submodel + rdf:type aas:Submodel ; + "TechnicalData"^^xs:string ; + rdfs:label "TechnicalData"^^xs:string ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#01-AFZ615#016"^^xs:string ; + ] ; + ] ; + + + [ + rdf:type aas:Property ; + rdfs:label "MaxRotationSpeed"^^xs:string ; + "MaxRotationSpeed"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#02-BAA120#008"^^xs:string ; + ] ; + ]; + "5000"^^xs:string ; + ]; +. diff --git a/dataformat-rdf/src/test/resources/example-from-serializer.jsonld b/dataformat-rdf/src/test/resources/example-from-serializer.jsonld new file mode 100644 index 000000000..7eac7fa6c --- /dev/null +++ b/dataformat-rdf/src/test/resources/example-from-serializer.jsonld @@ -0,0 +1,88 @@ +{ + "@context" : { + "aas" : "https://admin-shell.io/aas/3/0/RC02/" + }, + "@id" : "https://admin-shell.io/autogen/DefaultEnvironment/7e646a58-7419-41e2-99e8-163a7abb7b46", + "@type" : "aas:Environment", + "https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells" : [ { + "@id" : "https://admin-shell.io/autogen/DefaultAssetAdministrationShell/b869a629-8d69-4754-9c50-804b0e9eb35a", + "@type" : "aas:AssetAdministrationShell", + "https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation" : { + "@id" : "https://admin-shell.io/autogen/DefaultAssetInformation/6882a093-6831-445d-a884-f2ebc37aaa29", + "@type" : "aas:AssetInformation", + "https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind" : { + "@type" : "aas:AssetKind", + "@id" : "https://admin-shell.io/aas/3/0/RC02/AssetKind/Instance" + }, + "https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds" : [ ] + }, + "https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodel" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiation" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension" : [ ], + "https://admin-shell.io/aas/3/0/RC02/Referable/description" : [ { + "@language" : "en-us", + "@value" : "This is a test AAS" + } ], + "https://admin-shell.io/aas/3/0/RC02/Referable/displayName" : [ { + "@language" : "de", + "@value" : "Anzeigename 2" + }, { + "@language" : "en", + "@value" : "Display Name 1" + } ], + "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications" : [ ] + } ], + "https://admin-shell.io/aas/3/0/RC02/Environment/conceptdescriptions" : [ { + "@id" : "https://admin-shell.io/autogen/DefaultConceptDescription/14b4a819-7ca0-4cb2-b2c7-33a1c443c899", + "@type" : "aas:ConceptDescription", + "https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications" : [ { + "@id" : "https://admin-shell.io/autogen/DefaultDataSpecification/66cf9a6c-e656-4c95-91be-2ddc1779ec71", + "@type" : "aas:EmbeddedDataSpecification", + "https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecifiation" : { + "@id" : "https://admin-shell.io/autogen/DefaultReference/251d9f19-b36b-4c39-b517-3d7e93bd8c96", + "@type" : "aas:Reference", + "https://admin-shell.io/aas/3/0/RC02/Reference/key" : [ { + "@id" : "https://admin-shell.io/autogen/DefaultKey/ad4e8527-e002-4776-87ca-7049e7be440f", + "@type" : "aas:Key", + "https://admin-shell.io/aas/3/0/RC02/Key/value" : "https://example.org" + } ] + } , + "https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent" : { + "@id" : "https://admin-shell.io/autogen/DefaultDataSpecificationIEC61360/5319d62e-7ca1-4954-addf-76db6bf1e241", + "@type" : "aas:DataSpecificationIEC61360", + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType" : { + "@type" : "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/DataTypeIEC61360", + "@id" : "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/RATIONAL" + }, + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition" : [ ], + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName" : [ ], + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName" : [ ] + }, + "https://admin-shell.io/aas/3/0/RC02/DataSpecification/id" : "http://example.org/DataSpecification1" + } ] + } ], + "https://admin-shell.io/aas/3/0/RC02/Environment/submodels" : [ { + "@id" : "https://admin-shell.io/autogen/DefaultSubmodel/18810336-c309-42f8-9986-438f7068f0d6", + "@type" : "aas:Submodel", + "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiation" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds" : [ ], + "https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifier" : [ ], + "https://admin-shell.io/aas/3/0/RC02/Referable/category" : "Example category", + "https://admin-shell.io/aas/3/0/RC02/Referable/description" : [ { + "@language" : "en-us", + "@value" : "My Submodel" + } ], + "https://admin-shell.io/aas/3/0/RC02/Referable/displayName" : [ { + "@language" : "en", + "@value" : "First Submodel Element name" + }, { + "@language" : "en", + "@value" : "Second Submodel Element name" + } ], + "https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElement" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications" : [ ] + } ] +} \ No newline at end of file From 3037e7113d339deb5d7318fdc416282db2cbedfa Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 29 Jun 2023 15:02:21 +0200 Subject: [PATCH 07/59] Update dataformat-xml project --- .../AasXmlNamespaceContext.java | 17 +- .../SubmodelElementManager.java | 34 +- .../XmlDataformatAnnotationIntrospector.java | 10 +- .../v3/dataformat/xml/XmlDeserializer.java | 130 +- .../v3/dataformat/xml/XmlSerializer.java | 111 +- ...mbeddedDataSpecificationsDeserializer.java | 41 +- .../LangStringNodeDeserializer.java | 34 + .../LangStringsDeserializer.java | 25 + .../OperationVariableDeserializer.java | 22 +- .../QualifierDeserializer.java | 16 +- .../ReferencesDeserializer.java | 6 +- .../SubmodelElementDeserializer.java | 3 +- .../SubmodelElementsDeserializer.java | 17 +- .../mixins/AssetAdministrationShellMixin.java | 12 +- .../xml/mixins/AssetInformationMixin.java | 29 +- .../xml/mixins/ConceptDescriptionMixin.java | 9 +- .../DataSpecificationIec61360Mixin.java | 73 +- .../EmbeddedDataSpecificationMixin.java | 82 +- .../v3/dataformat/xml/mixins/EntityMixin.java | 21 +- .../xml/mixins/EnvironmentMixin.java | 4 +- .../xml/mixins/HasDataSpecificationMixin.java | 10 +- .../xml/mixins/HasExtensionsMixin.java | 3 +- .../v3/dataformat/xml/mixins/KeyMixin.java | 3 +- .../xml/mixins/LangStringMixin.java | 33 + .../mixins/MultiLanguagePropertyMixin.java | 22 +- .../dataformat/xml/mixins/OperationMixin.java | 20 +- .../xml/mixins/OperationVariableMixin.java | 4 +- .../xml/mixins/QualifiableMixin.java | 10 +- .../dataformat/xml/mixins/QualifierMixin.java | 11 +- .../dataformat/xml/mixins/ReferableMixin.java | 40 +- .../dataformat/xml/mixins/ReferenceMixin.java | 3 +- .../dataformat/xml/mixins/ResourceMixin.java | 9 +- .../xml/mixins/SpecificAssetIDMixin.java | 13 +- .../SubmodelElementCollectionMixin.java | 3 +- .../xml/mixins/SubmodelElementMixin.java | 7 +- .../dataformat/xml/mixins/SubmodelMixin.java | 7 +- .../dataformat/xml/mixins/ValueListMixin.java | 18 +- .../xml/mixins/ValueReferencePairMixin.java | 11 +- .../AbstractLangStringSerializer.java | 2 +- .../AbstractLangStringsSerializer.java | 4 +- ...inistrationShellEnvironmentSerializer.java | 19 +- .../serialization/DataElementsSerializer.java | 3 +- .../EmbeddedDataSpecificationSerializer.java | 22 +- .../xml/serialization/KeySerializer.java | 47 + .../serialization/LangStringSerializer.java | 67 + .../serialization/LangStringsSerializer.java | 52 + .../OperationVariableSerializer.java | 27 +- .../serialization/ReferenceSerializer.java | 48 + .../SubmodelElementSerializer.java | 12 +- .../SubmodelElementsSerializer.java | 5 +- dataformat-xml/src/main/resources/AAS.xsd | 1937 +++++--------- .../src/main/resources/AAS_ABAC.xsd | 167 ++ .../src/main/resources/IEC61360.xsd | 145 ++ .../dataformat/xml/XMLDeserializerTest.java | 63 +- .../v3/dataformat/xml/XmlSerializerTest.java | 110 +- .../v3/dataformat/xml/XmlValidationTest.java | 5 +- ...ple_AAS_ServoDCMotor - Simplified V2.0.xml | 436 ++++ .../resources/ServoDCMotor_invalid_V2.0.xml | 470 ++++ .../annotated_relationship_example.xml | 9 +- .../src/test/resources/invalidXmlExample.xml | 2 +- dataformat-xml/src/test/resources/minimum.xml | 7 +- .../src/test/resources/operation_example.xml | 47 +- .../src/test/resources/qualifier_example.xml | 6 +- .../test/resources/test_demo_full_example.xml | 2246 ++++++++++++----- .../src/test/resources/xmlExample.xml | 170 +- .../xmlExampleWithModifiedPrefix.xml | 171 +- 66 files changed, 4376 insertions(+), 2846 deletions(-) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{internal => }/AasXmlNamespaceContext.java (57%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{internal => }/SubmodelElementManager.java (52%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{internal => }/XmlDataformatAnnotationIntrospector.java (90%) create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java create mode 100644 dataformat-xml/src/main/resources/AAS_ABAC.xsd create mode 100644 dataformat-xml/src/main/resources/IEC61360.xsd create mode 100644 dataformat-xml/src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml create mode 100644 dataformat-xml/src/test/resources/ServoDCMotor_invalid_V2.0.xml diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java similarity index 57% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java index 05eded296..b7e4b1287 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; import java.util.HashMap; import java.util.Map; @@ -22,7 +23,16 @@ public class AasXmlNamespaceContext { public static final String AAS_PREFERRED_PREFIX = "aas"; - public static final String AAS_URI = "https://admin-shell.io/aas/3/0"; + public static final String AAS_URI = "https://admin-shell.io/aas/3/0/RC02"; + + public static final String ABAC_PREFERRED_PREFIX = "abac"; + public static final String ABAC_URI = "http://www.admin-shell.io/aas/abac/3/0"; + + public static final String COMMON_PREFERRED_PREFIX = "aas_common"; + public static final String COMMON_URI = "http://www.admin-shell.io/aas_common/3/0"; + + public static final String IEC61360_PREFERRED_PREFIX = "IEC61360"; + public static final String IEC61360_URI = "http://www.admin-shell.io/IEC61360/3/0"; public static final String XSI_PREFERRED_PREFIX = "xsi"; public static final String XSI_URI = "http://www.w3.org/2001/XMLSchema-instance"; @@ -31,6 +41,9 @@ public class AasXmlNamespaceContext { static { PREFERRED_PREFIX_CONTEXT.put(AAS_PREFERRED_PREFIX, AAS_URI); + PREFERRED_PREFIX_CONTEXT.put(ABAC_PREFERRED_PREFIX, ABAC_URI); + PREFERRED_PREFIX_CONTEXT.put(COMMON_PREFERRED_PREFIX, COMMON_URI); + PREFERRED_PREFIX_CONTEXT.put(IEC61360_PREFERRED_PREFIX, IEC61360_URI); PREFERRED_PREFIX_CONTEXT.put(XSI_PREFERRED_PREFIX, XSI_URI); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java similarity index 52% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java index dc4dbda68..e2a29a42b 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,34 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; + +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultCapability; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEventPayload; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; - public class SubmodelElementManager { public static Map, String> CLASS_TO_NAME = new HashMap<>(); @@ -61,13 +42,8 @@ public class SubmodelElementManager { CLASS_TO_NAME.put(DefaultEventPayload.class, "eventPayload"); CLASS_TO_NAME.put(DefaultOperation.class, "operation"); CLASS_TO_NAME.put(DefaultOperationVariable.class, "operationVariable"); - CLASS_TO_NAME.put(DefaultLangStringTextType.class, "langStringTextType"); - CLASS_TO_NAME.put(DefaultLangStringNameType.class, "langStringNameType"); - CLASS_TO_NAME.put(DefaultLangStringDefinitionTypeIec61360.class, "langStringDefinitionTypeIec61360"); - CLASS_TO_NAME.put(DefaultLangStringPreferredNameTypeIec61360.class, "langStringPreferredNameTypeIec61360"); - CLASS_TO_NAME.put(DefaultLangStringShortNameTypeIec61360.class, "langStringShortNameTypeIec61360"); + CLASS_TO_NAME.put(DefaultLangString.class, "langString"); CLASS_TO_NAME.put(DefaultSubmodelElementCollection.class, "submodelElementCollection"); - CLASS_TO_NAME.put(DefaultSubmodelElementList.class, "submodelElementList"); NAME_TO_CLASS = CLASS_TO_NAME.entrySet().stream().collect(Collectors.toMap(x -> x.getValue(), x -> x.getKey())); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java similarity index 90% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java index 0b886d776..4e157a834 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; import java.util.Collection; @@ -24,7 +25,7 @@ import com.fasterxml.jackson.databind.introspect.AnnotatedMethod; import com.fasterxml.jackson.dataformat.xml.JacksonXmlAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; /** * This class helps to dynamically decide how to de-/serialize classes and @@ -45,9 +46,8 @@ public XmlDataformatAnnotationIntrospector() { myDefaultNamespace = AasXmlNamespaceContext.AAS_URI; } - @Override public String findNamespace(MapperConfig config, Annotated ann) { - String ns = super.findNamespace(null, ann); + String ns = super.findNamespace(config, ann); if (ns == null) { return myDefaultNamespace; } else { @@ -60,7 +60,7 @@ public String[] findSerializationPropertyOrder(AnnotatedClass ac) { String[] order = super.findSerializationPropertyOrder(ac); if (order == null) { order = new String[] { - "extensions", "idShort", "displayName", "category", "description", "administration", "identification", "kind", "semanticId", + "extensions", "idShort", "displayNames", "category", "descriptions", "administration", "identification", "kind", "semanticId", "qualifiers", "embeddedDataSpecification", "dataSpecifications", "isCaseOf", "security", "derivedFrom", "submodels", "assetInformation", "views", "externalSubjectId", "key", "allowDuplicates", "ordered", "valueId", "value", "max", "min", "type", "valueType", "mimeType", "first", "second", "annotations", "revision", "version", "defaultThumbnail", "globalAssetId", "externalAssetId", "entityType", "statements", "assetKind", "billOfMaterials", "specificAssetIds", "observed", "inoutputVariables", "inputVariables", "outputVariables", "submodelElements", "containedElements" diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java index 42ec3687b..cdbafe570 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,54 +16,37 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; -import java.io.*; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.Map; -import java.util.stream.Collectors; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; -public class XmlDeserializer { +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +public class XmlDeserializer implements Deserializer { - protected final XmlFactory xmlFactory; protected XmlMapper mapper; protected SimpleAbstractTypeResolver typeResolver; - @SuppressWarnings("rawtypes") - protected static Map, JsonDeserializer> customDeserializers = Map.of( + protected static Map, com.fasterxml.jackson.databind.JsonDeserializer> customDeserializers = Map.of( SubmodelElement.class, new SubmodelElementDeserializer()); - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - - public XmlDeserializer() { - this(new XmlFactory()); - } - - public XmlDeserializer(XmlFactory xmlFactory) { - this.xmlFactory = xmlFactory; initTypeResolver(); buildMapper(); } protected void buildMapper() { - mapper = XmlMapper.builder(xmlFactory) - .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) + mapper = XmlMapper.builder().enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .serializationInclusion(JsonInclude.Include.NON_NULL) .annotationIntrospector(new XmlDataformatAnnotationIntrospector()) @@ -79,8 +63,7 @@ protected SimpleModule buildCustomDeserializerModule() { return module; } - @SuppressWarnings("unchecked") - private void initTypeResolver() { + private void initTypeResolver() { typeResolver = new SimpleAbstractTypeResolver(); ReflectionHelper.DEFAULT_IMPLEMENTATIONS .stream() @@ -100,15 +83,7 @@ protected SimpleModule buildImplementationModule() { return module; } - /** - * Deserializes a given string into an instance of - * AssetAdministrationShellEnvironment - * - * @param value a string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ + @Override public Environment read(String value) throws DeserializationException { try { return mapper.readValue(value, Environment.class); @@ -117,82 +92,7 @@ public Environment read(String value) throws DeserializationException { } } - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param src an InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src) throws DeserializationException { - return read(src, DEFAULT_CHARSET); - } - - - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param src An InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src, Charset charset) throws DeserializationException { - return read(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator()))); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param file A java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file, Charset charset) - throws FileNotFoundException, DeserializationException { - return read(new FileInputStream(file), charset); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param file a java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if the file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { - return read(file, DEFAULT_CHARSET); - } - - /** - * Enables usage of custom implementation to be used for deserialization - * instead of default implementation, e.g. defining a custom implementation - * of the Submodel interface {@code class - * CustomSubmodel implements Submodel {}} and calling - * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will - * result in all instances of Submodel will be deserialized as - * CustomSubmodel. Subsequent class with the same aasInterface parameter - * will override the effects of all previous calls. - * - * @param the type of the interface to replace - * @param aasInterface the class of the interface to replace - * @param implementation the class implementing the interface that should be - * used for deserialization. - */ + @Override public void useImplementation(Class aasInterface, Class implementation) { typeResolver.addMapping(aasInterface, implementation); buildMapper(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java index e7b28aafa..419f9632a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,18 +16,19 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; -import java.io.*; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.Map; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.AssetAdministrationShellEnvironmentSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.OperationVariableSerializer; +// TODO import io.adminshell.aas.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; +// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; import com.fasterxml.jackson.annotation.JsonInclude; @@ -35,34 +37,25 @@ import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -public class XmlSerializer { - protected final XmlFactory xmlFactory; +public class XmlSerializer implements Serializer { protected XmlMapper mapper; protected Map namespacePrefixes; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - public XmlSerializer() { this(null); } public XmlSerializer(Map namespacePrefixes) { - this(new XmlFactory(), namespacePrefixes); - } - - public XmlSerializer(XmlFactory xmlFactory, Map namespacePrefixes) { - this.xmlFactory = xmlFactory; this.namespacePrefixes = namespacePrefixes; buildMapper(); } protected void buildMapper() { - mapper = XmlMapper.builder(xmlFactory) + mapper = XmlMapper.builder() .enable(SerializationFeature.INDENT_OUTPUT) .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .serializationInclusion(JsonInclude.Include.NON_NULL) @@ -77,6 +70,7 @@ protected void buildMapper() { protected SimpleModule buildCustomSerializerModule() { SimpleModule module = new SimpleModule(); + // TODO: module.addSerializer(EmbeddedDataSpecification.class, new EmbeddedDataSpecificationSerializer()); AssetAdministrationShellEnvironmentSerializer aasEnvSerializer; if (namespacePrefixes != null) { aasEnvSerializer = new AssetAdministrationShellEnvironmentSerializer(namespacePrefixes); @@ -84,7 +78,11 @@ protected SimpleModule buildCustomSerializerModule() { aasEnvSerializer = new AssetAdministrationShellEnvironmentSerializer(); } module.addSerializer(Environment.class, aasEnvSerializer); - module.addSerializer(OperationVariable.class, new OperationVariableSerializer()); +// module.addSerializer(Key.class, new KeySerializer()); +// module.addSerializer(Reference.class, new ReferenceSerializer()); + module.addSerializer(LangString.class, new LangStringSerializer()); +// module.addSerializer(new LangStringsSerializer()); +module.addSerializer(OperationVariable.class, new OperationVariableSerializer()); return module; } @@ -94,15 +92,7 @@ protected SimpleModule buildEnumModule() { return module; } - /** - * Serializes a given instance of AssetAdministrationShellEnvironment to - * string - * - * @param aasEnvironment the AssetAdministrationShellEnvironment to - * serialize - * @return the string representation of the environment - * @throws SerializationException if serialization fails - */ + @Override public String write(Environment aasEnvironment) throws SerializationException { try { ObjectWriter writer = mapper.writer(); @@ -111,73 +101,4 @@ public String write(Environment aasEnvironment) throws SerializationException { throw new SerializationException("serialization failed", ex); } } - - - /** - * Serializes a given instance of Environment to an - * OutputStream using DEFAULT_CHARSET - * - * @param out the Outputstream to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { - write(out, DEFAULT_CHARSET, aasEnvironment); - } - - /** - * Serializes a given instance of Environment to an - * OutputStream using given charset - * - * @param out the Outputstream to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Charset charset, Environment aasEnvironment) - throws IOException, SerializationException { - try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { - writer.write(write(aasEnvironment)); - } - } - - // Note that the AAS also defines a file class - /** - * Serializes a given instance of Environment to a - * java.io.File using DEFAULT_CHARSET - * - * @param file the java.io.File to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - void write(java.io.File file, Charset charset, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - try (OutputStream out = new FileOutputStream(file)) { - write(out, charset, aasEnvironment); - } - } - - /** - * Serializes a given instance of Environment to a - * java.io.File using given charset - * - * @param file the java.io.File to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - void write(java.io.File file, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - write(file, DEFAULT_CHARSET, aasEnvironment); - } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java index 1deec93b2..45caad7c9 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,24 +16,29 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; -import java.io.IOException; - -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DataSpecificationManager; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; -public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer { +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIEC61360; - private static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationIec61360"; +import java.io.IOException; +import java.util.Collections; +import java.util.List; + +// TODO fix the EmbeddedDataSpecification issue +public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer> { @Override - public DataSpecificationIec61360 deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); if (node == null) { return null; @@ -41,14 +47,23 @@ public DataSpecificationIec61360 deserialize(JsonParser parser, DeserializationC return createEmbeddedDataSpecificationsFromContent(parser, node); } + private JsonNode getReferenceNode(JsonParser parser, JsonNode node) throws JsonMappingException { + if (!node.has(DataSpecificationManager.PROP_DATA_SPECIFICATION)) { + throw new JsonMappingException(parser, String.format("data specification must contain node '%s'", DataSpecificationManager.PROP_DATA_SPECIFICATION)); + } + JsonNode nodeDataSpecification = node.get(DataSpecificationManager.PROP_DATA_SPECIFICATION); + return nodeDataSpecification; + } - private DataSpecificationIec61360 createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { - JsonNode nodeContent = node.get(PROP_DATA_SPECIFICATION_CONTENT); - return createDefaultDataSpecificationIec61360FromNode(parser, nodeContent); + private List createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { + JsonNode nodeContent = node.get(DataSpecificationManager.PROP_DATA_SPECIFICATION_CONTENT); + JsonNode specificationNode = nodeContent.get("dataSpecificationIEC61360"); + DataSpecificationContent content = createDefaultDataSpecificationIEC61360FromNode(parser, specificationNode); + return Collections.singletonList(content); } - private DataSpecificationIec61360 createDefaultDataSpecificationIec61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { - return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIec61360.class); + private DataSpecificationContent createDefaultDataSpecificationIEC61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { + return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIEC61360.class); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java new file mode 100644 index 000000000..7fb61b6a4 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; + +import java.io.IOException; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.JsonNode; + +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangString; + +public class LangStringNodeDeserializer implements CustomJsonNodeDeserializer { + @Override + public LangString readValue(JsonNode node, JsonParser parser) throws IOException { + String lang = node.get("language").asText(); + String text = node.get("text").asText(); + return new DefaultLangString.Builder().text(text).language(lang).build(); + } +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java new file mode 100644 index 000000000..ebc3eb0c7 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; + +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +public class LangStringsDeserializer extends NoEntryWrapperListDeserializer { + public LangStringsDeserializer() { + super("langString", new LangStringNodeDeserializer()); + } +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java index 94c505b12..42f255af0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2022 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; -import java.io.IOException; -import java.util.Collections; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -29,10 +23,22 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; public class OperationVariableDeserializer extends JsonDeserializer> { + + public OperationVariableDeserializer() { + } + + @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); @@ -54,7 +60,7 @@ public List deserialize(JsonParser parser, DeserializationCon private List createOperationVariablesFromArrayNode(JsonParser parser, ObjectNode node) throws IOException { ArrayNode content = (ArrayNode) node.get("operationVariable"); - return DeserializationHelper.createInstancesFromArrayNode(parser, content, OperationVariable.class); + return (List) DeserializationHelper.createInstancesFromArrayNode(parser, content, OperationVariable.class); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java index a1930c8ea..ce2d633ee 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java @@ -25,7 +25,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2022 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,11 +42,10 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; import java.io.IOException; +import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -55,12 +54,20 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; + public class QualifierDeserializer extends JsonDeserializer> { + + public QualifierDeserializer() { + } + + @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); + List qualifiers = new ArrayList<>(); if (!node.has("qualifier")) { return Collections.emptyList(); @@ -75,9 +82,10 @@ public List deserialize(JsonParser parser, DeserializationContext ctx } + @SuppressWarnings("unchecked") private List createConstraintsFromArrayNode(JsonParser parser, ObjectNode node) throws IOException { ArrayNode content = (ArrayNode) node.get("qualifier"); - return DeserializationHelper.createInstancesFromArrayNode(parser, content, Qualifier.class); + return (List) DeserializationHelper.createInstancesFromArrayNode(parser, content, Qualifier.class); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java index 1fed0147e..baac7da10 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +21,6 @@ import java.util.Collections; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.TreeNode; @@ -30,12 +29,13 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + public class ReferencesDeserializer extends JsonDeserializer> { @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { TreeNode treeNode = DeserializationHelper.getRootTreeNode(parser); - treeNode = treeNode.get("reference"); if (treeNode.isArray()) { return createReferencesFromArray(parser, (ArrayNode) treeNode); } else { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java index df65da5af..6a591795d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +26,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; public class SubmodelElementDeserializer extends JsonDeserializer { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java index cad350fb0..4eae88d22 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +22,6 @@ import java.util.Iterator; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.TreeNode; @@ -34,6 +33,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + public class SubmodelElementsDeserializer extends JsonDeserializer> { private SubmodelElementDeserializer deserializer = new SubmodelElementDeserializer(); @@ -56,7 +57,8 @@ public List deserialize(JsonParser parser, DeserializationConte } private List createSubmodelElements(JsonParser parser, DeserializationContext ctxt, TreeNode treeNode) throws IOException, JsonProcessingException { - if (treeNode.isArray()) { +// JsonNode nodeSubmodelElement = getSubmodelElementsNode(treeNode); + if (treeNode.isArray()) { return getSubmodelElementsFromArrayNode(parser, ctxt, (ArrayNode) treeNode); } else { return getSubmodelElementsFromObjectNode(parser, ctxt, (JsonNode) treeNode); @@ -89,6 +91,12 @@ private List getSubmodelElementsFromObjectNode(JsonParser parse return submodelElements; } + private JsonNode getSubmodelElementsNode(TreeNode temp) { + ObjectNode objNode = (ObjectNode) temp; + JsonNode nodeSubmodelElement = objNode.get("submodelElement"); // TODO: most likely the node will have the name of a SME subclass, e.g. "property" and not "submodelElement" + return nodeSubmodelElement; + } + private List getSubmodelElementsFromArrayNode(JsonParser parser, DeserializationContext ctxt, ArrayNode arrayNode) throws IOException, JsonProcessingException { List elements = new ArrayList<>(); for (int i = 0; i < arrayNode.size(); i++) { @@ -101,7 +109,8 @@ private List getSubmodelElementsFromArrayNode(JsonParser parser private SubmodelElement getSubmodelElementFromJsonNode(JsonParser parser, DeserializationContext ctxt, JsonNode nodeSubmodelElement) throws IOException, JsonProcessingException { JsonParser parserReference = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeSubmodelElement); - return deserializer.deserialize(parserReference, ctxt); + SubmodelElement elem = deserializer.deserialize(parserReference, ctxt); + return elem; } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java index 1e2728ed4..686afa6da 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,19 +18,20 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + @JsonPropertyOrder({ "hasExtension", "category", "idShort", "displayNames", "description", "checksum", "administration", "id", "dataSpecifications", "embeddedDataSpecifications", "derivedFrom", "assetInformation", "submodels"}) public interface AssetAdministrationShellMixin { - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "id") - public String getID(); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "id") //TODO move into IdentifiableMixin + public String getId(); @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodels") diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java index 1ab503390..d4b2af09f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,27 +18,40 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; + @JsonPropertyOrder({ "assetKind", "globalAssetId", "specificAssetIds", "defaultThumbnail"}) public interface AssetInformationMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetIds") - public List getSpecificAssetIds(); + public List getSpecificAssetIds(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetIds") - public void setSpecificAssetIds(List specificAssetIds); + public void setSpecificAssetIds(List specificAssetIds); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") - public String getGlobalAssetID(); + public Reference getGlobalAssetId(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") + public void setGlobalAssetId(Reference globalAssetId); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodelRef") + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "billOfMaterials") + public List getBillOfMaterials(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodelRef") + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "billOfMaterials") + public void setBillOfMaterials(List billOfMaterials); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "defaultThumbnail") public File getDefaultThumbnail(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java index 1081f1130..22b084d81 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,24 +18,26 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + @JsonPropertyOrder({"hasExtension", "category", "idShort", "displayName", "description", "checksum", "administration", "id", "embeddedDataSpecification", "isCaseOf"}) public interface ConceptDescriptionMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "reference") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "isCaseOf") + // @JsonDeserialize(using = ReferencesDeserializer.class) public List getIsCaseOf(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "reference") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "isCaseOf") + // @JsonDeserialize(using = ReferencesDeserializer.class) public void setIsCaseOf(List isCaseOf); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java index eefb98b28..7698c1926 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,60 +16,45 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDefinitionTypeIec61360Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsPreferredNameTypeIec61360Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsShortNameTypeIec61360Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsDefinitionTypeIec61360Serializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsPreferredNameTypeIec61360Serializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsShortNameTypeIec61360Serializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ValueList; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.*; -@JsonPropertyOrder({"preferredName", "shortName", "unit", "unitId", "sourceOfDefinition", "symbol", "dataType", "definition", "valueFormat", "valueList", "value", "valueId", "levelType"}) -public interface DataSpecificationIec61360Mixin { +import java.util.List; - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") - @JsonSerialize(using = LangStringsDefinitionTypeIec61360Serializer.class) - public List getDefinition(); +@JsonPropertyOrder({"preferredName", "shortName", "unit", "unitId", "sourceOfDefinition", "symbol", "dataType", "definition", "valueFormat", "valueList", "value", "valueId", "levelType"}) +//@JacksonXmlRootElement(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationIec61360") +public interface DataSpecificationIEC61360Mixin { + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") + public List getDefinition(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") - @JsonDeserialize(using = LangStringsDefinitionTypeIec61360Deserializer.class) - public void setDefinition(List definition); + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") + public void setDefinition(List definition); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "levelType") public LevelType getLevelType(); + // TODO +// @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "levelType") + // public void setLevelTypes(List levelTypes); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") - @JsonSerialize(using = LangStringsPreferredNameTypeIec61360Serializer.class) - public List getPreferredName(); +// @JsonInclude(JsonInclude.Include.ALWAYS) + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") + public List getPreferredName(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") - @JsonDeserialize(using = LangStringsPreferredNameTypeIec61360Deserializer.class) - public void setPreferredName(List preferredName); + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") + public void setPreferredName(List preferredName); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") - @JsonSerialize(using = LangStringsShortNameTypeIec61360Serializer.class) - public List getShortName(); + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") + public List getShortName(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") - @JsonDeserialize(using = LangStringsShortNameTypeIec61360Deserializer.class) - public void setShortName(List shortName); + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") + public void setShortName(List shortName); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "sourceOfDefinition") public String getSourceOfDefinition(); @@ -80,7 +66,7 @@ public interface DataSpecificationIec61360Mixin { public String getUnit(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "unitId") - public Reference getUnitID(); + public Reference getUnitId(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueFormat") public String getValueFormat(); @@ -91,16 +77,11 @@ public interface DataSpecificationIec61360Mixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueList") public ValueList getValueList(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueList") - public void setValueList(ValueList valueList); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") public Reference getValueId(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataType") @JsonSerialize(using = EnumSerializer.class) - public DataTypeIec61360 getDataType(); - - + public DataTypeIEC61360 getDataType(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java index 8832434c2..3b5bfe6fe 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java @@ -1,46 +1,36 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.EmbeddedDataSpecificationsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - -@JsonPropertyOrder({"dataSpecification", "dataSpecificationContent"}) -public interface EmbeddedDataSpecificationMixin { - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecification") - public Reference getDataSpecification(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecification") - public void setDataSpecification(Reference dataSpecification); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") - @JsonSerialize(using = EmbeddedDataSpecificationSerializer.class) - public DataSpecificationContent getDataSpecificationContent(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") - @JsonDeserialize(using = EmbeddedDataSpecificationsDeserializer.class) - public void setDataSpecificationContent(DataSpecificationContent dataSpecificationIEC61360); - -} +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; + +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + +@JsonPropertyOrder({"dataSpecification", "dataSpecificationContent"}) +public interface EmbeddedDataSpecificationMixin { + + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecification") + public Reference getDataSpecification(); + + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") + @JsonSerialize(using = EmbeddedDataSpecificationSerializer.class) + public DataSpecificationIEC61360 getDataSpecificationContent(); + +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java index 461fb73c5..fbe80a98b 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,23 +18,25 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + public interface EntityMixin { + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") + public SpecificAssetId getExternalAssetId(); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "statements") - @JsonInclude(JsonInclude.Include.NON_NULL) +// @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "statements") + @JsonInclude(JsonInclude.Include.NON_NULL) @JsonSerialize(using = SubmodelElementsSerializer.class) @JsonDeserialize(using = SubmodelElementsDeserializer.class) public List getStatements(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") - void setGlobalAssetID(String globalAssetID); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java index 9ccd1bfc1..2d474410e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +18,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.*; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java index 7e801c9e1..ee1c5d64a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,13 +16,12 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; - import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; + +import java.util.List; public interface HasDataSpecificationMixin { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java index f4489b4f7..7f89ab25d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +21,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Extension; public interface HasExtensionsMixin { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java index 34e5864a5..70eee5159 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; @JsonPropertyOrder({"type", "value"}) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java new file mode 100644 index 000000000..8bf691b20 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; + +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; + + +@JsonPropertyOrder({"language", "text"}) +public interface LangStringMixin { + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "language") + public String getLanguage(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "text") + public String getText(); +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java index da43b241a..2c9242316 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,21 +18,16 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -public interface MultiLanguagePropertyMixin { - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "langStringTextType") - @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) - public List getValue(); +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") - void setValueID(Reference valueID); +public interface MultiLanguagePropertyMixin { + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") +// @JsonSerialize(using = LangStringsSerializer.class) + @JsonDeserialize(using = LangStringsDeserializer.class) + public List getValue(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java index cb5002f92..5b93072b3 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,21 +18,36 @@ import java.util.List; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.OperationVariableDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - public interface OperationMixin { + //@JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "inputVariables") + //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") public List getInputVariables(); + //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") @JsonDeserialize(using = OperationVariableDeserializer.class) public void setInputVariables(List inputVariables); + + // @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "inoutputVariables") + // TODO: conflicting with getter above @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") + //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "inoutputVariables") + public List getInoutputVariables(); + @JsonDeserialize(using = OperationVariableDeserializer.class) public void setInoutputVariables(List inoutputVariables); + + //@JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "outputVariables") + // TODO: conflicting with getter above @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") + //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "outputVariables") + public List getOutputVariables(); + @JsonDeserialize(using = OperationVariableDeserializer.class) public void setOutputVariables(List outputVariables); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java index 91af44668..191ab7379 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +20,8 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java index 0028e520d..3d5ef989c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,17 +18,18 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.QualifierDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; - import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.QualifierDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; + public interface QualifiableMixin { @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "qualifiers") @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "qualifier") + // TODO @JsonSerialize(using = ConstraintsSerializer.class) @JsonDeserialize(using = QualifierDeserializer.class) public List getQualifiers(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java index 6d9a72164..f3ad9cb5d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +16,13 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - @JsonPropertyOrder({ "semanticId", "supplementalSemanticIds", // --> HasSemantics "kind", "type", "valueType", "value", "valueId" @@ -37,7 +36,7 @@ public interface QualifierMixin { void setType(String type); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueType") - void setType(DataTypeDefXsd valueType); + void setType(DataTypeDefXsd valueType); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") void setValue(String value); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java index 552eb1d3e..88ef3306c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,37 +18,42 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsNameTypeDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsNameTypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsTextTypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + @JsonPropertyOrder({"hasExtensions", "category", "idShort", "displayName", "description", "checksum"}) public interface ReferableMixin { + +// @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") +// public String getCategory(); +// +// @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") +// public void setCategory(String category); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") - @JsonSerialize(using = LangStringsTextTypeSerializer.class) - public List getDescription(); + @JsonSerialize(using = LangStringsSerializer.class) + public List getDescription(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") - @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) - public void setDescription(List descriptions); + @JsonDeserialize(using = LangStringsDeserializer.class) + public void setDescription(List descriptions); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") - @JsonDeserialize(using = LangStringsNameTypeDeserializer.class) - public List getDisplayName(); +// @JsonSerialize(using = LangStringsSerializer.class) + @JsonDeserialize(using = LangStringsDeserializer.class) + public List getDisplayName(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") - @JsonSerialize(using = LangStringsNameTypeSerializer.class) - public void setDisplayName(List displayNames); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") + public void setDisplayName(List displayNames); +// @JsonInclude(JsonInclude.Include.ALWAYS) public String getIdShort(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java index 41d8dce6c..9347321b0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +23,8 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.KeysDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java index ef49d195c..4f5025748 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,10 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; @JsonPropertyOrder({"path", "contentType"}) public interface ResourceMixin { @@ -29,5 +28,5 @@ public interface ResourceMixin { public String getPath(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "contentType") - public DataTypeDefXsd getContentType(); + public DataTypeDefXsd getContentType(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java index 511735600..3d9ee0220 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,15 +16,15 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -@JsonPropertyOrder({"hasSemantics", "name", "value", "externalSubjectId"}) -public interface SpecificAssetIDMixin { +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +@JsonPropertyOrder({"hasSemantics", "name", "value", "externalSubjectId"}) +public interface SpecificAssetIdMixin { + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "name") public String getName(); @@ -31,5 +32,5 @@ public interface SpecificAssetIDMixin { public String getValue(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "externalSubjectId") - public Reference getExternalSubjectID(); + public Reference getExternalSubjectId(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java index 102e1f4d8..a7d285c1f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +22,8 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java index 4992fb50f..4610a971f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,14 +18,12 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; - @JsonPropertyOrder({ - "hasExtensions", "category", "idShort", "displayName", "description", "checksum", // --> Referable + "hasExtensions", "category", "idShort", "displayNames", "description", "checksum", // --> Referable "kind", // --> HasKind - "semanticId", "supplementalSemanticIds", "reference", // --> HasSemantics + "semanticId", "supplementalSemanticIds", // --> HasSemantics "qualifier", // --> Qualifiable "dataSpecifications", "embeddedDataSpecifications", // --> HasDataSpecifications - "orderRelevant", "semanticIdListElement", "typeValueListElement", "valueTypeListElement", // --> SME-List "valueType", "value", "valueId" // --> Property , "statements", "entityType", "globalAssetId", "specificAssetId" // --> Entity , "first", "second", "annotations" // --> (Annotated)RelationsShipElement diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java index bcb0845e9..c62d7a497 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,12 +23,14 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -@JsonPropertyOrder({ "hasExtension", "category", "idShort", "displayNames", "description", "checksum", "administration", "id", "kind", "semanticId", "supplementalSemanticIds", "qualifier", "dataSpecifications", "embeddedDataSpecifications", "submodelElements"}) +@JsonPropertyOrder({ "hasExtension", "category", "idShort", "displayNames", "description", "checksum", "administration", + "id", "kind", "semanticId", "supplementalSemanticIds", "qualifier", "dataSpecifications", + "embeddedDataSpecifications", "submodelElements"}) public interface SubmodelMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodelElements") @JsonSerialize(using = SubmodelElementsSerializer.class) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java index d13a78bbb..7a0550db6 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,15 +16,13 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.ValueReferencePairsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; + +import java.util.List; public interface ValueListMixin { @@ -31,9 +30,4 @@ public interface ValueListMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueReferencePair") List getValueReferencePairs(); - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueReferencePairs") - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueReferencePair") - @JsonDeserialize(using = ValueReferencePairsDeserializer.class) - public void setValueReferencePairs(List valueReferencePair); - } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java index 52fc57b22..a8a3544d7 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,16 +16,16 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -@JsonPropertyOrder({ "value", "valueID" }) +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonPropertyOrder({"value", "valueId"}) public interface ValueReferencePairMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") - public Reference getValueID(); + public Reference getValueId(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") public String getValue(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java index 8f2e2c085..cd4e5d2e1 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java @@ -24,7 +24,7 @@ import javax.xml.namespace.QName; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.AbstractLangString; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java index 6ba166590..1cdf8e20e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * + * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,7 +20,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.AbstractLangString; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java index 08a2ca10e..e1b1ac179 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,22 +25,22 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + public class AssetAdministrationShellEnvironmentSerializer extends JsonSerializer { private static final String[] SCHEMA_LOCATION = {"xsi:schemaLocation", - "https://admin-shell.io/aas/3/0 AAS.xsd" }; + "https://admin-shell.io/aas/3/0/RC02 AAS.xsd http://www.admin-shell.io/IEC61360/3/0 IEC61360.xsd http://www.admin-shell.io/aas/abac/3/0 AAS_ABAC.xsd"}; private static final QName AASENV_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "environment"); private static final QName AASLIST_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "assetAdministrationShells"); @@ -48,6 +49,8 @@ public class AssetAdministrationShellEnvironmentSerializer extends JsonSerialize private static final QName CONCEPTDICTIONARY_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "conceptDescription"); private static final QName SUBMODELLIST_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "submodels"); private static final QName SUBMODEL_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "submodel"); + private static final QName ASSETLIST_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "assets"); + private static final QName ASSET_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "asset"); private Map namespacePrefixes; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java index 800e7e233..0f387ca6e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +24,7 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; public class DataElementsSerializer extends JsonSerializer> { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java index 1208a07d6..aa99ff032 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,15 +16,17 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; -import java.io.IOException; - - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; /** @@ -31,22 +34,27 @@ * of a reference. Uses DataSpecificationManager to resolve java type to * reference. */ -public class EmbeddedDataSpecificationSerializer extends JsonSerializer { +// TODO: solve EmbeddedDataSpecifiction issue +public class EmbeddedDataSpecificationSerializer extends JsonSerializer { + + private static final Logger logger = LoggerFactory.getLogger(EmbeddedDataSpecificationSerializer.class); @Override - public void serialize(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider) + public void serialize(DataSpecificationIEC61360 data, JsonGenerator generator, SerializerProvider provider) throws IOException { if (data == null) { return; } +// generator.writeFieldName(PROP_DATA_SPECIFICATION_CONTENT); generator.writeStartObject(); + // TODO: Add field name according to template type generator.writeObjectField("dataSpecificationIec61360", data); generator.writeEndObject(); } @Override - public void serializeWithType(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider, + public void serializeWithType(DataSpecificationIEC61360 data, JsonGenerator generator, SerializerProvider provider, TypeSerializer typedSerializer) throws IOException, JsonProcessingException { serialize(data, generator, provider); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java new file mode 100644 index 000000000..8e545b727 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; + +import java.io.IOException; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; + +import org.eclipse.digitaltwin.aas4j.v3.model.Key; + +public class KeySerializer extends JsonSerializer { + + @Override + public void serialize(Key key, JsonGenerator gen, SerializerProvider serializers) throws IOException { + ToXmlGenerator xgen = (ToXmlGenerator) gen; + xgen.writeObjectFieldStart("key"); + + String keyTypeValue = AasUtils.serializeEnumName(key.getType().toString()); + xgen.setNextIsAttribute(false); + xgen.writeFieldName("type"); + xgen.writeString(key.getType().name()); + + xgen.setNextIsAttribute(false); + xgen.writeFieldName("value"); + xgen.writeString(key.getValue()); + + xgen.writeEndObject(); + } +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java new file mode 100644 index 000000000..1ee6cc058 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; + +import java.io.IOException; +import java.lang.reflect.Field; + +import javax.xml.namespace.QName; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +public class LangStringSerializer extends JsonSerializer { + + + @Override + public void serialize(LangString langString, JsonGenerator gen, SerializerProvider serializers) throws IOException { + + ToXmlGenerator xgen = (ToXmlGenerator) gen; + try { + Field nextName = xgen.getClass().getDeclaredField("_nextName"); + nextName.setAccessible(true); + QName next = (QName) nextName.get(xgen); + + xgen.setNextName(new QName(AasXmlNamespaceContext.AAS_URI, "langString")); + + serializeLangString(xgen, langString); + + } catch (NoSuchFieldException | IllegalAccessException e) { + // serialize it without changing the namespaces + serializeLangString(xgen, langString); + } + + } + + private void serializeLangString(ToXmlGenerator xgen, LangString langString) throws IOException { + + + xgen.writeStartObject(); + xgen.writeFieldName("language"); + xgen.writeString(langString.getLanguage()); + + xgen.writeFieldName("text"); + xgen.writeString(langString.getText()); + + xgen.writeEndObject(); + } +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java new file mode 100644 index 000000000..2282408e6 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +import java.io.IOException; +import java.util.List; + +public class LangStringsSerializer extends NoEntryWrapperListSerializer { + + private LangStringSerializer ser = new LangStringSerializer(); + + @Override + public void serialize(List langStrings, JsonGenerator gen, SerializerProvider serializers) throws IOException { + + ToXmlGenerator xgen = (ToXmlGenerator) gen; + xgen.writeStartObject(); + for (LangString element : langStrings) { + ReflectionHelper.setEmptyListsToNull(element); // call is needed to prevent empty tags (e.g. statements.size=0 leads to , which is not allowed according to the schema + xgen.writeFieldName(SubmodelElementManager.getXmlName(element.getClass())); + ser.serialize(element, xgen, serializers); + } + xgen.writeEndObject(); + + } + + @Override + public Class> handledType() { + return (Class>)(Object)List.class; + } + +} \ No newline at end of file diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java index 5ca546993..306dcccec 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,19 +16,22 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; -import java.io.IOException; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; + +import java.io.IOException; public class OperationVariableSerializer extends JsonSerializer { + + private SubmodelElementSerializer ser = new SubmodelElementSerializer(); + @Override public void serialize(OperationVariable operationVariable, JsonGenerator gen, SerializerProvider serializers) throws IOException { + ToXmlGenerator xgen = (ToXmlGenerator) gen; xgen.writeStartObject(); xgen.writeFieldName("operationVariable"); @@ -41,4 +45,17 @@ public void serialize(OperationVariable operationVariable, JsonGenerator gen, Se xgen.writeEndObject(); } + + private void serializeOperationVariable(ToXmlGenerator xgen, OperationVariable operationVariable) throws IOException { + + + xgen.writeStartObject(); +// xgen.writeFieldName("language"); +// xgen.writeString(langString.getLanguage()); +// +// xgen.writeFieldName("text"); +// xgen.writeString(langString.getText()); + + xgen.writeEndObject(); + } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java new file mode 100644 index 000000000..419a36ef7 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; + +import java.io.IOException; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +public class ReferenceSerializer extends JsonSerializer { + private NoEntryWrapperListSerializer keyListSerializer; + + public ReferenceSerializer() { +// this.keyListSerializer = new NoEntryWrapperListSerializer<>(); +// this.keyListSerializer.setOuterWrapper("keys"); + } + + @Override + public void serialize(Reference reference, JsonGenerator gen, SerializerProvider serializers) throws IOException { + ToXmlGenerator xgen = (ToXmlGenerator) gen; +// xgen.setNextIsUnwrapped(true); +// xgen.writeObjectFieldStart("type"); + xgen.writeString(reference.getType().name()); + +// List keys = reference.getKeys(); +// this.keyListSerializer.serialize(keys, gen, serializers); + } + +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java index 39c94f386..df63759c8 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,16 +19,16 @@ import java.io.IOException; import java.lang.reflect.Field; -import javax.xml.namespace.QName; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import javax.xml.namespace.QName; + public class SubmodelElementSerializer extends JsonSerializer { @Override @@ -46,6 +47,7 @@ public void serialize(SubmodelElement value, JsonGenerator gen, SerializerProvid return ; } } catch (NoSuchFieldException | IllegalAccessException e) { + // TODO: report exception throw new IOException(e); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java index 6b119a711..2b77c753d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +24,8 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.*; public class SubmodelElementsSerializer extends JsonSerializer> { diff --git a/dataformat-xml/src/main/resources/AAS.xsd b/dataformat-xml/src/main/resources/AAS.xsd index 8f8569e73..f61f1bf08 100644 --- a/dataformat-xml/src/main/resources/AAS.xsd +++ b/dataformat-xml/src/main/resources/AAS.xsd @@ -1,1346 +1,591 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dataformat-xml/src/main/resources/AAS_ABAC.xsd b/dataformat-xml/src/main/resources/AAS_ABAC.xsd new file mode 100644 index 000000000..472c60d37 --- /dev/null +++ b/dataformat-xml/src/main/resources/AAS_ABAC.xsd @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dataformat-xml/src/main/resources/IEC61360.xsd b/dataformat-xml/src/main/resources/IEC61360.xsd new file mode 100644 index 000000000..b929a4304 --- /dev/null +++ b/dataformat-xml/src/main/resources/IEC61360.xsd @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java index 784f3f888..3b1fce30d 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,50 +16,28 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; -import java.io.FileNotFoundException; -import java.util.List; - import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.Operation; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.junit.Assert; import org.junit.Test; -public class XMLDeserializerTest { - - @Test - public void deserializeAASSimple() throws FileNotFoundException, DeserializationException { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); +import java.io.FileNotFoundException; +import java.util.List; - Assert.assertEquals(AASSimple.createEnvironment(), env); - } +public class XMLDeserializerTest { @Test - public void deserializeAASSimpleAAS() throws Exception { + public void deserializeAASSimple() throws Exception { Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); - - Assert.assertEquals(AASSimple.createEnvironment().getAssetAdministrationShells(), env.getAssetAdministrationShells()); - } - - @Test - public void deserializeAASSimpleSubmodel() throws Exception { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); - - Assert.assertEquals(AASSimple.createEnvironment().getSubmodels(), env.getSubmodels()); - } - - @Test - public void deserializeAASSimpleConceptDescription() throws Exception { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); - - Assert.assertEquals(AASSimple.createEnvironment().getConceptDescriptions(), env.getConceptDescriptions()); - } + Assert.assertEquals(AASSimple.ENVIRONMENT, env); + } @Test public void deserializeAnnotedRelationshipElement() throws Exception { @@ -78,7 +57,7 @@ public void deserializeQualifier() throws Exception { @Test public void deserializeOperation() throws Exception { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE_WITH_OPERATIONS); + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE_WITH_OPERATION); Assert.assertNotNull(env); OperationVariable inputVariable = ((Operation) env.getSubmodels().get(0).getSubmodelElements().get(0)).getInputVariables().get(0); @@ -94,26 +73,6 @@ public void deserializeOperation() throws Exception { @Test public void deserializeAASFull() throws FileNotFoundException, DeserializationException { Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); - Assert.assertEquals(AASFull.createEnvironment(), env); + Assert.assertEquals(AASFull.ENVIRONMENT, env); } - - @Test - public void deserializeAASFullAAS() throws FileNotFoundException, DeserializationException { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); - Assert.assertEquals(AASFull.createEnvironment().getAssetAdministrationShells(), env.getAssetAdministrationShells()); - } - - @Test - public void deserializeAASFullSubmodel() throws FileNotFoundException, DeserializationException { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); - - Assert.assertEquals(AASFull.createEnvironment().getSubmodels(), env.getSubmodels()); - } - - @Test - public void deserializeAASFullConceptDescription() throws FileNotFoundException, DeserializationException { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); - - Assert.assertEquals(AASFull.createEnvironment().getConceptDescriptions(), env.getConceptDescriptions()); - } } diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java index 6ca6b6c65..69cc64dd7 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; - import static org.junit.Assert.assertTrue; import java.io.File; @@ -28,32 +27,24 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.hamcrest.MatcherAssert; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.w3c.dom.Node; import org.xml.sax.SAXException; import org.xmlunit.diff.DefaultNodeMatcher; import org.xmlunit.diff.ElementSelectors; import org.xmlunit.matchers.CompareMatcher; -import org.xmlunit.util.Predicate; +import com.fasterxml.jackson.core.JsonProcessingException; public class XmlSerializerTest { public static final java.io.File AASFULL_FILE = new java.io.File("src/test/resources/test_demo_full_example.xml"); @@ -61,7 +52,7 @@ public class XmlSerializerTest { public static final java.io.File AASSIMPLE_FILE_WITH_TEST_NAMESPACE = new java.io.File("src/test/resources/xmlExampleWithModifiedPrefix.xml"); public static final java.io.File AASFULL_FILE_WITH_ANNOTATED_RELATIONSHIP = new java.io.File("src/test/resources/annotated_relationship_example.xml"); public static final java.io.File AASFULL_FILE_WITH_QUALIFIERS = new java.io.File("src/test/resources/qualifier_example.xml"); - public static final java.io.File AASFULL_FILE_WITH_OPERATIONS = new java.io.File("src/test/resources/operation_example.xml"); + public static final java.io.File AASFULL_FILE_WITH_OPERATION = new java.io.File("src/test/resources/operation_example.xml"); private static final Logger logger = LoggerFactory.getLogger(XmlSerializerTest.class); @@ -69,14 +60,14 @@ public class XmlSerializerTest { public TemporaryFolder tempFolder = new TemporaryFolder(); @Test - public void testWriteToFile() throws IOException, SerializationException { + public void testWriteToFile() throws JsonProcessingException, IOException, SerializationException { File file = tempFolder.newFile("output.xml"); - new XmlSerializer().write(file, AASSimple.createEnvironment()); + new XmlSerializer().write(file, AASSimple.ENVIRONMENT); assertTrue(file.exists()); } @Test - public void testSerializeMinimal() throws SerializationException, SAXException { + public void testSerializeMinimal() throws IOException, SerializationException, SAXException { File file = new File("src/test/resources/minimum.xml"); Environment environment = new DefaultEnvironment.Builder() .assetAdministrationShells(new DefaultAssetAdministrationShell.Builder() @@ -90,21 +81,21 @@ public void testSerializeMinimal() throws SerializationException, SAXException { } @Test - public void testSerializeSimpleWithTestNamespacePrefix() throws SerializationException, SAXException { + public void testSerializeSimpleWithTestNamespacePrefix() throws IOException, SerializationException, SAXException { Map nsPrefixes = new HashMap<>(AasXmlNamespaceContext.PREFERRED_PREFIX_CONTEXT); nsPrefixes.put("test", nsPrefixes.get("aas")); nsPrefixes.remove("aas"); - validateXmlSerializer(AASSIMPLE_FILE_WITH_TEST_NAMESPACE, AASSimple.createEnvironment(), new XmlSerializer(nsPrefixes)); + validateXmlSerializer(AASSIMPLE_FILE_WITH_TEST_NAMESPACE, AASSimple.ENVIRONMENT, new XmlSerializer(nsPrefixes)); } @Test - public void testSerializeSimple() throws SerializationException, SAXException { - validateXmlSerializer(AASSIMPLE_FILE, AASSimple.createEnvironment()); + public void testSerializeSimple() throws IOException, SerializationException, SAXException { + validateXmlSerializer(AASSIMPLE_FILE, AASSimple.ENVIRONMENT); } @Test - public void testSerializeFull() throws SerializationException, SAXException { - validateXmlSerializer(AASFULL_FILE, AASFull.createEnvironment()); + public void testSerializeFull() throws IOException, SerializationException, SAXException { + validateXmlSerializer(AASFULL_FILE, AASFull.ENVIRONMENT); } @Test @@ -136,14 +127,6 @@ public void testMinimalOperationAgainstXsdSchema() throws SerializationException assertTrue(errors.isEmpty()); } - @Test - public void testGYear() throws SerializationException, SAXException { - Submodel submodel = new DefaultSubmodel.Builder().id("yearTestSm").submodelElements(new DefaultProperty.Builder().idShort("yearTestProp").valueType(DataTypeDefXsd.GYEAR).build()).build(); - String xml = new XmlSerializer().write(new DefaultEnvironment.Builder().submodels(submodel).build()); - Set errors = validateAgainstXsdSchema(xml); - assertTrue(errors.isEmpty()); - } - @Test public void testDocumentationSubmodelAgainstXsdSchema() throws SerializationException, SAXException { @@ -156,7 +139,7 @@ public void testDocumentationSubmodelAgainstXsdSchema() throws SerializationExce @Test public void testIsCaseOfAgainstXsdSchema() throws SerializationException, SAXException { - ConceptDescription object = AASFull.createEnvironment().getConceptDescriptions().get(0); + ConceptDescription object = AASFull.ENVIRONMENT.getConceptDescriptions().get(0); String xml = new XmlSerializer().write(new DefaultEnvironment.Builder().conceptDescriptions(object).build()); Set errors = validateAgainstXsdSchema( xml ); assertTrue(errors.isEmpty()); @@ -164,12 +147,12 @@ public void testIsCaseOfAgainstXsdSchema() throws SerializationException, SAXExc - private Set validateAgainstXsdSchema(String xml) throws SAXException { + private Set validateAgainstXsdSchema(String xml) throws SerializationException, SAXException { return new XmlSchemaValidator().validateSchema(xml); } private void validateXmlSerializer(File expectedFile, Environment environment) - throws SerializationException, SAXException { + throws IOException, SerializationException, SAXException { validateXmlSerializer(expectedFile, environment, new XmlSerializer()); } @@ -177,61 +160,12 @@ private void validateXmlSerializer(File expectedFile, Environment environment, X throws SerializationException, SAXException { String actual = xmlSerializer.write(environment); Set errors = validateAgainstXsdSchema(actual); - logger.debug(actual); + logger.info(actual); logErrors(expectedFile.getName(), errors); assertTrue(errors.isEmpty()); - CompareMatcher xmlTestMatcher = CompareMatcher - .isSimilarTo(expectedFile) - .normalizeWhitespace() - .ignoreComments() - .withNodeFilter((Predicate) node -> { - return ignoreDefaults(node); - }) // ignore default fields - .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndAllAttributes) - ); - MatcherAssert.assertThat(removeDefaults(actual), xmlTestMatcher); - } - - private String removeDefaults(String aasXml) { - aasXml = aasXml.replace("Instance", ""); - aasXml = aasXml.replace("Instance", ""); - aasXml = aasXml.replace("VARIABLE", ""); - aasXml = aasXml.replace("VARIABLE", ""); - aasXml = aasXml.replace("PROPERTY", ""); // TODO: only for ConceptDescriptions - aasXml = aasXml.replace("PROPERTY", ""); // TODO: only for ConceptDescriptions - aasXml = aasXml.replace("ConceptQualifier", ""); - aasXml = aasXml.replace("ConceptQualifier", ""); - aasXml = aasXml.replace("true", ""); - aasXml = aasXml.replace("true", ""); - return aasXml; - } - - private boolean ignoreDefaults(Node node) { - if (node.getLocalName() != null - && node.getLocalName().equals("kind") - && node.getFirstChild().getNodeValue().equals("Instance")) { - return false; - } - - if (node.getLocalName() != null - && node.getLocalName().equals("category") - && node.getFirstChild().getNodeValue().equals("VARIABLE")) { - return false; - } - - if (node.getLocalName() != null - && node.getLocalName().equals("category") - && node.getFirstChild().getNodeValue().equals("PROPERTY")) { // TODO: only for ConceptDescriptions - return false; - } - - if (node.getLocalName() != null - && node.getLocalName().equals("orderRelevant") - && node.getFirstChild().getNodeValue().equals("true")) { - return false; - } - - return true; + CompareMatcher xmlTestMatcher = CompareMatcher.isSimilarTo(expectedFile).normalizeWhitespace().ignoreComments() + .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndAllAttributes)); + MatcherAssert.assertThat(actual, xmlTestMatcher); } private void logErrors(String validatedFileName, Set errors) { diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java index eff9fa49c..8cff59e30 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +47,7 @@ public static void prepareValidator() throws SAXException { } @Test - @Parameters({ "src/test/resources/minimum.xml", "src/test/resources/Example_AAS_ServoDCMotor - Simplified.xml", "src/test/resources/test_demo_full_example.xml" }) + @Parameters({"src/test/resources/minimum.xml", "src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml"}) // import from admin-shell.io -> is actually V3 // -> fix name, as soon as it is fixed externally public void validateValidXml(String file) throws IOException { @@ -56,7 +57,7 @@ public void validateValidXml(String file) throws IOException { } @Test - @Parameters({ "src/test/resources/invalidXmlExample.xml", "src/test/resources/ServoDCMotor_invalid.xml" }) + @Parameters({"src/test/resources/invalidXmlExample.xml", "src/test/resources/ServoDCMotor_invalid_V2.0.xml"}) public void validateInvalidXml(String file) throws IOException { Set errors = validateXmlFile(file); logErrors(file, errors); diff --git a/dataformat-xml/src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml b/dataformat-xml/src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml new file mode 100644 index 000000000..08a2e06ce --- /dev/null +++ b/dataformat-xml/src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml @@ -0,0 +1,436 @@ + + + + + ExampleMotor + + http://customer.com/aas/9175_7013_7091_9168 + + + Instance + + GlobalReference + + + AssetAdministrationShell + http://customer.com/assets/KHBVZJSQKIY + + + + + + + GlobalReference + + + Submodel + http://i40.customer.com/instance/1/1/AC69B1CB44F07935 + + + + + GlobalReference + + + Submodel + http://i40.customer.com/type/1/1/1A7B62B529F19152 + + + + + GlobalReference + + + Submodel + http://i40.customer.com/type/1/1/7A7104BDAB57E184 + + + + + + + + + Documentation + + http://i40.customer.com/type/1/1/1A7B62B529F19152 + + Instance + + + OperatingManual + Instance + + GlobalReference + + + ConceptDescription + http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document + + + + + + Parameter + DigitalFile_PDF + Instance + + GlobalReference + + + ConceptDescription + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile + + + + file:///aasx/OperatingManual.pdf + application/pdf + + + Title + Instance + + GlobalReference + + + ConceptDescription + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title + + + + + + en + Operating Manual + + + + + + + + + TechnicalData + + http://i40.customer.com/type/1/1/7A7104BDAB57E184 + + Instance + + GlobalReference + + + ConceptDescription + 0173-1#01-AFZ615#016 + + + + + + Parameter + MaxRotationSpeed + Instance + + GlobalReference + + + ConceptDescription + 0173-1#02-BAA120#008 + + + + xs:int + 5000 + + + + + OperationalData + + http://i40.customer.com/instance/1/1/AC69B1CB44F07935 + + Instance + + + Variable + RotationSpeed + Instance + + GlobalReference + + + ConceptDescription + http://customer.com/cd/1/1/18EBD56F6B43D895 + + + + xs:int + 4370 + + + + + + + MaxRotationSpeed + + 2 + 0 + + + 0173-1#02-BAA120#008 + + + + + GlobalReference + + + ConceptDescription + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationaas + + + + + + + + de + max. Drehzahl + + + en + Max. rotation speed + + + + 1/min + + + GlobalReference + + + ConceptDescription + 0173-1#05-AAA650#002 + + + + REAL_MEASURE + + + de + Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf + + + en + Greatest permissible rotation speed with which the motor or feeding unit may be operated + + + + + + + + + + Title + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title + + + + + GlobalReference + + + ConceptDescription + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + + + + + de + Titel + + + en + Title + + + + + de + Titel + + + STRING_TRANSLATABLE + + + de + Sprachabhängiger Titel des Dokuments. + + + + + + + + + RotationSpeed + + http://customer.com/cd/1/1/18EBD56F6B43D895 + + + + + GlobalReference + + + ConceptDescription + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationaas + + + + + + + + de + Aktuelle Drehzahl + + + en + Actual rotation speed + + + + + en + RotationSpeed + + + + 1/min + + + GlobalReference + + + ConceptDescription + 0173-1#05-AAA650#002 + + + + REAL_MEASURE + + + de + Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird + + + en + Actual rotation speed with which the motor or feeding unit is operated + + + + + + + + + Document + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Document + + + + + GlobalReference + + + ConceptDescription + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationaas + + + + + + + + de + Dokument + + + en + Document + + + + + en + Document + + + + [ISO 15519-1:2010] + + IRI + + + de + Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. + + + + + + + + + DigitalFile + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile + + + + + GlobalReference + + + ConceptDescription + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationaas + + + + + + + + de + Digitale Datei + + + + + de + digitale Datei + + + IRI + + + de + Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden. + + + + + + + + + \ No newline at end of file diff --git a/dataformat-xml/src/test/resources/ServoDCMotor_invalid_V2.0.xml b/dataformat-xml/src/test/resources/ServoDCMotor_invalid_V2.0.xml new file mode 100644 index 000000000..d6a6a04dd --- /dev/null +++ b/dataformat-xml/src/test/resources/ServoDCMotor_invalid_V2.0.xml @@ -0,0 +1,470 @@ + + + + + + ExampleMotor + + CONSTANT + + http://customer.com/aas/9175_7013_7091_9168 + + + + + http://customer.com/assets/KHBVZJSQKIY + + + + + + + + + http://i40.customer.com/instance/1/1/AC69B1CB44F07935 + + + + + + + http://i40.customer.com/type/1/1/1A7B62B529F19152 + + + + + + + http://i40.customer.com/type/1/1/7A7104BDAB57E184 + + + + + + + + + + Documentation + + + CONSTANT + + + http://i40.customer.com/type/1/1/1A7B62B529F19152 + + Instance + + + + + + OperatingManual + + Instance + + + + www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document + + + + + + + + DigitalFile_PDF + + + PARAMETER + + Instance + + + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile + + + + + application/pdf + + + /aasx/OperatingManual.pdf + + + + + + + Title + + Instance + + + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title + + + + + + Operating Manual + + + + + + false + false + + + + + + + TechnicalData + + + CONSTANT + + + http://i40.customer.com/type/1/1/7A7104BDAB57E184 + + Instance + + + + 0173-1#01-AFZ615#016 + + + + + + + + MaxRotationSpeed + + + PARAMETER + + Instance + + + + 0173-1#02-BAA120#008 + + + + + integer + + + 5000 + + + + + + + + + OperationalData + + + VARIABLE + + + http://i40.customer.com/instance/1/1/AC69B1CB44F07935 + + + Instance + + + + + + + + RotationSpeed + + + VARIABLE + + Instance + + + + http://customer.com/cd/1/1/18EBD56F6B43D895 + + + + + + + + + + integer + + + 4370 + + + + + + + + + + + MaxRotationSpeed + + PROPERTY + + 0173-1#02-BAA120#008 + + + 2 + 0 + + + + + REAL_MEASURE + + + Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf + + + Greatest permissible rotation speed with which the motor or feeding unit may be operated + + + + + max. Drehzahl + + + Max. rotation speed + + + + + + + + 1/min + + + + + 0173-1#05-AAA650#002 + + + + + + + + + + + + + Title + + PROPERTY + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title + + + + + STRING_TRANSLATABLE + + + Sprachabhängiger Titel des Dokuments. + + + + + Titel + + + Title + + + + + Titel + + + + + + + + + + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + + + + + RotationSpeed + + PROPERTY + + http://customer.com/cd/1/1/18EBD56F6B43D895 + + + + + + REAL_MEASURE + + + Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird + + + Actual rotation speed with which the motor or feeding unit is operated + + + + + Aktuelle Drehzahl + + + Actual rotation speed + + + + + RotationSpeed + + + + + 1/min + + + + + 0173-1#05-AAA650#002 + + + + + + + + + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + + + + + Document + + + COLLECTION + + + + + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Document + + + + + URL + + + Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. + + + + + Dokument + + + Document + + + + + Document + + + + [ISO 15519-1:2010] + + + + + + + + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + + + + + + DigitalFile + + + DOCUMENT + + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile + + + + + URL + + + Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden. + + + + + Digitale Datei + + + + + digitale Datei + + + + + + + + + + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + + + + diff --git a/dataformat-xml/src/test/resources/annotated_relationship_example.xml b/dataformat-xml/src/test/resources/annotated_relationship_example.xml index 3573866cb..d2fee638f 100644 --- a/dataformat-xml/src/test/resources/annotated_relationship_example.xml +++ b/dataformat-xml/src/test/resources/annotated_relationship_example.xml @@ -1,11 +1,11 @@ - + TestSubmodel - 0 - 9 + 0.9 + 0 https://acplt.org/Test_Submodel Instance @@ -14,7 +14,7 @@ Parameter ExampleAnnotatedRelationshipElement - ExternalReference + GlobalReference GlobalReference @@ -60,6 +60,7 @@ Parameter ExampleProperty3 + Instance xs:string some example annotation diff --git a/dataformat-xml/src/test/resources/invalidXmlExample.xml b/dataformat-xml/src/test/resources/invalidXmlExample.xml index b7b77781f..799effff7 100644 --- a/dataformat-xml/src/test/resources/invalidXmlExample.xml +++ b/dataformat-xml/src/test/resources/invalidXmlExample.xml @@ -1,5 +1,5 @@ - diff --git a/dataformat-xml/src/test/resources/minimum.xml b/dataformat-xml/src/test/resources/minimum.xml index 12445b81e..705afc014 100644 --- a/dataformat-xml/src/test/resources/minimum.xml +++ b/dataformat-xml/src/test/resources/minimum.xml @@ -1,7 +1,5 @@ - + https://acplt.org/Test_AssetAdministrationShell @@ -10,4 +8,5 @@ - \ No newline at end of file + + diff --git a/dataformat-xml/src/test/resources/operation_example.xml b/dataformat-xml/src/test/resources/operation_example.xml index bbc5798bb..62b9d979c 100644 --- a/dataformat-xml/src/test/resources/operation_example.xml +++ b/dataformat-xml/src/test/resources/operation_example.xml @@ -1,28 +1,28 @@ - + TestSubmodel - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 https://acplt.org/Test_Submodel Instance - ExternalReference + GlobalReference GlobalReference @@ -35,17 +35,18 @@ Parameter ExampleOperation - + en-us Example Operation object - - + + de Beispiel Operation Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -60,7 +61,7 @@ Constant ExampleProperty1 - ExternalReference + GlobalReference GlobalReference @@ -71,7 +72,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -88,7 +89,7 @@ Variable ExampleProperty2 - ExternalReference + GlobalReference GlobalReference @@ -99,7 +100,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -118,7 +119,7 @@ Constant ExampleProperty2 - ExternalReference + GlobalReference GlobalReference @@ -129,7 +130,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -148,7 +149,7 @@ Constant ExampleProperty3 - ExternalReference + GlobalReference GlobalReference @@ -159,7 +160,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference diff --git a/dataformat-xml/src/test/resources/qualifier_example.xml b/dataformat-xml/src/test/resources/qualifier_example.xml index 93b4cc661..c7f7131dd 100644 --- a/dataformat-xml/src/test/resources/qualifier_example.xml +++ b/dataformat-xml/src/test/resources/qualifier_example.xml @@ -1,5 +1,5 @@ - + TestSubmodel @@ -13,7 +13,7 @@ ManufacturerName - ExternalReference + GlobalReference GlobalReference @@ -36,7 +36,7 @@ xs:string http://acplt.org/ValueId/ACPLT - ExternalReference + GlobalReference GlobalReference diff --git a/dataformat-xml/src/test/resources/test_demo_full_example.xml b/dataformat-xml/src/test/resources/test_demo_full_example.xml index 26fbaefe4..3a2ce75a1 100644 --- a/dataformat-xml/src/test/resources/test_demo_full_example.xml +++ b/dataformat-xml/src/test/resources/test_demo_full_example.xml @@ -1,27 +1,15 @@ - + TestAssetAdministrationShell - - - en-us - An Example Asset Administration Shell for the test application - - - de - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - 0 - 9 + 0.9 + 0 https://acplt.org/Test_AssetAdministrationShell - ExternalReference + GlobalReference AssetAdministrationShell @@ -31,11 +19,19 @@ Instance - https://acplt.org/Test_Asset + + GlobalReference + + + AssetAdministrationShell + https://acplt.org/Test_Asset + + + - ExternalReference + GlobalReference Submodel @@ -44,7 +40,7 @@ - ExternalReference + GlobalReference Submodel @@ -53,7 +49,7 @@ - ExternalReference + GlobalReference Submodel @@ -68,11 +64,19 @@ https://acplt.org/Test_AssetAdministrationShell_Mandatory Instance - https://acplt.org/Test_Asset_Mandatory + + GlobalReference + + + AssetAdministrationShell + https://acplt.org/Test_Asset_Mandatory + + + - ExternalReference + GlobalReference Submodel @@ -81,7 +85,7 @@ - ExternalReference + GlobalReference Submodel @@ -96,33 +100,39 @@ https://acplt.org/Test_AssetAdministrationShell2_Mandatory Instance - https://acplt.org/Test_Asset_Mandatory + + GlobalReference + + + AssetAdministrationShell + https://acplt.org/Test_Asset_Mandatory + + + TestAssetAdministrationShell - - - en-us - An Example Asset Administration Shell for the test application - - - de - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - 0 - 9 + 0.9 + 0 https://acplt.org/Test_AssetAdministrationShell_Missing Instance - https://acplt.org/Test_Asset_Missing + + GlobalReference + + + AssetAdministrationShell + https://acplt.org/Test_Asset_Missing + + + - ExternalReference + GlobalReference Submodel @@ -137,23 +147,23 @@ Identification - + en-us An example asset identification submodel for the test application - - + + de Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 http://acplt.org/Submodels/Assets/TestAsset/Identification Instance - ExternalReference + GlobalReference Submodel @@ -164,24 +174,18 @@ ManufacturerName - - - en-us - Manufacturer Name - - - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - ExternalReference + GlobalReference GlobalReference @@ -204,7 +208,7 @@ xs:string http://acplt.org/ValueId/ACPLT - ExternalReference + GlobalReference GlobalReference @@ -214,20 +218,19 @@ - VARIABLE InstanceId - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - ExternalReference + GlobalReference GlobalReference @@ -235,30 +238,10 @@ - - - ExternalReference - - - GlobalReference - something_random_e14ad770 - - - - - ExternalReference - - - GlobalReference - something_random_bd061acd - - - - xs:string 978-8234-234-342 - ExternalReference + GlobalReference GlobalReference @@ -272,22 +255,22 @@ BillOfMaterial - + en-us An example bill of material submodel for the test application - - + + de Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - + - 0 + 0.9 http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial Instance - ExternalReference + GlobalReference Submodel @@ -299,17 +282,17 @@ ExampleEntity - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - ExternalReference + GlobalReference GlobalReference @@ -319,21 +302,21 @@ - CONSTANT + Constant ExampleProperty2 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -343,8 +326,8 @@ xs:string http://acplt.org/ValueId/ExampleValue2 - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ValueId/ExampleValue2 @@ -353,21 +336,21 @@ - CONSTANT + Constant ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -377,8 +360,8 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ValueId/ExampleValueId @@ -392,17 +375,17 @@ ExampleEntity2 - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - ExternalReference + GlobalReference GlobalReference @@ -411,30 +394,38 @@ SelfManagedEntity - https://acplt.org/Test_Asset2 + + GlobalReference + + + AssetAdministrationShell + https://acplt.org/Test_Asset2 + + + TestSubmodel - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 https://acplt.org/Test_Submodel Instance - ExternalReference + GlobalReference GlobalReference @@ -444,20 +435,20 @@ - PARAMETER + Parameter ExampleRelationshipElement - + en-us Example RelationshipElement object - - + + de Beispiel RelationshipElement Element - + - ExternalReference + GlobalReference GlobalReference @@ -473,8 +464,8 @@ https://acplt.org/Test_Submodel - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -501,20 +492,20 @@ - PARAMETER + Parameter ExampleAnnotatedRelationshipElement - + en-us Example AnnotatedRelationshipElement object - - + + de Beispiel AnnotatedRelationshipElement Element - + - ExternalReference + GlobalReference GlobalReference @@ -530,8 +521,8 @@ https://acplt.org/Test_Submodel - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -558,28 +549,30 @@ - PARAMETER + Parameter ExampleProperty3 + Instance xs:string some example annotation - PARAMETER + Parameter ExampleOperation + Template - + en-us Example Operation object - - + + de Beispiel Operation Element - + - ExternalReference + GlobalReference GlobalReference @@ -591,20 +584,20 @@ - CONSTANT + Constant ExampleProperty1 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference + GlobalReference GlobalReference @@ -615,7 +608,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -631,20 +624,20 @@ - CONSTANT + Constant ExampleProperty2 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference + GlobalReference GlobalReference @@ -655,7 +648,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -671,20 +664,20 @@ - CONSTANT + Constant ExampleProperty3 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference + GlobalReference GlobalReference @@ -695,7 +688,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -709,60 +702,935 @@ - PARAMETER + Parameter ExampleCapability - + en-us Example Capability object - - + + de Beispiel Capability Element - + - ExternalReference + GlobalReference GlobalReference http://acplt.org/Capabilities/ExampleCapability +<<<<<<< HEAD - PARAMETER + Parameter ExampleBasicEvent - + en-us Example BasicEvent object - - + + de Beispiel BasicEvent Element - + - ExternalReference + GlobalReference +======= + + + + + ExampleRelationshipElement + Parameter + + Example RelationshipElement object + Beispiel RelationshipElement Element + + + + http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + + https://acplt.org/Test_Submodel + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + ExampleEntity + ExampleProperty2 + + + + + + + ExampleAnnotatedRelationshipElement + Parameter + + Example AnnotatedRelationshipElement object + Beispiel AnnotatedRelationshipElement Element + + + + http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + + https://acplt.org/Test_Submodel + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + ExampleEntity + ExampleProperty2 + + + + + + ExampleProperty3 + Parameter + Instance + some example annotation + string + + + + + + + + ExampleOperation + Parameter + + Example Operation object + Beispiel Operation Element + + Template + + + http://acplt.org/Operations/ExampleOperation + + + + + + ExampleProperty3 + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/ValueId/ExampleValueId + + + http://acplt.org/ValueId/ExampleValueId + string + + + + + + + ExampleProperty1 + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/ValueId/ExampleValueId + + + http://acplt.org/ValueId/ExampleValueId + string + + + + + + + ExampleProperty2 + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/ValueId/ExampleValueId + + + http://acplt.org/ValueId/ExampleValueId + string + + + + + + + + ExampleCapability + Parameter + + Example Capability object + Beispiel Capability Element + + + + http://acplt.org/Capabilities/ExampleCapability + + + + + + + ExampleBasicEvent + Parameter + + Example BasicEvent object + Beispiel BasicEvent Element + + + + http://acplt.org/Events/ExampleBasicEvent + + + + + https://acplt.org/Test_Submodel + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + + + ExampleSubmodelCollectionOrdered + Parameter + + Example SubmodelElementCollectionOrdered object + Beispiel SubmodelElementCollectionOrdered Element + + + + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + true + + + + ExampleProperty + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/ValueId/ExampleValueId + + + http://acplt.org/ValueId/ExampleValueId + string + + + + + ExampleMultiLanguageProperty + Constant + + Example MultiLanguageProperty object + Beispiel MulitLanguageProperty Element + + + + http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + + http://acplt.org/ValueId/ExampleMultiLanguageValueId + + + + Example value of a MultiLanguageProperty element + Beispielswert für ein MulitLanguageProperty-Element + + + + + + ExampleRange + Parameter + + Example Range object + Beispiel Range Element + + + + http://acplt.org/Ranges/ExampleRange + + + 100 + 0 + int + + + + + + + + ExampleSubmodelCollectionUnordered + Parameter + + Example SubmodelElementCollectionUnordered object + Beispiel SubmodelElementCollectionUnordered Element + + + + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + false + false + + + + ExampleBlob + Parameter + + Example Blob object + Beispiel Blob Element + + + + http://acplt.org/Blobs/ExampleBlob + + + AQIDBAU= + application/pdf + + + + + ExampleFile + Parameter + + Example File object + Beispiel File Element + + + + http://acplt.org/Files/ExampleFile + + + /TestFile.pdf + application/pdf + + + + + ExampleReferenceElement + Parameter + + Example Reference Element object + Beispiel Reference Element Element + + + + http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + + https://acplt.org/Test_Submodel + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + + + + + + + Test_Submodel_Mandatory + https://acplt.org/Test_Submodel_Mandatory + Template + + + + ExampleRelationshipElement + + + https://acplt.org/Test_Submodel_Mandatory + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + https://acplt.org/Test_Submodel_Mandatory + ExampleSubmodelCollectionOrdered + ExampleMultiLanguageProperty + + + + + + + ExampleAnnotatedRelationshipElement + + + https://acplt.org/Test_Submodel_Mandatory + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + https://acplt.org/Test_Submodel_Mandatory + ExampleSubmodelCollectionOrdered + ExampleMultiLanguageProperty + + + + + + + + ExampleOperation + Template + + + + + ExampleCapability + + + + + ExampleBasicEvent + + + https://acplt.org/Test_Submodel_Mandatory + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + + + ExampleSubmodelCollectionOrdered + true + + + + ExampleProperty + string + + + + + ExampleMultiLanguageProperty + + + + + ExampleRange + int + + + + + + + + ExampleSubmodelCollectionUnordered + false + false + + + + ExampleBlob + application/pdf + + + + + ExampleFile + application/pdf + + + + + ExampleReferenceElement + + + + + + + + ExampleSubmodelCollectionUnordered2 + false + false + + + + + + + Test_Submodel2_Mandatory + https://acplt.org/Test_Submodel2_Mandatory + Instance + + + + TestSubmodel + + An example submodel for the test application + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + 0 + 0.9 + + https://acplt.org/Test_Submodel_Missing + Instance + +>>>>>>> update-to-rc02-smlist-tests GlobalReference http://acplt.org/Events/ExampleBasicEvent +<<<<<<< HEAD - ModelReference + GlobalReference +======= + + + + + ExampleRelationshipElement + Parameter + + Example RelationshipElement object + Beispiel RelationshipElement Element + + + + http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + + https://acplt.org/Test_Submodel_Missing + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + https://acplt.org/Test_Submodel_Missing + ExampleSubmodelCollectionOrdered + ExampleMultiLanguageProperty + + + + + + + ExampleAnnotatedRelationshipElement + Parameter + + Example AnnotatedRelationshipElement object + Beispiel AnnotatedRelationshipElement Element + + + + http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + + https://acplt.org/Test_Submodel_Missing + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + https://acplt.org/Test_Submodel_Missing + ExampleSubmodelCollectionOrdered + ExampleMultiLanguageProperty + + + + + + ExampleProperty + Parameter + Instance + some example annotation + string + + + + + + + + ExampleOperation + Parameter + + Example Operation object + Beispiel Operation Element + + Template + + + http://acplt.org/Operations/ExampleOperation + + + + + + ExampleProperty3 + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/Qualifier/ExampleQualifier + string + + + exampleValue + string + + + + + + + ExampleProperty1 + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/Qualifier/ExampleQualifier + string + + + exampleValue + string + + + + + + + ExampleProperty2 + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/Qualifier/ExampleQualifier + string + + + exampleValue + string + + + + + + + + ExampleCapability + Parameter + + Example Capability object + Beispiel Capability Element + + + + http://acplt.org/Capabilities/ExampleCapability + + + + + + + ExampleBasicEvent + Parameter + + Example BasicEvent object + Beispiel BasicEvent Element + + + + http://acplt.org/Events/ExampleBasicEvent + + + + + https://acplt.org/Test_Submodel_Missing + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + + + ExampleSubmodelCollectionOrdered + Parameter + + Example SubmodelElementCollectionOrdered object + Beispiel SubmodelElementCollectionOrdered Element + + + + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + true + + + + ExampleProperty + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/Qualifier/ExampleQualifier + string + + + exampleValue + string + + + + + ExampleMultiLanguageProperty + Constant + + Example MultiLanguageProperty object + Beispiel MulitLanguageProperty Element + + + + http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + Example value of a MultiLanguageProperty element + Beispielswert für ein MulitLanguageProperty-Element + + + + + + ExampleRange + Parameter + + Example Range object + Beispiel Range Element + + + + http://acplt.org/Ranges/ExampleRange + + + 100 + 0 + int + + + + + + + + ExampleSubmodelCollectionUnordered + Parameter + + Example SubmodelElementCollectionUnordered object + Beispiel SubmodelElementCollectionUnordered Element + + + + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + false + false + + + + ExampleBlob + Parameter + + Example Blob object + Beispiel Blob Element + + + + http://acplt.org/Blobs/ExampleBlob + + + AQIDBAU= + application/pdf + + + + + ExampleFile + Parameter + + Example File object + Beispiel File Element + + + + http://acplt.org/Files/ExampleFile + + + /TestFile.pdf + application/pdf + + + + + ExampleReferenceElement + Parameter + + Example Reference Element object + Beispiel Reference Element Element + + + + http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + + https://acplt.org/Test_Submodel_Missing + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + + + + + + + TestSubmodel + + An example submodel for the test application + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + 0 + 0.9 + + https://acplt.org/Test_Submodel_Template + Template + +>>>>>>> update-to-rc02-smlist-tests Submodel https://acplt.org/Test_Submodel - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -770,50 +1638,48 @@ - input - on + Input + On - - PARAMETER - ExampleSubmodelElementListOrdered + + Parameter + ExampleSubmodelCollectionOrdered - + en-us - Example ExampleSubmodelElementListOrdered object - - + Example SubmodelElementCollectionOrdered object + + de - Beispiel ExampleSubmodelElementListOrdered Element - + Beispiel SubmodelElementCollectionOrdered Element + - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - true - SubmodelElement - CONSTANT + Constant ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -823,8 +1689,8 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ValueId/ExampleValueId @@ -833,21 +1699,21 @@ - CONSTANT + Constant ExampleMultiLanguageProperty - + en-us Example MultiLanguageProperty object - - + + de Beispiel MultiLanguageProperty Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -855,18 +1721,18 @@ - + en-us Example value of a MultiLanguageProperty element - - + + de Beispielswert für ein MultiLanguageProperty-Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ValueId/ExampleMultiLanguageValueId @@ -875,21 +1741,21 @@ - PARAMETER + Parameter ExampleRange - + en-us Example Range object - - + + de Beispiel Range Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -901,46 +1767,46 @@ 100 - + - PARAMETER - ExampleSubmodelElementCollection + Parameter + ExampleSubmodelCollectionUnordered - + en-us - Example SubmodelElementCollection object - - + Example SubmodelElementCollectionUnordered object + + de - Beispiel SubmodelElementCollection Element - + Beispiel SubmodelElementCollectionUnordered Element + - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - PARAMETER + Parameter ExampleBlob - + en-us Example Blob object - - + + de Beispiel Blob Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Blobs/ExampleBlob @@ -951,21 +1817,21 @@ application/pdf - PARAMETER + Parameter ExampleFile - + en-us Example File object - - + + de Beispiel File Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Files/ExampleFile @@ -976,21 +1842,21 @@ application/pdf - PARAMETER + Parameter ExampleReferenceElement - + en-us Example Reference Element object - - + + de Beispiel Reference Element Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -998,15 +1864,15 @@ - ExternalReference - + GlobalReference + Submodel https://acplt.org/Test_Submodel - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -1034,8 +1900,8 @@ https://acplt.org/Test_Submodel_Mandatory - SubmodelElementList - ExampleSubmodelElementListUnordered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -1051,8 +1917,8 @@ https://acplt.org/Test_Submodel_Mandatory - SubmodelElementList - ExampleSubmodelElementListUnordered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered MultiLanguageProperty @@ -1072,11 +1938,11 @@ SubmodelElementCollection - ExampleSubmodelElementCollection + ExampleSubmodelCollectionOrdered - Blob - ExampleBlob + Property + ExampleProperty @@ -1088,8 +1954,8 @@ https://acplt.org/Test_Submodel_Mandatory - SubmodelElementList - ExampleSubmodelElementListUnordered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered MultiLanguageProperty @@ -1100,6 +1966,7 @@ ExampleOperation + Template ExampleCapability @@ -1107,15 +1974,15 @@ ExampleBasicEvent - ModelReference + GlobalReference Submodel https://acplt.org/Test_Submodel_Mandatory - SubmodelElementList - ExampleSubmodelElementListUnordered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -1123,13 +1990,11 @@ - output - off + Output + Off - - ExampleSubmodelElementListUnordered - false - SubmodelElement + + ExampleSubmodelCollectionOrdered ExampleProperty @@ -1143,9 +2008,9 @@ xs:int - + - ExampleSubmodelElementCollection + ExampleSubmodelCollectionUnordered ExampleBlob @@ -1161,7 +2026,7 @@ - ExampleSubmodelElementCollection2 + ExampleSubmodelCollectionUnordered2 @@ -1171,25 +2036,25 @@ Instance - TestSubmodelMissing + TestSubmodel - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 https://acplt.org/Test_Submodel_Missing Instance - ExternalReference + GlobalReference GlobalReference @@ -1199,20 +2064,20 @@ - PARAMETER + Parameter ExampleRelationshipElement - + en-us Example RelationshipElement object - - + + de Beispiel RelationshipElement Element - + - ExternalReference + GlobalReference GlobalReference @@ -1228,8 +2093,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -1245,8 +2110,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered MultiLanguageProperty @@ -1256,20 +2121,20 @@ - PARAMETER + Parameter ExampleAnnotatedRelationshipElement - + en-us Example AnnotatedRelationshipElement object - - + + de Beispiel AnnotatedRelationshipElement Element - + - ExternalReference + GlobalReference GlobalReference @@ -1285,8 +2150,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -1302,8 +2167,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered MultiLanguageProperty @@ -1313,28 +2178,30 @@ - PARAMETER + Parameter ExampleProperty + Instance xs:string some example annotation - PARAMETER + Parameter ExampleOperation - + en-us Example Operation object - - + + de Beispiel Operation Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -1346,20 +2213,20 @@ - CONSTANT + Constant ExampleProperty1 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference + GlobalReference GlobalReference @@ -1383,20 +2250,20 @@ - CONSTANT + Constant ExampleProperty2 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference + GlobalReference GlobalReference @@ -1420,20 +2287,20 @@ - CONSTANT + Constant ExampleProperty3 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference + GlobalReference GlobalReference @@ -1441,6 +2308,7 @@ +<<<<<<< HEAD http://acplt.org/Qualifier/ExampleQualifier @@ -1455,20 +2323,20 @@ - PARAMETER + Parameter ExampleCapability - + en-us Example Capability object - - + + de Beispiel Capability Element - + - ExternalReference + GlobalReference GlobalReference @@ -1478,20 +2346,20 @@ - PARAMETER + Parameter ExampleBasicEvent - + en-us Example BasicEvent object - - + + de Beispiel BasicEvent Element - + - ExternalReference + GlobalReference GlobalReference @@ -1500,15 +2368,15 @@ - ExternalReference + GlobalReference Submodel https://acplt.org/Test_Submodel_Missing - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -1516,50 +2384,48 @@ - input - on + Input + On - - PARAMETER - ExampleSubmodelElementListOrdered + + Parameter + ExampleSubmodelCollectionOrdered - + en-us - Example SubmodelElementListOrdered object - - + Example SubmodelElementCollectionOrdered object + + de - Beispiel SubmodelElementListOrdered Element - + Beispiel SubmodelElementCollectionOrdered Element + - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - true - SubmodelElement - CONSTANT + Constant ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -1576,21 +2442,21 @@ exampleValue - CONSTANT + Constant ExampleMultiLanguageProperty - + en-us Example MultiLanguageProperty object - - + + de Beispiel MultiLanguageProperty Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -1598,32 +2464,32 @@ - + en-us Example value of a MultiLanguageProperty element - - + + de Beispielswert für ein MultiLanguageProperty-Element - + - PARAMETER + Parameter ExampleRange - + en-us Example Range object - - + + de Beispiel Range Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -1635,46 +2501,46 @@ 100 - + - PARAMETER - ExampleSubmodelElementCollection + Parameter + ExampleSubmodelCollectionUnordered - + en-us - Example SubmodelElementCollection object - - + Example SubmodelElementCollectionUnordered object + + de - Beispiel SubmodelElementCollection Element - + Beispiel SubmodelElementCollectionUnordered Element + - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - PARAMETER + Parameter ExampleBlob - + en-us Example Blob object - - + + de Beispiel Blob Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Blobs/ExampleBlob @@ -1685,21 +2551,21 @@ application/pdf - PARAMETER + Parameter ExampleFile - + en-us Example File object - - + + de Beispiel File Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Files/ExampleFile @@ -1710,21 +2576,21 @@ application/pdf - PARAMETER + Parameter ExampleReferenceElement - + en-us Example Reference Element object - - + + de Beispiel Reference Element Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -1732,7 +2598,7 @@ - ModelReference + GlobalReference Submodel @@ -1740,11 +2606,11 @@ SubmodelElementCollection - ExampleSubmodelElementCollection + ExampleSubmodelCollectionOrdered - File - ExampleFile + Property + ExampleProperty @@ -1754,25 +2620,25 @@ - TestSubmodelTemplate + TestSubmodel - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 https://acplt.org/Test_Submodel_Template Template - ExternalReference + GlobalReference GlobalReference @@ -1782,20 +2648,21 @@ - PARAMETER + Parameter ExampleRelationshipElement - + en-us Example RelationshipElement object - - + + de Beispiel RelationshipElement Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -1806,14 +2673,6 @@ ModelReference - - Submodel - https://acplt.org/Test_Submodel_Template - - - Operation - ExampleOperation - Property ExampleProperty @@ -1823,14 +2682,6 @@ ModelReference - - Submodel - https://acplt.org/Test_Submodel_Template - - - Operation - ExampleOperation - Property ExampleProperty @@ -1839,20 +2690,21 @@ - PARAMETER + Parameter ExampleAnnotatedRelationshipElement - + en-us Example AnnotatedRelationshipElement object - - + + de Beispiel AnnotatedRelationshipElement Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -1863,14 +2715,6 @@ ModelReference - - Submodel - https://acplt.org/Test_Submodel_Template - - - Operation - ExampleOperation - Property ExampleProperty @@ -1880,14 +2724,6 @@ ModelReference - - Submodel - https://acplt.org/Test_Submodel_Template - - - Operation - ExampleOperation - Property ExampleProperty @@ -1896,20 +2732,21 @@ - PARAMETER + Parameter ExampleOperation - + en-us Example Operation object - - + + de Beispiel Operation Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -1921,20 +2758,41 @@ - CONSTANT + Constant ExampleProperty +<<<<<<< HEAD +======= + + + ExampleProperty + + + + + + + ExampleSubmodelCollectionOrdered + Parameter - + Example SubmodelElementCollectionOrdered object + Beispiel SubmodelElementCollectionOrdered Element + +>>>>>>> update-to-rc02-smlist-tests +======= + + en-us Example Property object - - + + de Beispiel Property Element - + +>>>>>>> update-to-rc02-xml + Template - ExternalReference + GlobalReference GlobalReference @@ -1942,6 +2800,7 @@ +<<<<<<< HEAD xs:string @@ -1951,20 +2810,108 @@ - CONSTANT + Constant ExampleProperty +<<<<<<< HEAD +======= + true + + + + ExampleProperty + Constant + + Example Property object + Beispiel Property Element + + Template + + + http://acplt.org/Properties/ExampleProperty + + + string + + + + + ExampleMultiLanguageProperty + Constant + + Example MultiLanguageProperty object + Beispiel MulitLanguageProperty Element + + Template + + + http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + + + + ExampleRange + Parameter + + Example Range object + Beispiel Range Element + + Template + + + http://acplt.org/Ranges/ExampleRange + + + 100 + int + + + + + ExampleRange2 + Parameter + + Example Range object + Beispiel Range Element + + Template + + + http://acplt.org/Ranges/ExampleRange + + + 0 + int + + + + + + + + ExampleSubmodelCollectionUnordered + Parameter - + Example SubmodelElementCollectionUnordered object + Beispiel SubmodelElementCollectionUnordered Element + +>>>>>>> update-to-rc02-smlist-tests +======= + + en-us Example Property object - - + + de Beispiel Property Element - + +>>>>>>> update-to-rc02-xml + Template - ExternalReference + GlobalReference GlobalReference @@ -1981,20 +2928,21 @@ - CONSTANT + Constant ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -2009,20 +2957,21 @@ - PARAMETER + Parameter ExampleCapability - + en-us Example Capability object - - + + de Beispiel Capability Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -2032,20 +2981,21 @@ - PARAMETER + Parameter ExampleBasicEvent - + en-us Example BasicEvent object - - + + de Beispiel BasicEvent Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -2054,66 +3004,58 @@ - ModelReference + GlobalReference - - Submodel - https://acplt.org/Test_Submodel_Template - - - Operation - ExampleOperation - Property ExampleProperty - output - off + Output + Off - - PARAMETER - ExampleSubmodelElementListOrdered + + Parameter + ExampleSubmodelCollectionOrdered - + en-us - Example SubmodelElementListOrdered object - - + Example SubmodelElementCollectionOrdered object + + de - Beispiel SubmodelElementListOrdered Element - + Beispiel SubmodelElementCollectionOrdered Element + + Template - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - true - SubmodelElement - CONSTANT + Constant ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -2123,21 +3065,22 @@ xs:string - CONSTANT + Constant ExampleMultiLanguageProperty - + en-us Example MultiLanguageProperty object - - + + de Beispiel MultiLanguageProperty Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -2146,21 +3089,22 @@ - PARAMETER + Parameter ExampleRange - + en-us Example Range object - - + + de Beispiel Range Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -2171,21 +3115,22 @@ 100 - PARAMETER + Parameter ExampleRange2 - + en-us Example Range object - - + + de Beispiel Range Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -2196,46 +3141,48 @@ 0 - + - PARAMETER - ExampleSubmodelElementCollection + Parameter + ExampleSubmodelCollectionUnordered - + en-us - Example SubmodelElementCollection object - - + Example SubmodelElementCollectionUnordered object + + de - Beispiel SubmodelElementCollection Element - + Beispiel SubmodelElementCollectionUnordered Element + + Template - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - PARAMETER + Parameter ExampleBlob - + en-us Example Blob object - - + + de Beispiel Blob Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Blobs/ExampleBlob @@ -2245,21 +3192,22 @@ application/pdf - PARAMETER + Parameter ExampleFile - + en-us Example File object - - + + de Beispiel File Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Files/ExampleFile @@ -2269,21 +3217,22 @@ application/pdf - PARAMETER + Parameter ExampleReferenceElement - + en-us Example Reference Element object - - + + de Beispiel Reference Element Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -2294,24 +3243,25 @@ - PARAMETER - ExampleSubmodelElementCollection2 + Parameter + ExampleSubmodelCollectionUnordered2 - + en-us - Example SubmodelElementCollection object - - + Example SubmodelElementCollectionUnordered object + + de - Beispiel SubmodelElementCollection Element - + Beispiel SubmodelElementCollectionUnordered Element + + Template - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered @@ -2323,27 +3273,27 @@ TestConceptDescription - + en-us An example concept description for the test application - - + + de Ein Beispiel-ConceptDescription für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 https://acplt.org/Test_ConceptDescription - ExternalReference + GlobalReference GlobalReference - http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription + http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription @@ -2354,68 +3304,67 @@ https://acplt.org/Test_ConceptDescription_Mandatory - PROPERTY TestConceptDescription1 - + en-us An example concept description for the test application - - + + de Ein Beispiel-ConceptDescription für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 https://acplt.org/Test_ConceptDescription_Missing TestSpec_01 - 0 - 9 + 0.9 + 0 http://acplt.org/DataSpecifciations/Example/Identification - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + de Test Specification - - + + en-us TestSpecification - + - + de Test Spec - - + + en-us TestSpec - + SpaceUnit - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Units/SpaceUnit @@ -2426,14 +3375,14 @@ SU REAL_MEASURE - + de Dies ist eine Data Specification für Testzwecke - - + + en-us This is a DataSpecification for testing purposes - + string @@ -2441,7 +3390,7 @@ http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -2453,7 +3402,7 @@ http://acplt.org/ValueId/ExampleValueId2 - ExternalReference + GlobalReference GlobalReference @@ -2465,13 +3414,14 @@ TEST + Max - ExternalReference + GlobalReference GlobalReference diff --git a/dataformat-xml/src/test/resources/xmlExample.xml b/dataformat-xml/src/test/resources/xmlExample.xml index 5e37d5016..a09966209 100644 --- a/dataformat-xml/src/test/resources/xmlExample.xml +++ b/dataformat-xml/src/test/resources/xmlExample.xml @@ -1,20 +1,26 @@ - + ExampleMotor http://customer.com/aas/9175_7013_7091_9168 Instance - http://customer.com/assets/KHBVZJSQKIY + + GlobalReference + + + AssetAdministrationShell + http://customer.com/assets/KHBVZJSQKIY + + + EquipmentID 538fd1b3-f99f-4a52-9c75-72e9fa921270 - ExternalReference + GlobalReference GlobalReference @@ -27,7 +33,7 @@ DeviceID QjYgPggjwkiHk4RrQiYSLg== - ExternalReference + GlobalReference GlobalReference @@ -44,7 +50,7 @@ - ExternalReference + GlobalReference Submodel @@ -53,7 +59,7 @@ - ExternalReference + GlobalReference Submodel @@ -62,7 +68,7 @@ - ExternalReference + GlobalReference Submodel @@ -77,8 +83,9 @@ TechnicalData http://i40.customer.com/type/1/1/7A7104BDAB57E184 + Instance - ExternalReference + GlobalReference GlobalReference @@ -88,10 +95,11 @@ - PARAMETER + Parameter MaxRotationSpeed + Instance - ExternalReference + GlobalReference ConceptDescription @@ -111,8 +119,9 @@ OperatingManual + Instance - ExternalReference + GlobalReference ConceptDescription @@ -123,8 +132,9 @@ Title + Instance - ExternalReference + GlobalReference ConceptDescription @@ -137,8 +147,9 @@ DigitalFile_PDF + Instance - ExternalReference + GlobalReference ConceptDescription @@ -159,10 +170,11 @@ Instance - VARIABLE + Variable RotationSpeed + Instance - ExternalReference + GlobalReference ConceptDescription @@ -183,44 +195,44 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + EN Title - - + + DE Titel - + - + EN Title - - + + DE Titel - + ExampleString ExampleString STRING_TRANSLATABLE - + EN SprachabhängigerTiteldesDokuments. - + @@ -233,44 +245,44 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + EN DigitalFile - - + + EN DigitalFile - + - + EN DigitalFile - - + + DE DigitaleDatei - + ExampleString ExampleString STRING - + EN A file representing the document version. In addition to the mandatory PDF file, other files can be specified. - + @@ -282,35 +294,35 @@ MaxRotationSpeed 2 - 1 + 2.1 0173-1#02-BAA120#008 - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + de max.Drehzahl - - + + en Max.rotationspeed - + 1/min - ExternalReference + GlobalReference GlobalReference @@ -321,14 +333,14 @@ ExampleString REAL_MEASURE - + de HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf - - + + EN Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated - + @@ -342,39 +354,39 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + DE AktuelleDrehzahl - - + + EN Actualrotationspeed - + - + DE AktuelleDrehzahl - - + + EN - ActRotationSpeed - + ActualRotationSpeed + 1/min - ExternalReference + GlobalReference GlobalReference @@ -385,14 +397,14 @@ ExampleString REAL_MEASURE - + DE Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird - - + + EN Actual rotationspeed with which the motor or feedingunit is operated - + @@ -405,40 +417,40 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + EN Document - + - + EN Document - - + + DE Dokument - + ExampleString [ISO15519-1:2010] STRING - + EN Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. - + diff --git a/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml b/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml index 2db066ec3..2cb861291 100644 --- a/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml +++ b/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml @@ -1,20 +1,25 @@ - - + ExampleMotor http://customer.com/aas/9175_7013_7091_9168 Instance - http://customer.com/assets/KHBVZJSQKIY + + GlobalReference + + + AssetAdministrationShell + http://customer.com/assets/KHBVZJSQKIY + + + EquipmentID 538fd1b3-f99f-4a52-9c75-72e9fa921270 - ExternalReference + GlobalReference GlobalReference @@ -27,7 +32,7 @@ DeviceID QjYgPggjwkiHk4RrQiYSLg== - ExternalReference + GlobalReference GlobalReference @@ -44,7 +49,7 @@ - ExternalReference + GlobalReference Submodel @@ -53,7 +58,7 @@ - ExternalReference + GlobalReference Submodel @@ -62,7 +67,7 @@ - ExternalReference + GlobalReference Submodel @@ -77,8 +82,9 @@ TechnicalData http://i40.customer.com/type/1/1/7A7104BDAB57E184 + Instance - ExternalReference + GlobalReference GlobalReference @@ -88,10 +94,11 @@ - PARAMETER + Parameter MaxRotationSpeed + Instance - ExternalReference + GlobalReference ConceptDescription @@ -111,8 +118,9 @@ OperatingManual + Instance - ExternalReference + GlobalReference ConceptDescription @@ -123,8 +131,9 @@ Title + Instance - ExternalReference + GlobalReference ConceptDescription @@ -137,8 +146,9 @@ DigitalFile_PDF + Instance - ExternalReference + GlobalReference ConceptDescription @@ -159,10 +169,11 @@ Instance - VARIABLE + Variable RotationSpeed + Instance - ExternalReference + GlobalReference ConceptDescription @@ -183,44 +194,44 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + EN Title - - + + DE Titel - + - + EN Title - - + + DE Titel - + ExampleString ExampleString STRING_TRANSLATABLE - + EN SprachabhängigerTiteldesDokuments. - + @@ -233,44 +244,44 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + EN DigitalFile - - + + EN DigitalFile - + - + EN DigitalFile - - + + DE DigitaleDatei - + ExampleString ExampleString STRING - + EN A file representing the document version. In addition to the mandatory PDF file, other files can be specified. - + @@ -282,35 +293,35 @@ MaxRotationSpeed 2 - 1 + 2.1 0173-1#02-BAA120#008 - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + de max.Drehzahl - - + + en Max.rotationspeed - + 1/min - ExternalReference + GlobalReference GlobalReference @@ -321,14 +332,14 @@ ExampleString REAL_MEASURE - + de HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf - - + + EN Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated - + @@ -342,39 +353,39 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + DE AktuelleDrehzahl - - + + EN Actualrotationspeed - + - + DE AktuelleDrehzahl - - + + EN - ActRotationSpeed - + ActualRotationSpeed + 1/min - ExternalReference + GlobalReference GlobalReference @@ -385,14 +396,14 @@ ExampleString REAL_MEASURE - + DE Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird - - + + EN Actual rotationspeed with which the motor or feedingunit is operated - + @@ -405,40 +416,40 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + EN Document - + - + EN Document - - + + DE Dokument - + ExampleString [ISO15519-1:2010] STRING - + EN Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. - + From 7e1b1c43da7dfacffbdc269f21e38536dabee71e Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 29 Jun 2023 16:55:45 +0200 Subject: [PATCH 08/59] Update model project --- model/pom.xml | 2 + .../aas4j/v3/model/AasSubmodelElements.java | 38 +-- .../v3/model/AdministrativeInformation.java | 66 +--- .../model/AnnotatedRelationshipElement.java | 10 +- .../v3/model/AssetAdministrationShell.java | 48 +-- .../AssetAdministrationShellDescriptor.java | 169 ++++++++++ .../aas4j/v3/model/AssetInformation.java | 87 ++---- .../digitaltwin/aas4j/v3/model/AssetKind.java | 19 +- .../aas4j/v3/model/BasicEventElement.java | 140 ++++----- .../digitaltwin/aas4j/v3/model/Blob.java | 40 +-- .../aas4j/v3/model/ConceptDescription.java | 18 +- .../v3/model/DataSpecificationContent.java | 7 +- .../v3/model/DataSpecificationIec61360.java | 220 ++++++------- .../model/DataSpecificationPhysicalUnit.java | 293 ++++++++++++++++++ .../aas4j/v3/model/DataTypeDefXsd.java | 194 ++++++++++++ .../aas4j/v3/model/DataTypeIec61360.java | 46 +-- .../aas4j/v3/model/Descriptor.java | 49 +++ .../digitaltwin/aas4j/v3/model/Direction.java | 8 +- .../v3/model/EmbeddedDataSpecification.java | 18 +- .../digitaltwin/aas4j/v3/model/Endpoint.java | 61 ++++ .../digitaltwin/aas4j/v3/model/Entity.java | 78 ++--- .../aas4j/v3/model/EntityType.java | 8 +- .../aas4j/v3/model/Environment.java | 46 +-- .../aas4j/v3/model/EventPayload.java | 132 ++++---- .../digitaltwin/aas4j/v3/model/Extension.java | 55 ++-- .../digitaltwin/aas4j/v3/model/File.java | 40 +-- .../aas4j/v3/model/HasDataSpecification.java | 12 +- .../aas4j/v3/model/HasExtensions.java | 10 +- .../digitaltwin/aas4j/v3/model/HasKind.java | 17 +- .../aas4j/v3/model/HasSemantics.java | 16 +- .../aas4j/v3/model/Identifiable.java | 16 +- .../aas4j/v3/model/annotations/IRI.java | 4 +- .../v3/model/annotations/KnownSubtypes.java | 4 +- .../v3/model/builder/AbstractBuilder.java | 4 +- .../AdministrativeInformationBuilder.java | 37 +-- .../AnnotatedRelationshipElementBuilder.java | 76 ++--- .../AssetAdministrationShellBuilder.java | 85 ++--- ...tAdministrationShellDescriptorBuilder.java | 134 ++++++++ .../builder/AssetInformationBuilder.java | 44 +-- .../builder/BasicEventElementBuilder.java | 168 +++++----- .../aas4j/v3/model/builder/BlobBuilder.java | 126 ++++---- .../aas4j/v3/model/builder/Builder.java | 4 +- .../v3/model/builder/CapabilityBuilder.java | 106 ++++--- .../builder/ConceptDescriptionBuilder.java | 81 ++--- .../DataSpecificationIec61360Builder.java | 140 ++++----- .../DataSpecificationPhysicalUnitBuilder.java | 181 +++++++++++ .../v3/model/builder/DescriptorBuilder.java | 46 +++ .../EmbeddedDataSpecificationBuilder.java | 4 +- .../v3/model/builder/EndpointBuilder.java | 46 +++ .../aas4j/v3/model/builder/EntityBuilder.java | 161 +++++----- .../v3/model/builder/EnvironmentBuilder.java | 44 +-- .../v3/model/builder/EventPayloadBuilder.java | 64 ++-- .../v3/model/builder/ExtensionBuilder.java | 35 +-- .../aas4j/v3/model/builder/FileBuilder.java | 126 ++++---- .../v3/model/builder/LangStringBuilder.java | 54 ++++ .../builder/MultiLanguagePropertyBuilder.java | 124 +++++--- .../v3/model/builder/OperationBuilder.java | 150 +++++---- .../v3/model/builder/PropertyBuilder.java | 128 ++++---- .../builder/ProtocolInformationBuilder.java | 88 ++++++ .../v3/model/builder/QualifierBuilder.java | 26 +- .../aas4j/v3/model/builder/RangeBuilder.java | 126 ++++---- .../v3/model/builder/ReferenceBuilder.java | 44 +-- .../builder/ReferenceElementBuilder.java | 106 ++++--- .../builder/RelationshipElementBuilder.java | 106 ++++--- .../v3/model/builder/ResourceBuilder.java | 24 +- .../model/builder/SpecificAssetIdBuilder.java | 92 ++++++ .../v3/model/builder/SubmodelBuilder.java | 145 +++++---- .../builder/SubmodelDescriptorBuilder.java | 116 +++++++ .../SubmodelElementCollectionBuilder.java | 123 +++++--- .../builder/SubmodelElementListBuilder.java | 136 ++++---- .../DefaultAdministrativeInformation.java | 71 +---- .../DefaultAnnotatedRelationshipElement.java | 119 ++++--- .../impl/DefaultAssetAdministrationShell.java | 114 +++---- ...ultAssetAdministrationShellDescriptor.java | 201 ++++++++++++ .../model/impl/DefaultAssetInformation.java | 81 ++--- .../model/impl/DefaultBasicEventElement.java | 213 +++++++------ 76 files changed, 3997 insertions(+), 2073 deletions(-) create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java diff --git a/model/pom.xml b/model/pom.xml index 52cc610de..63f72fda8 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -21,7 +21,9 @@ 1.8 1.5.0 3.5.0 + 4.1 3.4.5 + 0xDFCC34A6 diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java index b5216b2d5..897fab65f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,87 +28,87 @@ public enum AasSubmodelElements { /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/AnnotatedRelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/AnnotatedRelationshipElement") ANNOTATED_RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/BasicEventElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/BasicEventElement") BASIC_EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Blob") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Blob") BLOB, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Capability") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Capability") CAPABILITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/DataElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/DataElement") DATA_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Entity") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Entity") ENTITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/EventElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/EventElement") EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/File") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/File") FILE, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/MultiLanguageProperty") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/MultiLanguageProperty") MULTI_LANGUAGE_PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Operation") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Operation") OPERATION, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Property") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Property") PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Range") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Range") RANGE, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/ReferenceElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/ReferenceElement") REFERENCE_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/RelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/RelationshipElement") RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/SubmodelElement") SUBMODEL_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElementCollection") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/SubmodelElementCollection") SUBMODEL_ELEMENT_COLLECTION, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElementList") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/SubmodelElementList") SUBMODEL_ELEMENT_LIST; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java index 19390fc5c..fc1808716 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,80 +29,42 @@ }) public interface AdministrativeInformation extends HasDataSpecification { - /** - * Version of the element. - * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version - * - * @return Returns the String for the property version. - */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") - String getVersion(); - - /** - * Version of the element. - * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version - * - * @param version desired value for the property version. - */ - void setVersion(String version); - /** * Revision of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/revision + * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision * * @return Returns the String for the property revision. */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/revision") + @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") String getRevision(); /** * Revision of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/revision + * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision * * @param revision desired value for the property revision. */ void setRevision(String revision); /** - * The subject ID of the subject responsible for making the element. - * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator - * - * @return Returns the Reference for the property creator. - */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/creator") - Reference getCreator(); - - /** - * The subject ID of the subject responsible for making the element. - * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator - * - * @param creator desired value for the property creator. - */ - void setCreator(Reference creator); - - /** - * Identifier of the template that guided the creation of the element. + * Version of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId + * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version * - * @return Returns the String for the property templateId. + * @return Returns the String for the property version. */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId") - String getTemplateId(); + @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") + String getVersion(); /** - * Identifier of the template that guided the creation of the element. + * Version of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId + * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version * - * @param templateId desired value for the property templateId. + * @param version desired value for the property version. */ - void setTemplateId(String templateId); + void setVersion(String version); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java index 788534fba..b99fa839e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -35,18 +35,20 @@ public interface AnnotatedRelationshipElement extends RelationshipElement { * A data element that represents an annotation that holds for the relationship between the two * elements * - * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations + * More information under + * https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations * * @return Returns the List of DataElements for the property annotations. */ - @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations") + @IRI("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations") List getAnnotations(); /** * A data element that represents an annotation that holds for the relationship between the two * elements * - * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations + * More information under + * https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations * * @param annotations desired value for the property annotations. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java index 3e0b0b9cb..05483cef1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,57 +31,59 @@ public interface AssetAdministrationShell extends HasDataSpecification, Identifiable { /** - * The reference to the AAS the AAS was derived from. + * Meta-information about the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom + * More information under + * https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation * - * @return Returns the Reference for the property derivedFrom. + * @return Returns the AssetInformation for the property assetInformation. */ - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom") - Reference getDerivedFrom(); + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") + AssetInformation getAssetInformation(); /** - * The reference to the AAS the AAS was derived from. + * Meta-information about the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom + * More information under + * https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation * - * @param derivedFrom desired value for the property derivedFrom. + * @param assetInformation desired value for the property assetInformation. */ - void setDerivedFrom(Reference derivedFrom); + void setAssetInformation(AssetInformation assetInformation); /** - * Meta-information about the asset the AAS is representing. + * The reference to the AAS the AAS was derived from. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom * - * @return Returns the AssetInformation for the property assetInformation. + * @return Returns the Reference for the property derivedFrom. */ - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation") - AssetInformation getAssetInformation(); + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") + Reference getDerivedFrom(); /** - * Meta-information about the asset the AAS is representing. + * The reference to the AAS the AAS was derived from. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom * - * @param assetInformation desired value for the property assetInformation. + * @param derivedFrom desired value for the property derivedFrom. */ - void setAssetInformation(AssetInformation assetInformation); + void setDerivedFrom(Reference derivedFrom); /** * References to submodels of the AAS. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels * * @return Returns the List of References for the property submodels. */ - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels") List getSubmodels(); /** * References to submodels of the AAS. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels * * @param submodels desired value for the property submodels. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java new file mode 100644 index 000000000..124298da8 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellDescriptor; + +import java.util.List; + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultAssetAdministrationShellDescriptor.class) +}) +public interface AssetAdministrationShellDescriptor extends Descriptor { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/administration + * + * @return Returns the AdministrativeInformation for the property administration. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/administration") + AdministrativeInformation getAdministration(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/administration + * + * @param administration desired value for the property administration. + */ + void setAdministration(AdministrativeInformation administration); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description + * + * @return Returns the LangStringSet for the property description. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description") + List getDescription(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description + * + * @param description desired value for the property description. + */ + void setDescription(List description); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName + * + * @return Returns the LangStringSet for the property displayName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName") + List getDisplayName(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName + * + * @param displayName desired value for the property displayName. + */ + void setDisplayName(List displayName); + + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId + * + * @return Returns the String for the property idShort. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId") + Reference getGlobalAssetId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId + * + * @param globalAssetId desired value for the property globalAssetId. + */ + void setGlobalAssetId(Reference globalAssetId); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort + * + * @return Returns the String for the property idShort. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort") + String getIdShort(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort + * + * @param idShort desired value for the property idShort. + */ + void setIdShort(String idShort); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification + * + * @return Returns the String for the property identification. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification") + String getIdentification(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification + * + * @param identification desired value for the property identification. + */ + void setIdentification(String identification); + + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetId + * + * @return Returns the String for the property specificAssetId. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetIds") + SpecificAssetId getSpecificAssetIds(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetIds + * + * @param specificAssetIds desired value for the property specificAssetIds. + */ + void setSpecificAssetIds(SpecificAssetId specificAssetIds); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor + * + * @return Returns the String for the property submodelDescriptor. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor") + List getSubmodelDescriptor(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor + * + * @param submodelDescriptor desired value for the property submodelDescriptor. + */ + void setSubmodelDescriptor(List submodelDescriptor); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java index ae48cae15..689bb3568 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,100 +34,79 @@ public interface AssetInformation { /** * Denotes whether the Asset is of kind 'Type' or 'Instance'. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetKind + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind * * @return Returns the AssetKind for the property assetKind. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetKind") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") AssetKind getAssetKind(); /** * Denotes whether the Asset is of kind 'Type' or 'Instance'. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetKind + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind * * @param assetKind desired value for the property assetKind. */ void setAssetKind(AssetKind assetKind); + /** + * Thumbnail of the asset represented by the Asset Administration Shell. + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail + * + * @return Returns the Resource for the property defaultThumbnail. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") + Resource getDefaultThumbnail(); + + /** + * Thumbnail of the asset represented by the Asset Administration Shell. + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail + * + * @param defaultThumbnail desired value for the property defaultThumbnail. + */ + void setDefaultThumbnail(Resource defaultThumbnail); + /** * Global identifier of the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId * - * @return Returns the String for the property globalAssetId. + * @return Returns the Reference for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId") - String getGlobalAssetId(); + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") + Reference getGlobalAssetId(); /** * Global identifier of the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId * * @param globalAssetId desired value for the property globalAssetId. */ - void setGlobalAssetId(String globalAssetId); + void setGlobalAssetId(Reference globalAssetId); /** * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial * number etc. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds * * @return Returns the List of SpecificAssetIds for the property specificAssetIds. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") List getSpecificAssetIds(); /** * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial * number etc. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds * * @param specificAssetIds desired value for the property specificAssetIds. */ void setSpecificAssetIds(List specificAssetIds); - /** - * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset - * under consideration as identified by 'globalAssetId'. - * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType - * - * @return Returns the String for the property assetType. - */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetType") - String getAssetType(); - - /** - * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset - * under consideration as identified by 'globalAssetId'. - * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType - * - * @param assetType desired value for the property assetType. - */ - void setAssetType(String assetType); - - /** - * Thumbnail of the asset represented by the Asset Administration Shell. - * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail - * - * @return Returns the Resource for the property defaultThumbnail. - */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") - Resource getDefaultThumbnail(); - - /** - * Thumbnail of the asset represented by the Asset Administration Shell. - * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail - * - * @param defaultThumbnail desired value for the property defaultThumbnail. - */ - void setDefaultThumbnail(Resource defaultThumbnail); - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java index 74400ccd9..a781efe26 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -27,21 +27,16 @@ public enum AssetKind { /** - * Instance asset + * concrete, clearly identifiable component of a certain type */ - @IRI("https://admin-shell.io/aas/3/0/AssetKind/Instance") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetKind/Instance") INSTANCE, /** - * Neither a type asset nor an instance asset - */ - @IRI("https://admin-shell.io/aas/3/0/AssetKind/NotApplicable") - NOT_APPLICABLE, - - /** - * Type asset + * hardware or software element which specifies the common attributes shared by all instances of the + * type */ - @IRI("https://admin-shell.io/aas/3/0/AssetKind/Type") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetKind/Type") TYPE; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java index 1dc3622d9..9393d184c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,96 +29,73 @@ }) public interface BasicEventElement extends EventElement { - /** - * Reference to the 'Referable', which defines the scope of the event. Can be - * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed - * - * @return Returns the Reference for the property observed. - */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/observed") - Reference getObserved(); - - /** - * Reference to the 'Referable', which defines the scope of the event. Can be - * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed - * - * @param observed desired value for the property observed. - */ - void setObserved(Reference observed); - /** * Direction of event. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/direction + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction * * @return Returns the Direction for the property direction. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/direction") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") Direction getDirection(); /** * Direction of event. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/direction + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction * * @param direction desired value for the property direction. */ void setDirection(Direction direction); /** - * State of event. + * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate * - * @return Returns the StateOfEvent for the property state. + * @return Returns the String for the property lastUpdate. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/state") - StateOfEvent getState(); + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") + String getLastUpdate(); /** - * State of event. + * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate * - * @param state desired value for the property state. + * @param lastUpdate desired value for the property lastUpdate. */ - void setState(StateOfEvent state); + void setLastUpdate(String lastUpdate); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * For input direction: not applicable. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval * - * @return Returns the String for the property messageTopic. + * @return Returns the String for the property maxInterval. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic") - String getMessageTopic(); + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") + String getMaxInterval(); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * For input direction: not applicable. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval * - * @param messageTopic desired value for the property messageTopic. + * @param maxInterval desired value for the property maxInterval. */ - void setMessageTopic(String messageTopic); + void setMaxInterval(String maxInterval); /** * Information, which outer message infrastructure shall handle messages for the 'EventElement'. * Refers to a 'Submodel', 'SubmodelElementList', 'SubmodelElementCollection' or 'Entity', which * contains 'DataElement''s describing the proprietary specification for the message broker. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker * * @return Returns the Reference for the property messageBroker. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") Reference getMessageBroker(); /** @@ -126,69 +103,92 @@ public interface BasicEventElement extends EventElement { * Refers to a 'Submodel', 'SubmodelElementList', 'SubmodelElementCollection' or 'Entity', which * contains 'DataElement''s describing the proprietary specification for the message broker. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker * * @param messageBroker desired value for the property messageBroker. */ void setMessageBroker(Reference messageBroker); /** - * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic * - * @return Returns the String for the property lastUpdate. + * @return Returns the String for the property messageTopic. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate") - String getLastUpdate(); + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") + String getMessageTopic(); /** - * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic * - * @param lastUpdate desired value for the property lastUpdate. + * @param messageTopic desired value for the property messageTopic. */ - void setLastUpdate(String lastUpdate); + void setMessageTopic(String messageTopic); /** * For input direction, reports on the maximum frequency, the software entity behind the respective * Referable can handle input events. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/minInterval + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval * * @return Returns the String for the property minInterval. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/minInterval") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") String getMinInterval(); /** * For input direction, reports on the maximum frequency, the software entity behind the respective * Referable can handle input events. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/minInterval + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval * * @param minInterval desired value for the property minInterval. */ void setMinInterval(String minInterval); /** - * For input direction: not applicable. + * Reference to the 'Referable', which defines the scope of the event. Can be + * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed * - * @return Returns the String for the property maxInterval. + * @return Returns the Reference for the property observed. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval") - String getMaxInterval(); + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") + Reference getObserved(); /** - * For input direction: not applicable. + * Reference to the 'Referable', which defines the scope of the event. Can be + * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed * - * @param maxInterval desired value for the property maxInterval. + * @param observed desired value for the property observed. */ - void setMaxInterval(String maxInterval); + void setObserved(Reference observed); + + /** + * State of event. + * + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state + * + * @return Returns the StateOfEvent for the property state. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") + StateOfEvent getState(); + + /** + * State of event. + * + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state + * + * @param state desired value for the property state. + */ + void setState(StateOfEvent state); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java index 4d0e69a95..597dfcb1f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,41 +31,41 @@ public interface Blob extends DataElement { /** - * The value of the 'Blob' instance of a blob data element. + * Content type of the content of the 'Blob'. * - * More information under https://admin-shell.io/aas/3/0/Blob/value + * More information under https://admin-shell.io/aas/3/0/RC02/Blob/contentType * - * @return Returns the byte[] for the property value. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/Blob/value") - byte[] getValue(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") + String getContentType(); /** - * The value of the 'Blob' instance of a blob data element. + * Content type of the content of the 'Blob'. * - * More information under https://admin-shell.io/aas/3/0/Blob/value + * More information under https://admin-shell.io/aas/3/0/RC02/Blob/contentType * - * @param value desired value for the property value. + * @param contentType desired value for the property contentType. */ - void setValue(byte[] value); + void setContentType(String contentType); /** - * Content type of the content of the 'Blob'. + * The value of the 'Blob' instance of a blob data element. * - * More information under https://admin-shell.io/aas/3/0/Blob/contentType + * More information under https://admin-shell.io/aas/3/0/RC02/Blob/value * - * @return Returns the String for the property contentType. + * @return Returns the byte[] for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/Blob/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/value") + byte[] getValue(); /** - * Content type of the content of the 'Blob'. + * The value of the 'Blob' instance of a blob data element. * - * More information under https://admin-shell.io/aas/3/0/Blob/contentType + * More information under https://admin-shell.io/aas/3/0/RC02/Blob/value * - * @param contentType desired value for the property contentType. + * @param value desired value for the property value. */ - void setContentType(String contentType); + void setValue(byte[] value); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java index f9837b1c0..483e61428 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,20 +34,20 @@ public interface ConceptDescription extends HasDataSpecification, Identifiable { /** * Reference to an external definition the concept is compatible to or was derived from. * - * More information under https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf + * More information under https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf * - * @return Returns the List of References for the property isCaseOfs. + * @return Returns the List of References for the property isCaseOf. */ - @IRI("https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf") - List getIsCaseOfs(); + @IRI("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") + List getIsCaseOf(); /** * Reference to an external definition the concept is compatible to or was derived from. * - * More information under https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf + * More information under https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf * - * @param isCaseOfs desired value for the property isCaseOfs. + * @param isCaseOf desired value for the property isCaseOf. */ - void setIsCaseOfs(List isCaseOfs); + void setIsCaseOf(List isCaseOf); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java index 5c99e7daf..2bb5a92e7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -26,7 +26,8 @@ * and meta information about the template itself. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DataSpecificationIec61360.class) + @KnownSubtypes.Type(value = DataSpecificationIEC61360.class), + @KnownSubtypes.Type(value = DataSpecificationPhysicalUnit.class) }) public interface DataSpecificationContent { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java index 48278c09a..1848854db 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,7 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIEC61360; import java.util.List; @@ -27,102 +27,123 @@ * lists conformant to IEC 61360. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultDataSpecificationIec61360.class) + @KnownSubtypes.Type(value = DefaultDataSpecificationIEC61360.class) }) -public interface DataSpecificationIec61360 extends DataSpecificationContent { +public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** - * Preferred name + * Data Type * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType * - * @return Returns the List of LangStringPreferredNameTypeIec61360s for the property preferredNames. + * @return Returns the DataTypeIEC61360 for the property dataType. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName") - List getPreferredNames(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") + DataTypeIEC61360 getDataType(); /** - * Preferred name + * Data Type * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType * - * @param preferredNames desired value for the property preferredNames. + * @param dataType desired value for the property dataType. */ - void setPreferredNames(List preferredNames); + void setDataType(DataTypeIEC61360 dataType); /** - * Short name + * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition * - * @return Returns the List of LangStringShortNameTypeIec61360s for the property shortNames. + * @return Returns the List of LangStrings for the property definition. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName") - List getShortNames(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + List getDefinition(); /** - * Short name + * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition * - * @param shortNames desired value for the property shortNames. + * @param definition desired value for the property definition. */ - void setShortNames(List shortNames); + void setDefinition(List definition); /** - * Unit + * Set of levels. * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType * - * @return Returns the String for the property unit. + * @return Returns the LevelType for the property levelType. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit") - String getUnit(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + LevelType getLevelType(); /** - * Unit + * Set of levels. * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType * - * @param unit desired value for the property unit. + * @param levelType desired value for the property levelType. */ - void setUnit(String unit); + void setLevelType(LevelType levelType); /** - * Unique unit id + * Preferred name * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName * - * @return Returns the Reference for the property unitId. + * @return Returns the List of LangStrings for the property preferredName. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId") - Reference getUnitId(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + List getPreferredName(); /** - * Unique unit id + * Preferred name * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName * - * @param unitId desired value for the property unitId. + * @param preferredName desired value for the property preferredName. */ - void setUnitId(Reference unitId); + void setPreferredName(List preferredName); + + /** + * Short name + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName + * + * @return Returns the List of LangStrings for the property shortName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + List getShortName(); + + /** + * Short name + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName + * + * @param shortName desired value for the property shortName. + */ + void setShortName(List shortName); /** * Source of definition * * More information under - * https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition * * @return Returns the String for the property sourceOfDefinition. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") String getSourceOfDefinition(); /** * Source of definition * * More information under - * https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition * * @param sourceOfDefinition desired value for the property sourceOfDefinition. */ @@ -131,74 +152,93 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { /** * Symbol * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol * * @return Returns the String for the property symbol. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") String getSymbol(); /** * Symbol * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol * * @param symbol desired value for the property symbol. */ void setSymbol(String symbol); /** - * Data Type + * Unit * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit * - * @return Returns the DataTypeIec61360 for the property dataType. + * @return Returns the String for the property unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType") - DataTypeIec61360 getDataType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + String getUnit(); /** - * Data Type + * Unit * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit * - * @param dataType desired value for the property dataType. + * @param unit desired value for the property unit. */ - void setDataType(DataTypeIec61360 dataType); + void setUnit(String unit); /** - * Definition in different languages + * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId * - * @return Returns the List of LangStringDefinitionTypeIec61360s for the property definitions. + * @return Returns the Reference for the property unitId. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition") - List getDefinitions(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + Reference getUnitId(); /** - * Definition in different languages + * Unique unit id + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId + * + * @param unitId desired value for the property unitId. + */ + void setUnitId(Reference unitId); + + /** + * Value * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value * - * @param definitions desired value for the property definitions. + * @return Returns the String for the property value. */ - void setDefinitions(List definitions); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + String getValue(); + + /** + * Value + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value + * + * @param value desired value for the property value. + */ + void setValue(String value); /** * Value Format * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat * * @return Returns the String for the property valueFormat. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") String getValueFormat(); /** * Value Format * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat * * @param valueFormat desired value for the property valueFormat. */ @@ -207,58 +247,20 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { /** * List of allowed values * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList * * @return Returns the ValueList for the property valueList. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") ValueList getValueList(); /** * List of allowed values * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList * * @param valueList desired value for the property valueList. */ void setValueList(ValueList valueList); - /** - * Value - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value - * - * @return Returns the String for the property value. - */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value") - String getValue(); - - /** - * Value - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value - * - * @param value desired value for the property value. - */ - void setValue(String value); - - /** - * Set of levels. - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType - * - * @return Returns the LevelType for the property levelType. - */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType") - LevelType getLevelType(); - - /** - * Set of levels. - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType - * - * @param levelType desired value for the property levelType. - */ - void setLevelType(LevelType levelType); - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java new file mode 100644 index 000000000..dc48bc871 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java @@ -0,0 +1,293 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationPhysicalUnit; + +import java.util.List; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultDataSpecificationPhysicalUnit.class) +}) +public interface DataSpecificationPhysicalUnit extends DataSpecificationContent { + + /** + * Conversion factor + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor + * + * @return Returns the String for the property conversionFactor. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") + String getConversionFactor(); + + /** + * Conversion factor + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor + * + * @param conversionFactor desired value for the property conversionFactor. + */ + void setConversionFactor(String conversionFactor); + + /** + * Definition in different languages + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition + * + * @return Returns the List of LangStrings for the property definition. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition") + List getDefinition(); + + /** + * Definition in different languages + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition + * + * @param definition desired value for the property definition. + */ + void setDefinition(List definition); + + /** + * Notation of physical unit conformant to DIN + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation + * + * @return Returns the String for the property dinNotation. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") + String getDinNotation(); + + /** + * Notation of physical unit conformant to DIN + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation + * + * @param dinNotation desired value for the property dinNotation. + */ + void setDinNotation(String dinNotation); + + /** + * Code of physical unit conformant to ECE + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode + * + * @return Returns the String for the property eceCode. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") + String getEceCode(); + + /** + * Code of physical unit conformant to ECE + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode + * + * @param eceCode desired value for the property eceCode. + */ + void setEceCode(String eceCode); + + /** + * Name of physical unit conformant to ECE + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName + * + * @return Returns the String for the property eceName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName") + String getEceName(); + + /** + * Name of physical unit conformant to ECE + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName + * + * @param eceName desired value for the property eceName. + */ + void setEceName(String eceName); + + /** + * Name of NIST physical unit + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName + * + * @return Returns the String for the property nistName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName") + String getNistName(); + + /** + * Name of NIST physical unit + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName + * + * @param nistName desired value for the property nistName. + */ + void setNistName(String nistName); + + /** + * Registration authority ID + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId + * + * @return Returns the String for the property registrationAuthorityId. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") + String getRegistrationAuthorityId(); + + /** + * Registration authority ID + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId + * + * @param registrationAuthorityId desired value for the property registrationAuthorityId. + */ + void setRegistrationAuthorityId(String registrationAuthorityId); + + /** + * Name of SI physical unit + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName + * + * @return Returns the String for the property siName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName") + String getSiName(); + + /** + * Name of SI physical unit + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName + * + * @param siName desired value for the property siName. + */ + void setSiName(String siName); + + /** + * Notation of SI physical unit + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation + * + * @return Returns the String for the property siNotation. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") + String getSiNotation(); + + /** + * Notation of SI physical unit + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation + * + * @param siNotation desired value for the property siNotation. + */ + void setSiNotation(String siNotation); + + /** + * Source of definition + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition + * + * @return Returns the String for the property sourceOfDefinition. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition") + String getSourceOfDefinition(); + + /** + * Source of definition + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition + * + * @param sourceOfDefinition desired value for the property sourceOfDefinition. + */ + void setSourceOfDefinition(String sourceOfDefinition); + + /** + * Supplier + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier + * + * @return Returns the String for the property supplier. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier") + String getSupplier(); + + /** + * Supplier + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier + * + * @param supplier desired value for the property supplier. + */ + void setSupplier(String supplier); + + /** + * Name of the physical unit + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName + * + * @return Returns the String for the property unitName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName") + String getUnitName(); + + /** + * Name of the physical unit + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName + * + * @param unitName desired value for the property unitName. + */ + void setUnitName(String unitName); + + /** + * Symbol for the physical unit + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol + * + * @return Returns the String for the property unitSymbol. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") + String getUnitSymbol(); + + /** + * Symbol for the physical unit + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol + * + * @param unitSymbol desired value for the property unitSymbol. + */ + void setUnitSymbol(String unitSymbol); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java new file mode 100644 index 000000000..0b375631d --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + + +/** + * Enumeration listing all xsd anySimpleTypes + */ +@IRI("aas:DataTypeDefXsd") +public enum DataTypeDefXsd { + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/AnyUri") + ANY_URI, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Base64Binary") + BASE64BINARY, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Boolean") + BOOLEAN, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Byte") + BYTE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Date") + DATE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/DateTime") + DATE_TIME, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/DateTimeStamp") + DATE_TIME_STAMP, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/DayTimeDuration") + DAY_TIME_DURATION, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Decimal") + DECIMAL, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Double") + DOUBLE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Duration") + DURATION, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Float") + FLOAT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GDay") + GDAY, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GMonth") + GMONTH, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GMonthDay") + GMONTH_DAY, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GYear") + GYEAR, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GYearMonth") + GYEAR_MONTH, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/HexBinary") + HEX_BINARY, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Int") + INT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Integer") + INTEGER, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Long") + LONG, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/NegativeInteger") + NEGATIVE_INTEGER, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/NonNegativeInteger") + NON_NEGATIVE_INTEGER, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/NonPositiveInteger") + NON_POSITIVE_INTEGER, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/PositiveInteger") + POSITIVE_INTEGER, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Short") + SHORT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/String") + STRING, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Time") + TIME, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedByte") + UNSIGNED_BYTE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedInt") + UNSIGNED_INT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedLong") + UNSIGNED_LONG, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedShort") + UNSIGNED_SHORT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/YearMonthDuration") + YEAR_MONTH_DURATION; + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java index 91e2768a5..b78e2c83a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,129 +22,129 @@ /** */ -@IRI("aas:DataTypeIec61360") -public enum DataTypeIec61360 { +@IRI("aas:DataTypeIEC61360") +public enum DataTypeIEC61360 { /** * values containing the content of a file. Values may be binaries. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Blob") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Blob") BLOB, /** * values representing truth of logic or Boolean algebra (TRUE, FALSE) */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Boolean") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Boolean") BOOLEAN, /** * values containing a calendar date, conformant to ISO 8601:2004 Format yyyy-mm-dd Example from IEC * 61360-1:2017: "1999-05-31" is the [DATE] representation of: "31 May 1999". */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Date") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Date") DATE, /** * values containing an address to a file. The values are of type URI and can represent an absolute * or relative path. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/File") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/File") FILE, /** * Values containing string with any sequence of characters, using the syntax of HTML5 (see W3C * Recommendation 28:2014) */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Html") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Html") HTML, /** * values containing values of type INTEGER but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerCount") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/IntegerCount") INTEGER_COUNT, /** * values containing values of type INTEGER that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerCurrency") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/IntegerCurrency") INTEGER_CURRENCY, /** * values containing values that are measure of type INTEGER. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerMeasure") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/IntegerMeasure") INTEGER_MEASURE, /** * values conforming to ISO/IEC 11179 series global identifier sequences */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Irdi") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Irdi") IRDI, /** * values containing values of type STRING conformant to Rfc 3987 */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Iri") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Iri") IRI, /** * values containing values of type rational */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Rational") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Rational") RATIONAL, /** * values containing values of type rational. In addition such a value comes with a physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RationalMeasure") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RationalMeasure") RATIONAL_MEASURE, /** * values containing numbers that can be written as a terminating or non-terminating decimal; a * rational or irrational number but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealCount") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RealCount") REAL_COUNT, /** * values containing values of type REAL that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealCurrency") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RealCurrency") REAL_CURRENCY, /** * values containing values that are measures of type REAL. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealMeasure") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RealMeasure") REAL_MEASURE, /** * values consisting of sequence of characters but cannot be translated into other languages */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/String") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/String") STRING, /** * values containing string but shall be represented as different string in different languages */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/StringTranslatable") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/StringTranslatable") STRING_TRANSLATABLE, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Time") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Time") TIME, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Timestamp") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Timestamp") TIMESTAMP; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java new file mode 100644 index 000000000..a06e883fc --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDescriptor; + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultDescriptor.class), + @KnownSubtypes.Type(value = SubmodelDescriptor.class) +}) +public interface Descriptor { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints + * + * @return Returns the List of Endpoints for the property endpoints. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints") + List getEndpoints(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints + * + * @param endpoints desired value for the property endpoints. + */ + void setEndpoints(List endpoints); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java index 471cd52f5..0f510b76a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,13 +29,13 @@ public enum Direction { /** * Input direction. */ - @IRI("https://admin-shell.io/aas/3/0/Direction/Input") + @IRI("https://admin-shell.io/aas/3/0/RC02/Direction/Input") INPUT, /** * Output direction */ - @IRI("https://admin-shell.io/aas/3/0/Direction/Output") + @IRI("https://admin-shell.io/aas/3/0/RC02/Direction/Output") OUTPUT; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java index a698dd362..67673ab64 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,17 +32,19 @@ public interface EmbeddedDataSpecification { /** * Reference to the data specification * - * More information under https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification + * More information under + * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification * * @return Returns the Reference for the property dataSpecification. */ - @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification") + @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") Reference getDataSpecification(); /** * Reference to the data specification * - * More information under https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification + * More information under + * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification * * @param dataSpecification desired value for the property dataSpecification. */ @@ -52,18 +54,18 @@ public interface EmbeddedDataSpecification { * Actual content of the data specification * * More information under - * https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent + * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent * * @return Returns the DataSpecificationContent for the property dataSpecificationContent. */ - @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent") + @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") DataSpecificationContent getDataSpecificationContent(); /** * Actual content of the data specification * * More information under - * https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent + * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent * * @param dataSpecificationContent desired value for the property dataSpecificationContent. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java new file mode 100644 index 000000000..fa8b8fee6 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEndpoint; + +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultEndpoint.class) +}) +public interface Endpoint { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/Endpoint/interface + * + * @return Returns the String for the property interface. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Endpoint/interface") + String getInterface(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/Endpoint/interface + * + * @param interfaceValue desired value for the property interface. + */ + void setInterface(String interfaceValue); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/Endpoint/protocolInformation + * + * @return Returns the ProtocolInformation for the property protocolInformation. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Endpoint/protocolInformation") + ProtocolInformation getProtocolInformation(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/Endpoint/protocolInformation + * + * @param protocolInformation desired value for the property protocolInformation. + */ + void setProtocolInformation(ProtocolInformation protocolInformation); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java index 5ac6854f6..422cdb746 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,41 +30,20 @@ }) public interface Entity extends SubmodelElement { - /** - * Describes statements applicable to the entity by a set of submodel elements, typically with a - * qualified value. - * - * More information under https://admin-shell.io/aas/3/0/Entity/statements - * - * @return Returns the List of SubmodelElements for the property statements. - */ - @IRI("https://admin-shell.io/aas/3/0/Entity/statements") - List getStatements(); - - /** - * Describes statements applicable to the entity by a set of submodel elements, typically with a - * qualified value. - * - * More information under https://admin-shell.io/aas/3/0/Entity/statements - * - * @param statements desired value for the property statements. - */ - void setStatements(List statements); - /** * Describes whether the entity is a co-managed entity or a self-managed entity. * - * More information under https://admin-shell.io/aas/3/0/Entity/entityType + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/entityType * * @return Returns the EntityType for the property entityType. */ - @IRI("https://admin-shell.io/aas/3/0/Entity/entityType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") EntityType getEntityType(); /** * Describes whether the entity is a co-managed entity or a self-managed entity. * - * More information under https://admin-shell.io/aas/3/0/Entity/entityType + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/entityType * * @param entityType desired value for the property entityType. */ @@ -73,41 +52,62 @@ public interface Entity extends SubmodelElement { /** * Global identifier of the asset the entity is representing. * - * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetId + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId * - * @return Returns the String for the property globalAssetId. + * @return Returns the Reference for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetId") - String getGlobalAssetId(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") + Reference getGlobalAssetId(); /** * Global identifier of the asset the entity is representing. * - * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetId + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId * * @param globalAssetId desired value for the property globalAssetId. */ - void setGlobalAssetId(String globalAssetId); + void setGlobalAssetId(Reference globalAssetId); /** * Reference to a specific asset ID representing a supplementary identifier of the asset represented * by the Asset Administration Shell. * - * More information under https://admin-shell.io/aas/3/0/Entity/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId * - * @return Returns the List of SpecificAssetIds for the property specificAssetIds. + * @return Returns the SpecificAssetId for the property specificAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/Entity/specificAssetIds") - List getSpecificAssetIds(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") + SpecificAssetId getSpecificAssetId(); /** * Reference to a specific asset ID representing a supplementary identifier of the asset represented * by the Asset Administration Shell. * - * More information under https://admin-shell.io/aas/3/0/Entity/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId * - * @param specificAssetIds desired value for the property specificAssetIds. + * @param specificAssetId desired value for the property specificAssetId. */ - void setSpecificAssetIds(List specificAssetIds); + void setSpecificAssetId(SpecificAssetId specificAssetId); + + /** + * Describes statements applicable to the entity by a set of submodel elements, typically with a + * qualified value. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/statements + * + * @return Returns the List of SubmodelElements for the property statements. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/statements") + List getStatements(); + + /** + * Describes statements applicable to the entity by a set of submodel elements, typically with a + * qualified value. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/statements + * + * @param statements desired value for the property statements. + */ + void setStatements(List statements); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java index 875c8dfb4..137e66dde 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,14 +30,14 @@ public enum EntityType { * For co-managed entities there is no separate AAS. Co-managed entities need to be part of a * self-managed entity. */ - @IRI("https://admin-shell.io/aas/3/0/EntityType/CoManagedEntity") + @IRI("https://admin-shell.io/aas/3/0/RC02/EntityType/CoManagedEntity") CO_MANAGED_ENTITY, /** * Self-Managed Entities have their own AAS but can be part of the bill of material of a composite * self-managed entity. */ - @IRI("https://admin-shell.io/aas/3/0/EntityType/SelfManagedEntity") + @IRI("https://admin-shell.io/aas/3/0/RC02/EntityType/SelfManagedEntity") SELF_MANAGED_ENTITY; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java index 92d8c964e..5ea7ac571 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,58 +33,58 @@ public interface Environment { /** * Asset administration shell * - * More information under https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells + * More information under https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells * * @return Returns the List of AssetAdministrationShells for the property assetAdministrationShells. */ - @IRI("https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells") + @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") List getAssetAdministrationShells(); /** * Asset administration shell * - * More information under https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells + * More information under https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells * * @param assetAdministrationShells desired value for the property assetAdministrationShells. */ void setAssetAdministrationShells(List assetAdministrationShells); /** - * Submodel + * Concept description * - * More information under https://admin-shell.io/aas/3/0/Environment/submodels + * More information under https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions * - * @return Returns the List of Submodels for the property submodels. + * @return Returns the List of ConceptDescriptions for the property conceptDescriptions. */ - @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") - List getSubmodels(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") + List getConceptDescriptions(); /** - * Submodel + * Concept description * - * More information under https://admin-shell.io/aas/3/0/Environment/submodels + * More information under https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions * - * @param submodels desired value for the property submodels. + * @param conceptDescriptions desired value for the property conceptDescriptions. */ - void setSubmodels(List submodels); + void setConceptDescriptions(List conceptDescriptions); /** - * Concept description + * Submodel * - * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions + * More information under https://admin-shell.io/aas/3/0/RC02/Environment/submodels * - * @return Returns the List of ConceptDescriptions for the property conceptDescriptions. + * @return Returns the List of Submodels for the property submodels. */ - @IRI("https://admin-shell.io/aas/3/0/Environment/conceptDescriptions") - List getConceptDescriptions(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") + List getSubmodels(); /** - * Concept description + * Submodel * - * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions + * More information under https://admin-shell.io/aas/3/0/RC02/Environment/submodels * - * @param conceptDescriptions desired value for the property conceptDescriptions. + * @param submodels desired value for the property submodels. */ - void setConceptDescriptions(List conceptDescriptions); + void setSubmodels(List submodels); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java index 3e99c1c30..ab5677f03 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,118 +30,116 @@ public interface EventPayload { /** - * Reference to the source event element, including identification of 'AssetAdministrationShell', - * 'Submodel', 'SubmodelElement''s. + * Reference to the referable, which defines the scope of the event. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/source + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference * - * @return Returns the Reference for the property source. + * @return Returns the Reference for the property observableReference. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") - Reference getSource(); + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference") + Reference getObservableReference(); /** - * Reference to the source event element, including identification of 'AssetAdministrationShell', - * 'Submodel', 'SubmodelElement''s. + * Reference to the referable, which defines the scope of the event. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/source + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference * - * @param source desired value for the property source. + * @param observableReference desired value for the property observableReference. */ - void setSource(Reference source); + void setObservableReference(Reference observableReference); /** - * 'semanticId' of the source event element, if available + * 'semanticId' of the referable which defines the scope of the event, if available. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId * - * @return Returns the Reference for the property sourceSemanticId. + * @return Returns the Reference for the property observableSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId") - Reference getSourceSemanticId(); + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId") + Reference getObservableSemanticId(); /** - * 'semanticId' of the source event element, if available + * 'semanticId' of the referable which defines the scope of the event, if available. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId * - * @param sourceSemanticId desired value for the property sourceSemanticId. + * @param observableSemanticId desired value for the property observableSemanticId. */ - void setSourceSemanticId(Reference sourceSemanticId); + void setObservableSemanticId(Reference observableSemanticId); /** - * Reference to the referable, which defines the scope of the event. + * Event specific payload. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/payload * - * @return Returns the Reference for the property observableReference. + * @return Returns the String for the property payload. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") - Reference getObservableReference(); + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/payload") + String getPayload(); /** - * Reference to the referable, which defines the scope of the event. + * Event specific payload. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/payload * - * @param observableReference desired value for the property observableReference. + * @param payload desired value for the property payload. */ - void setObservableReference(Reference observableReference); + void setPayload(String payload); /** - * 'semanticId' of the referable which defines the scope of the event, if available. + * Reference to the source event element, including identification of 'AssetAdministrationShell', + * 'Submodel', 'SubmodelElement''s. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/source * - * @return Returns the Reference for the property observableSemanticId. + * @return Returns the Reference for the property source. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId") - Reference getObservableSemanticId(); + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/source") + Reference getSource(); /** - * 'semanticId' of the referable which defines the scope of the event, if available. + * Reference to the source event element, including identification of 'AssetAdministrationShell', + * 'Submodel', 'SubmodelElement''s. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/source * - * @param observableSemanticId desired value for the property observableSemanticId. + * @param source desired value for the property source. */ - void setObservableSemanticId(Reference observableSemanticId); + void setSource(Reference source); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * 'semanticId' of the source event element, if available * - * More information under https://admin-shell.io/aas/3/0/EventPayload/topic + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId * - * @return Returns the String for the property topic. + * @return Returns the Reference for the property sourceSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") - String getTopic(); + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId") + Reference getSourceSemanticId(); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * 'semanticId' of the source event element, if available * - * More information under https://admin-shell.io/aas/3/0/EventPayload/topic + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId * - * @param topic desired value for the property topic. + * @param sourceSemanticId desired value for the property sourceSemanticId. */ - void setTopic(String topic); + void setSourceSemanticId(Reference sourceSemanticId); /** * Subject, who/which initiated the creation. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectId + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId * * @return Returns the Reference for the property subjectId. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectId") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId") Reference getSubjectId(); /** * Subject, who/which initiated the creation. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectId + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId * * @param subjectId desired value for the property subjectId. */ @@ -150,39 +148,41 @@ public interface EventPayload { /** * Timestamp in UTC, when this event was triggered. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/timeStamp + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp * * @return Returns the String for the property timeStamp. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/timeStamp") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp") String getTimeStamp(); /** * Timestamp in UTC, when this event was triggered. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/timeStamp + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp * * @param timeStamp desired value for the property timeStamp. */ void setTimeStamp(String timeStamp); /** - * Event specific payload. + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/payload + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/topic * - * @return Returns the byte[] for the property payload. + * @return Returns the String for the property topic. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") - byte[] getPayload(); + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/topic") + String getTopic(); /** - * Event specific payload. + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/payload + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/topic * - * @param payload desired value for the property payload. + * @param topic desired value for the property topic. */ - void setPayload(byte[] payload); + void setTopic(String topic); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java index 07f6b1eec..e8a30fcda 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,12 +15,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; -import java.util.List; - /** * Single extension of an element. @@ -33,77 +32,77 @@ public interface Extension extends HasSemantics { /** * Name of the extension. * - * More information under https://admin-shell.io/aas/3/0/Extension/name + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/name * * @return Returns the String for the property name. */ - @IRI("https://admin-shell.io/aas/3/0/Extension/name") + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/name") String getName(); /** * Name of the extension. * - * More information under https://admin-shell.io/aas/3/0/Extension/name + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/name * * @param name desired value for the property name. */ void setName(String name); /** - * Type of the value of the extension. + * Reference to an element the extension refers to. * - * More information under https://admin-shell.io/aas/3/0/Extension/valueType + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/refersTo * - * @return Returns the DataTypeDefXsd for the property valueType. + * @return Returns the Reference for the property refersTo. */ - @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") - DataTypeDefXsd getValueType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") + Reference getRefersTo(); /** - * Type of the value of the extension. + * Reference to an element the extension refers to. * - * More information under https://admin-shell.io/aas/3/0/Extension/valueType + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/refersTo * - * @param valueType desired value for the property valueType. + * @param refersTo desired value for the property refersTo. */ - void setValueType(DataTypeDefXsd valueType); + void setRefersTo(Reference refersTo); /** * Value of the extension * - * More information under https://admin-shell.io/aas/3/0/Extension/value + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/Extension/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/value") String getValue(); /** * Value of the extension * - * More information under https://admin-shell.io/aas/3/0/Extension/value + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/value * * @param value desired value for the property value. */ void setValue(String value); /** - * Reference to an element the extension refers to. + * Type of the value of the extension. * - * More information under https://admin-shell.io/aas/3/0/Extension/refersTo + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/valueType * - * @return Returns the List of References for the property refersTos. + * @return Returns the DataTypeDefXsd for the property valueType. */ - @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") - List getRefersTos(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") + DataTypeDefXsd getValueType(); /** - * Reference to an element the extension refers to. + * Type of the value of the extension. * - * More information under https://admin-shell.io/aas/3/0/Extension/refersTo + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/valueType * - * @param refersTos desired value for the property refersTos. + * @param valueType desired value for the property valueType. */ - void setRefersTos(List refersTos); + void setValueType(DataTypeDefXsd valueType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java index 0640b0862..b4a55cd82 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,41 +30,41 @@ public interface File extends DataElement { /** - * Path and name of the referenced file (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/File/value + * More information under https://admin-shell.io/aas/3/0/RC02/File/contentType * - * @return Returns the String for the property value. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/File/value") - String getValue(); + @IRI("https://admin-shell.io/aas/3/0/RC02/File/contentType") + String getContentType(); /** - * Path and name of the referenced file (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/File/value + * More information under https://admin-shell.io/aas/3/0/RC02/File/contentType * - * @param value desired value for the property value. + * @param contentType desired value for the property contentType. */ - void setValue(String value); + void setContentType(String contentType); /** - * Content type of the content of the file. + * Path and name of the referenced file (with file extension). * - * More information under https://admin-shell.io/aas/3/0/File/contentType + * More information under https://admin-shell.io/aas/3/0/RC02/File/value * - * @return Returns the String for the property contentType. + * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/File/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/File/value") + String getValue(); /** - * Content type of the content of the file. + * Path and name of the referenced file (with file extension). * - * More information under https://admin-shell.io/aas/3/0/File/contentType + * More information under https://admin-shell.io/aas/3/0/RC02/File/value * - * @param contentType desired value for the property contentType. + * @param value desired value for the property value. */ - void setContentType(String contentType); + void setValue(String value); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java index 511c51ce5..e4c2c5f05 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -27,8 +27,8 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = AdministrativeInformation.class), @KnownSubtypes.Type(value = AssetAdministrationShell.class), - @KnownSubtypes.Type(value = ConceptDescription.class), @KnownSubtypes.Type(value = SubmodelElement.class), + @KnownSubtypes.Type(value = ConceptDescription.class), @KnownSubtypes.Type(value = Submodel.class) }) public interface HasDataSpecification { @@ -37,19 +37,19 @@ public interface HasDataSpecification { * Embedded data specification. * * More information under - * https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications + * https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications * * @return Returns the List of EmbeddedDataSpecifications for the property * embeddedDataSpecifications. */ - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") List getEmbeddedDataSpecifications(); /** * Embedded data specification. * * More information under - * https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications + * https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications * * @param embeddedDataSpecifications desired value for the property embeddedDataSpecifications. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java index 624ff047b..13fb36c83 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,17 +32,17 @@ public interface HasExtensions { /** * An extension of the element. * - * More information under https://admin-shell.io/aas/3/0/HasExtensions/extensions + * More information under https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions * * @return Returns the List of Extensions for the property extensions. */ - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") List getExtensions(); /** * An extension of the element. * - * More information under https://admin-shell.io/aas/3/0/HasExtensions/extensions + * More information under https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions * * @param extensions desired value for the property extensions. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java index 9a4bb07ca..442566120 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -25,6 +25,7 @@ * An element with a kind is an element that can either represent a template or an instance. */ @KnownSubtypes({ + @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class) }) public interface HasKind { @@ -32,20 +33,20 @@ public interface HasKind { /** * Kind of the element: either type or instance. * - * More information under https://admin-shell.io/aas/3/0/HasKind/kind + * More information under https://admin-shell.io/aas/3/0/RC02/HasKind/kind * - * @return Returns the ModellingKind for the property kind. + * @return Returns the ModelingKind for the property kind. */ - @IRI("https://admin-shell.io/aas/3/0/HasKind/kind") - ModellingKind getKind(); + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + ModelingKind getKind(); /** * Kind of the element: either type or instance. * - * More information under https://admin-shell.io/aas/3/0/HasKind/kind + * More information under https://admin-shell.io/aas/3/0/RC02/HasKind/kind * * @param kind desired value for the property kind. */ - void setKind(ModellingKind kind); + void setKind(ModelingKind kind); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java index 12e336f11..b3ad0078e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -37,18 +37,18 @@ public interface HasSemantics { * Identifier of the semantic definition of the element. It is called semantic ID of the element or * also main semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticId + * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId * * @return Returns the Reference for the property semanticId. */ - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") Reference getSemanticId(); /** * Identifier of the semantic definition of the element. It is called semantic ID of the element or * also main semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticId + * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId * * @param semanticId desired value for the property semanticId. */ @@ -58,18 +58,18 @@ public interface HasSemantics { * Identifier of a supplemental semantic definition of the element. It is called supplemental * semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds + * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds * * @return Returns the List of References for the property supplementalSemanticIds. */ - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") List getSupplementalSemanticIds(); /** * Identifier of a supplemental semantic definition of the element. It is called supplemental * semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds + * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds * * @param supplementalSemanticIds desired value for the property supplementalSemanticIds. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java index 0f328c7d1..f48661fd5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,17 +34,17 @@ public interface Identifiable extends Referable { /** * Administrative information of an identifiable element. * - * More information under https://admin-shell.io/aas/3/0/Identifiable/administration + * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/administration * * @return Returns the AdministrativeInformation for the property administration. */ - @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") AdministrativeInformation getAdministration(); /** * Administrative information of an identifiable element. * - * More information under https://admin-shell.io/aas/3/0/Identifiable/administration + * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/administration * * @param administration desired value for the property administration. */ @@ -53,17 +53,17 @@ public interface Identifiable extends Referable { /** * The globally unique identification of the element. * - * More information under https://admin-shell.io/aas/3/0/Identifiable/id + * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/id * * @return Returns the String for the property id. */ - @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") String getId(); /** * The globally unique identification of the element. * - * More information under https://admin-shell.io/aas/3/0/Identifiable/id + * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/id * * @param id desired value for the property id. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java index 3a6ada117..f37653283 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java index b7e0c47c4..bf9106f86 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java index 519f45bdb..38e364da1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java index 88fefd0bc..fc362a1a3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,7 +17,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import java.util.List; @@ -25,17 +24,6 @@ public abstract class AdministrativeInformationBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for version - * - * @param version desired value to be set - * @return Builder object with new value for version - */ - public B version(String version) { - getBuildingInstance().setVersion(version); - return getSelf(); - } - /** * This function allows setting a value for revision * @@ -48,24 +36,13 @@ public B revision(String revision) { } /** - * This function allows setting a value for creator - * - * @param creator desired value to be set - * @return Builder object with new value for creator - */ - public B creator(Reference creator) { - getBuildingInstance().setCreator(creator); - return getSelf(); - } - - /** - * This function allows setting a value for templateId + * This function allows setting a value for version * - * @param templateId desired value to be set - * @return Builder object with new value for templateId + * @param version desired value to be set + * @return Builder object with new value for version */ - public B templateId(String templateId) { - getBuildingInstance().setTemplateId(templateId); + public B version(String version) { + getBuildingInstance().setVersion(version); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java index 6dd02e7d3..ce53cdd63 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,6 +20,9 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + + public abstract class AnnotatedRelationshipElementBuilder> extends ExtendableBuilder { @@ -67,25 +70,37 @@ public B second(Reference second) { return getSelf(); } + /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added * @return Builder object with new value for embeddedDataSpecifications */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); return getSelf(); } /** * This function allows adding a value to the List embeddedDataSpecifications - * + * * @param embeddedDataSpecifications desired value to be added * @return Builder object with new value for embeddedDataSpecifications */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } @@ -167,46 +182,35 @@ public B idShort(String idShort) { } /** - * This function allows setting a value for displayNames - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames - */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows setting a value for description * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param description desired value to be set + * @return Builder object with new value for description */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for checksum * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java index 2015b9c28..4bd31ea8d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,24 +24,24 @@ public abstract class AssetAdministrationShellBuilder { /** - * This function allows setting a value for derivedFrom + * This function allows setting a value for assetInformation * - * @param derivedFrom desired value to be set - * @return Builder object with new value for derivedFrom + * @param assetInformation desired value to be set + * @return Builder object with new value for assetInformation */ - public B derivedFrom(Reference derivedFrom) { - getBuildingInstance().setDerivedFrom(derivedFrom); + public B assetInformation(AssetInformation assetInformation) { + getBuildingInstance().setAssetInformation(assetInformation); return getSelf(); } /** - * This function allows setting a value for assetInformation + * This function allows setting a value for derivedFrom * - * @param assetInformation desired value to be set - * @return Builder object with new value for assetInformation + * @param derivedFrom desired value to be set + * @return Builder object with new value for derivedFrom */ - public B assetInformation(AssetInformation assetInformation) { - getBuildingInstance().setAssetInformation(assetInformation); + public B derivedFrom(Reference derivedFrom) { + getBuildingInstance().setDerivedFrom(derivedFrom); return getSelf(); } @@ -123,57 +123,68 @@ public B category(String category) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for checksum * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows setting a value for description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be set + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows adding a value to the List description * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows setting a value for displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows adding a value to the List displayName * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java new file mode 100644 index 000000000..2a4ba9612 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; + +import java.util.List; + +public abstract class AssetAdministrationShellDescriptorBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for administration + * + * @param administration desired value to be set + * @return Builder object with new value for administration + */ + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param description desired value to be set + * @return Builder object with new value for description + */ + public B description(List description) { + getBuildingInstance().setDescription(description); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayName desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for identification + * + * @param identification desired value to be set + * @return Builder object with new value for identification + */ + public B identification(String identification) { + getBuildingInstance().setIdentification(identification); + return getSelf(); + } + + /** + * This function allows setting a value for specificAssetId + * + * @param specificAssetId desired value to be set + * @return Builder object with new value for specificAssetId + */ + public B specificAssetId(SpecificAssetId specificAssetId) { + getBuildingInstance().setSpecificAssetIds(specificAssetId); + return getSelf(); + } + + /** + * This function allows setting a value for globalAssetId + * + * @param globalAssetId desired value to be set + * @return Builder object with new value for globalAssetId + */ + public B globalAssetId(Reference globalAssetId) { + getBuildingInstance().setGlobalAssetId(globalAssetId); + return getSelf(); + } + + /** + * This function allows setting a value for submodelDescriptor + * + * @param submodelDescriptor desired value to be set + * @return Builder object with new value for submodelDescriptor + */ + public B submodelDescriptor(List submodelDescriptor) { + getBuildingInstance().setSubmodelDescriptor(submodelDescriptor); + return getSelf(); + } + + /** + * This function allows setting a value for endpoints + * + * @param endpoints desired value to be set + * @return Builder object with new value for endpoints + */ + public B endpoints(List endpoints) { + getBuildingInstance().setEndpoints(endpoints); + return getSelf(); + } + + /** + * This function allows adding a value to the List endpoints + * + * @param endpoints desired value to be added + * @return Builder object with new value for endpoints + */ + public B endpoints(Endpoint endpoints) { + getBuildingInstance().getEndpoints().add(endpoints); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java index 3794191d6..8ef76deb5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,10 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.*; import java.util.List; @@ -37,13 +34,24 @@ public B assetKind(AssetKind assetKind) { return getSelf(); } + /** + * This function allows setting a value for defaultThumbnail + * + * @param defaultThumbnail desired value to be set + * @return Builder object with new value for defaultThumbnail + */ + public B defaultThumbnail(Resource defaultThumbnail) { + getBuildingInstance().setDefaultThumbnail(defaultThumbnail); + return getSelf(); + } + /** * This function allows setting a value for globalAssetId * * @param globalAssetId desired value to be set * @return Builder object with new value for globalAssetId */ - public B globalAssetId(String globalAssetId) { + public B globalAssetId(Reference globalAssetId) { getBuildingInstance().setGlobalAssetId(globalAssetId); return getSelf(); } @@ -69,26 +77,4 @@ public B specificAssetIds(SpecificAssetId specificAssetIds) { getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); return getSelf(); } - - /** - * This function allows setting a value for assetType - * - * @param assetType desired value to be set - * @return Builder object with new value for assetType - */ - public B assetType(String assetType) { - getBuildingInstance().setAssetType(assetType); - return getSelf(); - } - - /** - * This function allows setting a value for defaultThumbnail - * - * @param defaultThumbnail desired value to be set - * @return Builder object with new value for defaultThumbnail - */ - public B defaultThumbnail(Resource defaultThumbnail) { - getBuildingInstance().setDefaultThumbnail(defaultThumbnail); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java index 353bf806d..6a3d80774 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,17 +23,6 @@ public abstract class BasicEventElementBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for observed - * - * @param observed desired value to be set - * @return Builder object with new value for observed - */ - public B observed(Reference observed) { - getBuildingInstance().setObserved(observed); - return getSelf(); - } - /** * This function allows setting a value for direction * @@ -46,24 +35,24 @@ public B direction(Direction direction) { } /** - * This function allows setting a value for state + * This function allows setting a value for lastUpdate * - * @param state desired value to be set - * @return Builder object with new value for state + * @param lastUpdate desired value to be set + * @return Builder object with new value for lastUpdate */ - public B state(StateOfEvent state) { - getBuildingInstance().setState(state); + public B lastUpdate(String lastUpdate) { + getBuildingInstance().setLastUpdate(lastUpdate); return getSelf(); } /** - * This function allows setting a value for messageTopic + * This function allows setting a value for maxInterval * - * @param messageTopic desired value to be set - * @return Builder object with new value for messageTopic + * @param maxInterval desired value to be set + * @return Builder object with new value for maxInterval */ - public B messageTopic(String messageTopic) { - getBuildingInstance().setMessageTopic(messageTopic); + public B maxInterval(String maxInterval) { + getBuildingInstance().setMaxInterval(maxInterval); return getSelf(); } @@ -79,13 +68,13 @@ public B messageBroker(Reference messageBroker) { } /** - * This function allows setting a value for lastUpdate + * This function allows setting a value for messageTopic * - * @param lastUpdate desired value to be set - * @return Builder object with new value for lastUpdate + * @param messageTopic desired value to be set + * @return Builder object with new value for messageTopic */ - public B lastUpdate(String lastUpdate) { - getBuildingInstance().setLastUpdate(lastUpdate); + public B messageTopic(String messageTopic) { + getBuildingInstance().setMessageTopic(messageTopic); return getSelf(); } @@ -101,13 +90,24 @@ public B minInterval(String minInterval) { } /** - * This function allows setting a value for maxInterval + * This function allows setting a value for observed * - * @param maxInterval desired value to be set - * @return Builder object with new value for maxInterval + * @param observed desired value to be set + * @return Builder object with new value for observed */ - public B maxInterval(String maxInterval) { - getBuildingInstance().setMaxInterval(maxInterval); + public B observed(Reference observed) { + getBuildingInstance().setObserved(observed); + return getSelf(); + } + + /** + * This function allows setting a value for state + * + * @param state desired value to be set + * @return Builder object with new value for state + */ + public B state(StateOfEvent state) { + getBuildingInstance().setState(state); return getSelf(); } @@ -167,90 +167,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -275,4 +275,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java index b59c42e61..f31291130 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,24 +23,24 @@ public abstract class BlobBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for value + * This function allows setting a value for contentType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B value(byte[] value) { - getBuildingInstance().setValue(value); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } /** - * This function allows setting a value for contentType + * This function allows setting a value for value * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param value desired value to be set + * @return Builder object with new value for value */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B value(byte[] value) { + getBuildingInstance().setValue(value); return getSelf(); } @@ -100,90 +100,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -208,4 +208,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java index ce013e25b..111002598 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java index 9fd0aea26..2fcf75982 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -78,90 +78,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -186,4 +186,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java index 590b49285..68dee27fb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,24 +24,24 @@ public abstract class ConceptDescriptionBuilder { /** - * This function allows setting a value for isCaseOfs + * This function allows setting a value for isCaseOf * - * @param isCaseOfs desired value to be set - * @return Builder object with new value for isCaseOfs + * @param isCaseOf desired value to be set + * @return Builder object with new value for isCaseOf */ - public B isCaseOfs(List isCaseOfs) { - getBuildingInstance().setIsCaseOfs(isCaseOfs); + public B isCaseOf(List isCaseOf) { + getBuildingInstance().setIsCaseOf(isCaseOf); return getSelf(); } /** - * This function allows adding a value to the List isCaseOfs + * This function allows adding a value to the List isCaseOf * * @param isCaseOf desired value to be added - * @return Builder object with new value for isCaseOfs + * @return Builder object with new value for isCaseOf */ public B isCaseOf(Reference isCaseOf) { - getBuildingInstance().getIsCaseOfs().add(isCaseOf); + getBuildingInstance().getIsCaseOf().add(isCaseOf); return getSelf(); } @@ -101,57 +101,68 @@ public B category(String category) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for checksum * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows setting a value for description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be set + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows adding a value to the List description * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows setting a value for displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows adding a value to the List displayName * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java index dab3a6b43..a37a1b854 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,72 +20,94 @@ import java.util.List; -public abstract class DataSpecificationIec61360Builder> +public abstract class DataSpecificationIEC61360Builder> extends ExtendableBuilder { /** - * This function allows setting a value for preferredNames + * This function allows setting a value for dataType * - * @param preferredNames desired value to be set - * @return Builder object with new value for preferredNames + * @param dataType desired value to be set + * @return Builder object with new value for dataType */ - public B preferredNames(List preferredNames) { - getBuildingInstance().setPreferredNames(preferredNames); + public B dataType(DataTypeIEC61360 dataType) { + getBuildingInstance().setDataType(dataType); return getSelf(); } /** - * This function allows adding a value to the List preferredNames + * This function allows setting a value for definition * - * @param preferredName desired value to be added - * @return Builder object with new value for preferredNames + * @param definition desired value to be set + * @return Builder object with new value for definition */ - public B preferredName(LangStringPreferredNameTypeIec61360 preferredName) { - getBuildingInstance().getPreferredNames().add(preferredName); + public B definition(List definition) { + getBuildingInstance().setDefinition(definition); return getSelf(); } /** - * This function allows setting a value for shortNames + * This function allows adding a value to the List definition * - * @param shortNames desired value to be set - * @return Builder object with new value for shortNames + * @param definition desired value to be added + * @return Builder object with new value for definition */ - public B shortNames(List shortNames) { - getBuildingInstance().setShortNames(shortNames); + public B definition(LangString definition) { + getBuildingInstance().getDefinition().add(definition); return getSelf(); } /** - * This function allows adding a value to the List shortNames + * This function allows setting a value for levelType * - * @param shortName desired value to be added - * @return Builder object with new value for shortNames + * @param levelType desired value to be set + * @return Builder object with new value for levelType */ - public B shortName(LangStringShortNameTypeIec61360 shortName) { - getBuildingInstance().getShortNames().add(shortName); + public B levelType(LevelType levelType) { + getBuildingInstance().setLevelType(levelType); return getSelf(); } /** - * This function allows setting a value for unit + * This function allows setting a value for preferredName * - * @param unit desired value to be set - * @return Builder object with new value for unit + * @param preferredName desired value to be set + * @return Builder object with new value for preferredName */ - public B unit(String unit) { - getBuildingInstance().setUnit(unit); + public B preferredName(List preferredName) { + getBuildingInstance().setPreferredName(preferredName); return getSelf(); } /** - * This function allows setting a value for unitId + * This function allows adding a value to the List preferredName * - * @param unitId desired value to be set - * @return Builder object with new value for unitId + * @param preferredName desired value to be added + * @return Builder object with new value for preferredName */ - public B unitId(Reference unitId) { - getBuildingInstance().setUnitId(unitId); + public B preferredName(LangString preferredName) { + getBuildingInstance().getPreferredName().add(preferredName); + return getSelf(); + } + + /** + * This function allows setting a value for shortName + * + * @param shortName desired value to be set + * @return Builder object with new value for shortName + */ + public B shortName(List shortName) { + getBuildingInstance().setShortName(shortName); + return getSelf(); + } + + /** + * This function allows adding a value to the List shortName + * + * @param shortName desired value to be added + * @return Builder object with new value for shortName + */ + public B shortName(LangString shortName) { + getBuildingInstance().getShortName().add(shortName); return getSelf(); } @@ -112,35 +134,35 @@ public B symbol(String symbol) { } /** - * This function allows setting a value for dataType + * This function allows setting a value for unit * - * @param dataType desired value to be set - * @return Builder object with new value for dataType + * @param unit desired value to be set + * @return Builder object with new value for unit */ - public B dataType(DataTypeIec61360 dataType) { - getBuildingInstance().setDataType(dataType); + public B unit(String unit) { + getBuildingInstance().setUnit(unit); return getSelf(); } /** - * This function allows setting a value for definitions + * This function allows setting a value for unitId * - * @param definitions desired value to be set - * @return Builder object with new value for definitions + * @param unitId desired value to be set + * @return Builder object with new value for unitId */ - public B definitions(List definitions) { - getBuildingInstance().setDefinitions(definitions); + public B unitId(Reference unitId) { + getBuildingInstance().setUnitId(unitId); return getSelf(); } /** - * This function allows adding a value to the List definitions + * This function allows setting a value for value * - * @param definition desired value to be added - * @return Builder object with new value for definitions + * @param value desired value to be set + * @return Builder object with new value for value */ - public B definition(LangStringDefinitionTypeIec61360 definition) { - getBuildingInstance().getDefinitions().add(definition); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } @@ -166,26 +188,4 @@ public B valueList(ValueList valueList) { return getSelf(); } - /** - * This function allows setting a value for value - * - * @param value desired value to be set - * @return Builder object with new value for value - */ - public B value(String value) { - getBuildingInstance().setValue(value); - return getSelf(); - } - - /** - * This function allows setting a value for levelType - * - * @param levelType desired value to be set - * @return Builder object with new value for levelType - */ - public B levelType(LevelType levelType) { - getBuildingInstance().setLevelType(levelType); - return getSelf(); - } - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java new file mode 100644 index 000000000..75998a955 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +import java.util.List; + + +public abstract class DataSpecificationPhysicalUnitBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for conversionFactor + * + * @param conversionFactor desired value to be set + * @return Builder object with new value for conversionFactor + */ + public B conversionFactor(String conversionFactor) { + getBuildingInstance().setConversionFactor(conversionFactor); + return getSelf(); + } + + /** + * This function allows setting a value for definition + * + * @param definition desired value to be set + * @return Builder object with new value for definition + */ + public B definition(List definition) { + getBuildingInstance().setDefinition(definition); + return getSelf(); + } + + /** + * This function allows adding a value to the List definition + * + * @param definition desired value to be added + * @return Builder object with new value for definition + */ + public B definition(LangString definition) { + getBuildingInstance().getDefinition().add(definition); + return getSelf(); + } + + /** + * This function allows setting a value for dinNotation + * + * @param dinNotation desired value to be set + * @return Builder object with new value for dinNotation + */ + public B dinNotation(String dinNotation) { + getBuildingInstance().setDinNotation(dinNotation); + return getSelf(); + } + + /** + * This function allows setting a value for eceCode + * + * @param eceCode desired value to be set + * @return Builder object with new value for eceCode + */ + public B eceCode(String eceCode) { + getBuildingInstance().setEceCode(eceCode); + return getSelf(); + } + + /** + * This function allows setting a value for eceName + * + * @param eceName desired value to be set + * @return Builder object with new value for eceName + */ + public B eceName(String eceName) { + getBuildingInstance().setEceName(eceName); + return getSelf(); + } + + /** + * This function allows setting a value for nistName + * + * @param nistName desired value to be set + * @return Builder object with new value for nistName + */ + public B nistName(String nistName) { + getBuildingInstance().setNistName(nistName); + return getSelf(); + } + + /** + * This function allows setting a value for registrationAuthorityId + * + * @param registrationAuthorityId desired value to be set + * @return Builder object with new value for registrationAuthorityId + */ + public B registrationAuthorityId(String registrationAuthorityId) { + getBuildingInstance().setRegistrationAuthorityId(registrationAuthorityId); + return getSelf(); + } + + /** + * This function allows setting a value for siName + * + * @param siName desired value to be set + * @return Builder object with new value for siName + */ + public B siName(String siName) { + getBuildingInstance().setSiName(siName); + return getSelf(); + } + + /** + * This function allows setting a value for siNotation + * + * @param siNotation desired value to be set + * @return Builder object with new value for siNotation + */ + public B siNotation(String siNotation) { + getBuildingInstance().setSiNotation(siNotation); + return getSelf(); + } + + /** + * This function allows setting a value for sourceOfDefinition + * + * @param sourceOfDefinition desired value to be set + * @return Builder object with new value for sourceOfDefinition + */ + public B sourceOfDefinition(String sourceOfDefinition) { + getBuildingInstance().setSourceOfDefinition(sourceOfDefinition); + return getSelf(); + } + + /** + * This function allows setting a value for supplier + * + * @param supplier desired value to be set + * @return Builder object with new value for supplier + */ + public B supplier(String supplier) { + getBuildingInstance().setSupplier(supplier); + return getSelf(); + } + + /** + * This function allows setting a value for unitName + * + * @param unitName desired value to be set + * @return Builder object with new value for unitName + */ + public B unitName(String unitName) { + getBuildingInstance().setUnitName(unitName); + return getSelf(); + } + + /** + * This function allows setting a value for unitSymbol + * + * @param unitSymbol desired value to be set + * @return Builder object with new value for unitSymbol + */ + public B unitSymbol(String unitSymbol) { + getBuildingInstance().setUnitSymbol(unitSymbol); + return getSelf(); + } + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java new file mode 100644 index 000000000..85175e975 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.Descriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; + +public abstract class DescriptorBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for endpoints + * + * @param endpoints desired value to be set + * @return Builder object with new value for endpoints + */ + public B endpoints(List endpoints) { + getBuildingInstance().setEndpoints(endpoints); + return getSelf(); + } + + /** + * This function allows adding a value to the List endpoints + * + * @param endpoints desired value to be added + * @return Builder object with new value for endpoints + */ + public B endpoints(Endpoint endpoints) { + getBuildingInstance().getEndpoints().add(endpoints); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java index 583f538af..68e175a75 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java new file mode 100644 index 000000000..22c99fe99 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; + +public abstract class EndpointBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for interface + * + * @param interfaceValue desired value to be set + * @return Builder object with new value for interface + */ + public B withInterface(String interfaceValue) { + getBuildingInstance().setInterface(interfaceValue); + return getSelf(); + } + + /** + * This function allows setting a value for protocolInformation + * + * @param protocolInformation desired value to be set + * @return Builder object with new value for protocolInformation + */ + public B protocolInformation(ProtocolInformation protocolInformation) { + getBuildingInstance().setProtocolInformation(protocolInformation); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java index 616dad950..6065c8b97 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,28 +22,6 @@ public abstract class EntityBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for statements - * - * @param statements desired value to be set - * @return Builder object with new value for statements - */ - public B statements(List statements) { - getBuildingInstance().setStatements(statements); - return getSelf(); - } - - /** - * This function allows adding a value to the List statements - * - * @param statements desired value to be added - * @return Builder object with new value for statements - */ - public B statements(SubmodelElement statements) { - getBuildingInstance().getStatements().add(statements); - return getSelf(); - } - /** * This function allows setting a value for entityType * @@ -61,30 +39,41 @@ public B entityType(EntityType entityType) { * @param globalAssetId desired value to be set * @return Builder object with new value for globalAssetId */ - public B globalAssetId(String globalAssetId) { + public B globalAssetId(Reference globalAssetId) { getBuildingInstance().setGlobalAssetId(globalAssetId); return getSelf(); } /** - * This function allows setting a value for specificAssetIds + * This function allows setting a value for specificAssetId + * + * @param specificAssetId desired value to be set + * @return Builder object with new value for specificAssetId + */ + public B specificAssetId(SpecificAssetId specificAssetId) { + getBuildingInstance().setSpecificAssetId(specificAssetId); + return getSelf(); + } + + /** + * This function allows setting a value for statements * - * @param specificAssetIds desired value to be set - * @return Builder object with new value for specificAssetIds + * @param statements desired value to be set + * @return Builder object with new value for statements */ - public B specificAssetIds(List specificAssetIds) { - getBuildingInstance().setSpecificAssetIds(specificAssetIds); + public B statements(List statements) { + getBuildingInstance().setStatements(statements); return getSelf(); } /** - * This function allows adding a value to the List specificAssetIds + * This function allows adding a value to the List statements * - * @param specificAssetIds desired value to be added - * @return Builder object with new value for specificAssetIds + * @param statements desired value to be added + * @return Builder object with new value for statements */ - public B specificAssetIds(SpecificAssetId specificAssetIds) { - getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); + public B statements(SubmodelElement statements) { + getBuildingInstance().getStatements().add(statements); return getSelf(); } @@ -144,90 +133,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -252,4 +241,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java index 633cf775c..0c10eab94 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -48,46 +48,46 @@ public B assetAdministrationShells(AssetAdministrationShell assetAdministrationS } /** - * This function allows setting a value for submodels + * This function allows setting a value for conceptDescriptions * - * @param submodels desired value to be set - * @return Builder object with new value for submodels + * @param conceptDescriptions desired value to be set + * @return Builder object with new value for conceptDescriptions */ - public B submodels(List submodels) { - getBuildingInstance().setSubmodels(submodels); + public B conceptDescriptions(List conceptDescriptions) { + getBuildingInstance().setConceptDescriptions(conceptDescriptions); return getSelf(); } /** - * This function allows adding a value to the List submodels + * This function allows adding a value to the List conceptDescriptions * - * @param submodels desired value to be added - * @return Builder object with new value for submodels + * @param conceptDescriptions desired value to be added + * @return Builder object with new value for conceptDescriptions */ - public B submodels(Submodel submodels) { - getBuildingInstance().getSubmodels().add(submodels); + public B conceptDescriptions(ConceptDescription conceptDescriptions) { + getBuildingInstance().getConceptDescriptions().add(conceptDescriptions); return getSelf(); } /** - * This function allows setting a value for conceptDescriptions + * This function allows setting a value for submodels * - * @param conceptDescriptions desired value to be set - * @return Builder object with new value for conceptDescriptions + * @param submodels desired value to be set + * @return Builder object with new value for submodels */ - public B conceptDescriptions(List conceptDescriptions) { - getBuildingInstance().setConceptDescriptions(conceptDescriptions); + public B submodels(List submodels) { + getBuildingInstance().setSubmodels(submodels); return getSelf(); } /** - * This function allows adding a value to the List conceptDescriptions + * This function allows adding a value to the List submodels * - * @param conceptDescriptions desired value to be added - * @return Builder object with new value for conceptDescriptions + * @param submodels desired value to be added + * @return Builder object with new value for submodels */ - public B conceptDescriptions(ConceptDescription conceptDescriptions) { - getBuildingInstance().getConceptDescriptions().add(conceptDescriptions); + public B submodels(Submodel submodels) { + getBuildingInstance().getSubmodels().add(submodels); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java index 6aeaad75b..64012e1fb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,57 +23,57 @@ public abstract class EventPayloadBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for source + * This function allows setting a value for observableReference * - * @param source desired value to be set - * @return Builder object with new value for source + * @param observableReference desired value to be set + * @return Builder object with new value for observableReference */ - public B source(Reference source) { - getBuildingInstance().setSource(source); + public B observableReference(Reference observableReference) { + getBuildingInstance().setObservableReference(observableReference); return getSelf(); } /** - * This function allows setting a value for sourceSemanticId + * This function allows setting a value for observableSemanticId * - * @param sourceSemanticId desired value to be set - * @return Builder object with new value for sourceSemanticId + * @param observableSemanticId desired value to be set + * @return Builder object with new value for observableSemanticId */ - public B sourceSemanticId(Reference sourceSemanticId) { - getBuildingInstance().setSourceSemanticId(sourceSemanticId); + public B observableSemanticId(Reference observableSemanticId) { + getBuildingInstance().setObservableSemanticId(observableSemanticId); return getSelf(); } /** - * This function allows setting a value for observableReference + * This function allows setting a value for payload * - * @param observableReference desired value to be set - * @return Builder object with new value for observableReference + * @param payload desired value to be set + * @return Builder object with new value for payload */ - public B observableReference(Reference observableReference) { - getBuildingInstance().setObservableReference(observableReference); + public B payload(String payload) { + getBuildingInstance().setPayload(payload); return getSelf(); } /** - * This function allows setting a value for observableSemanticId + * This function allows setting a value for source * - * @param observableSemanticId desired value to be set - * @return Builder object with new value for observableSemanticId + * @param source desired value to be set + * @return Builder object with new value for source */ - public B observableSemanticId(Reference observableSemanticId) { - getBuildingInstance().setObservableSemanticId(observableSemanticId); + public B source(Reference source) { + getBuildingInstance().setSource(source); return getSelf(); } /** - * This function allows setting a value for topic + * This function allows setting a value for sourceSemanticId * - * @param topic desired value to be set - * @return Builder object with new value for topic + * @param sourceSemanticId desired value to be set + * @return Builder object with new value for sourceSemanticId */ - public B topic(String topic) { - getBuildingInstance().setTopic(topic); + public B sourceSemanticId(Reference sourceSemanticId) { + getBuildingInstance().setSourceSemanticId(sourceSemanticId); return getSelf(); } @@ -100,13 +100,13 @@ public B timeStamp(String timeStamp) { } /** - * This function allows setting a value for payload + * This function allows setting a value for topic * - * @param payload desired value to be set - * @return Builder object with new value for payload + * @param topic desired value to be set + * @return Builder object with new value for topic */ - public B payload(byte[] payload) { - getBuildingInstance().setPayload(payload); + public B topic(String topic) { + getBuildingInstance().setTopic(topic); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java index 0ec24c7d3..624c24af8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -36,13 +36,13 @@ public B name(String name) { } /** - * This function allows setting a value for valueType + * This function allows setting a value for refersTo * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param refersTo desired value to be set + * @return Builder object with new value for refersTo */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); + public B refersTo(Reference refersTo) { + getBuildingInstance().setRefersTo(refersTo); return getSelf(); } @@ -58,24 +58,13 @@ public B value(String value) { } /** - * This function allows setting a value for refersTos - * - * @param refersTos desired value to be set - * @return Builder object with new value for refersTos - */ - public B refersTos(List refersTos) { - getBuildingInstance().setRefersTos(refersTos); - return getSelf(); - } - - /** - * This function allows adding a value to the List refersTos + * This function allows setting a value for valueType * - * @param refersTo desired value to be added - * @return Builder object with new value for refersTos + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B refersTo(Reference refersTo) { - getBuildingInstance().getRefersTos().add(refersTo); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java index fd6722b88..e8585a2da 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,24 +23,24 @@ public abstract class FileBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for value + * This function allows setting a value for contentType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } /** - * This function allows setting a value for contentType + * This function allows setting a value for value * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param value desired value to be set + * @return Builder object with new value for value */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } @@ -100,90 +100,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -208,4 +208,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java new file mode 100644 index 000000000..6b0c50df8 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + + +public abstract class LangStringBuilder> extends ExtendableBuilder { + + /** + * + * This function allows setting a value for text + * + * @param text desired value to be set + * + * @return Builder object with new value for text + * + */ + + public B text(String text) { + getBuildingInstance().setText(text); + return getSelf(); + } + + /** + * + * This function allows setting a value for language + * + * @param language desired value to be set + * + * @return Builder object with new value for language + * + */ + + public B language(String language) { + getBuildingInstance().setLanguage(language); + return getSelf(); + } + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java index d5b2c1905..8e00bcb14 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,24 +24,24 @@ public abstract class MultiLanguagePropertyBuilder { /** - * This function allows setting a value for values + * This function allows setting a value for value * - * @param values desired value to be set - * @return Builder object with new value for values + * @param value desired value to be set + * @return Builder object with new value for value */ - public B values(List values) { - getBuildingInstance().setValues(values); + public B value(List value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows adding a value to the List values + * This function allows adding a value to the List value * * @param value desired value to be added - * @return Builder object with new value for values + * @return Builder object with new value for value */ - public B value(LangStringTextType value) { - getBuildingInstance().getValues().add(value); + public B value(LangString value) { + getBuildingInstance().getValue().add(value); return getSelf(); } @@ -112,90 +112,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -220,4 +220,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java index bcec85472..7ab8280cb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,6 +22,28 @@ public abstract class OperationBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for inoutputVariables + * + * @param inoutputVariables desired value to be set + * @return Builder object with new value for inoutputVariables + */ + public B inoutputVariables(List inoutputVariables) { + getBuildingInstance().setInoutputVariables(inoutputVariables); + return getSelf(); + } + + /** + * This function allows adding a value to the List inoutputVariables + * + * @param inoutputVariables desired value to be added + * @return Builder object with new value for inoutputVariables + */ + public B inoutputVariables(OperationVariable inoutputVariables) { + getBuildingInstance().getInoutputVariables().add(inoutputVariables); + return getSelf(); + } + /** * This function allows setting a value for inputVariables * @@ -66,28 +88,6 @@ public B outputVariables(OperationVariable outputVariables) { return getSelf(); } - /** - * This function allows setting a value for inoutputVariables - * - * @param inoutputVariables desired value to be set - * @return Builder object with new value for inoutputVariables - */ - public B inoutputVariables(List inoutputVariables) { - getBuildingInstance().setInoutputVariables(inoutputVariables); - return getSelf(); - } - - /** - * This function allows adding a value to the List inoutputVariables - * - * @param inoutputVariables desired value to be added - * @return Builder object with new value for inoutputVariables - */ - public B inoutputVariables(OperationVariable inoutputVariables) { - getBuildingInstance().getInoutputVariables().add(inoutputVariables); - return getSelf(); - } - /** * This function allows setting a value for embeddedDataSpecifications * @@ -144,90 +144,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -252,4 +252,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java index 0bd67baa7..fb89de487 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,17 +22,6 @@ public abstract class PropertyBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for valueType - * - * @param valueType desired value to be set - * @return Builder object with new value for valueType - */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); - return getSelf(); - } - /** * This function allows setting a value for value * @@ -55,6 +44,17 @@ public B valueId(Reference valueId) { return getSelf(); } + /** + * This function allows setting a value for valueType + * + * @param valueType desired value to be set + * @return Builder object with new value for valueType + */ + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); + return getSelf(); + } + /** * This function allows setting a value for embeddedDataSpecifications * @@ -111,90 +111,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -219,4 +219,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java new file mode 100644 index 000000000..e158128d3 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; + +public abstract class ProtocolInformationBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for endpointAddress + * + * @param endpointAddress desired value to be set + * @return Builder object with new value for endpointAddress + */ + public B endpointAddress(String endpointAddress) { + getBuildingInstance().setEndpointAddress(endpointAddress); + return getSelf(); + } + + /** + * This function allows setting a value for endpointProtocol + * + * @param endpointProtocol desired value to be set + * @return Builder object with new value for endpointProtocol + */ + public B endpointProtocol(String endpointProtocol) { + getBuildingInstance().setEndpointProtocol(endpointProtocol); + return getSelf(); + } + + /** + * This function allows setting a value for endpointProtocolVersion + * + * @param endpointProtocolVersion desired value to be set + * @return Builder object with new value for endpointProtocolVersion + */ + public B endpointProtocolVersion(String endpointProtocolVersion) { + getBuildingInstance().setEndpointProtocolVersion(endpointProtocolVersion); + return getSelf(); + } + + /** + * This function allows setting a value for subprotocol + * + * @param subprotocol desired value to be set + * @return Builder object with new value for subprotocol + */ + public B subprotocol(String subprotocol) { + getBuildingInstance().setSubprotocol(subprotocol); + return getSelf(); + } + + /** + * This function allows setting a value for subprotocolBody + * + * @param subprotocolBody desired value to be set + * @return Builder object with new value for subprotocolBody + */ + public B subprotocolBody(String subprotocolBody) { + getBuildingInstance().setSubprotocolBody(subprotocolBody); + return getSelf(); + } + + /** + * This function allows setting a value for subprotocolBodyEncoding + * + * @param subprotocolBodyEncoding desired value to be set + * @return Builder object with new value for subprotocolBodyEncoding + */ + public B subprotocolBodyEncoding(String subprotocolBodyEncoding) { + getBuildingInstance().setSubprotocolBodyEncoding(subprotocolBodyEncoding); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java index 4eeb6a010..8e7d7b74d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -47,17 +47,6 @@ public B type(String type) { return getSelf(); } - /** - * This function allows setting a value for valueType - * - * @param valueType desired value to be set - * @return Builder object with new value for valueType - */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); - return getSelf(); - } - /** * This function allows setting a value for value * @@ -80,6 +69,17 @@ public B valueId(Reference valueId) { return getSelf(); } + /** + * This function allows setting a value for valueType + * + * @param valueType desired value to be set + * @return Builder object with new value for valueType + */ + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); + return getSelf(); + } + /** * This function allows setting a value for semanticId * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java index 1bf999673..35472b5f4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,13 +23,13 @@ public abstract class RangeBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for valueType + * This function allows setting a value for max * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param max desired value to be set + * @return Builder object with new value for max */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); + public B max(String max) { + getBuildingInstance().setMax(max); return getSelf(); } @@ -45,13 +45,13 @@ public B min(String min) { } /** - * This function allows setting a value for max + * This function allows setting a value for valueType * - * @param max desired value to be set - * @return Builder object with new value for max + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B max(String max) { - getBuildingInstance().setMax(max); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } @@ -111,90 +111,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -219,4 +219,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java index 3142190f5..0af106b32 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -25,46 +25,46 @@ public abstract class ReferenceBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for type + * This function allows setting a value for keys * - * @param type desired value to be set - * @return Builder object with new value for type + * @param keys desired value to be set + * @return Builder object with new value for keys */ - public B type(ReferenceTypes type) { - getBuildingInstance().setType(type); + public B keys(List keys) { + getBuildingInstance().setKeys(keys); return getSelf(); } /** - * This function allows setting a value for referredSemanticId + * This function allows adding a value to the List keys * - * @param referredSemanticId desired value to be set - * @return Builder object with new value for referredSemanticId + * @param keys desired value to be added + * @return Builder object with new value for keys */ - public B referredSemanticId(Reference referredSemanticId) { - getBuildingInstance().setReferredSemanticId(referredSemanticId); + public B keys(Key keys) { + getBuildingInstance().getKeys().add(keys); return getSelf(); } /** - * This function allows setting a value for keys + * This function allows setting a value for referredSemanticId * - * @param keys desired value to be set - * @return Builder object with new value for keys + * @param referredSemanticId desired value to be set + * @return Builder object with new value for referredSemanticId */ - public B keys(List keys) { - getBuildingInstance().setKeys(keys); + public B referredSemanticId(Reference referredSemanticId) { + getBuildingInstance().setReferredSemanticId(referredSemanticId); return getSelf(); } /** - * This function allows adding a value to the List keys + * This function allows setting a value for type * - * @param keys desired value to be added - * @return Builder object with new value for keys + * @param type desired value to be set + * @return Builder object with new value for type */ - public B keys(Key keys) { - getBuildingInstance().getKeys().add(keys); + public B type(ReferenceTypes type) { + getBuildingInstance().setType(type); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java index cf3587b09..e7eabbeec 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -90,90 +90,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -198,4 +198,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java index ee8ffa434..b5fa9c32b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -101,90 +101,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -209,4 +209,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java index f7c03b676..6bd878ef7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,24 +22,24 @@ public abstract class ResourceBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for path + * This function allows setting a value for contentType * - * @param path desired value to be set - * @return Builder object with new value for path + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B path(String path) { - getBuildingInstance().setPath(path); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } /** - * This function allows setting a value for contentType + * This function allows setting a value for path * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param path desired value to be set + * @return Builder object with new value for path */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B path(String path) { + getBuildingInstance().setPath(path); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java new file mode 100644 index 000000000..188a7a8f2 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; + +import java.util.List; + + +public abstract class SpecificAssetIdBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for externalSubjectId + * + * @param externalSubjectId desired value to be set + * @return Builder object with new value for externalSubjectId + */ + public B externalSubjectId(Reference externalSubjectId) { + getBuildingInstance().setExternalSubjectId(externalSubjectId); + return getSelf(); + } + + /** + * This function allows setting a value for name + * + * @param name desired value to be set + * @return Builder object with new value for name + */ + public B name(String name) { + getBuildingInstance().setName(name); + return getSelf(); + } + + /** + * This function allows setting a value for value + * + * @param value desired value to be set + * @return Builder object with new value for value + */ + public B value(String value) { + getBuildingInstance().setValue(value); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java index c8fff70dc..a4a25425c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -67,79 +67,90 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for kind + * This function allows setting a value for administration * - * @param kind desired value to be set - * @return Builder object with new value for kind + * @param administration desired value to be set + * @return Builder object with new value for administration */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); return getSelf(); } /** - * This function allows setting a value for semanticId + * This function allows setting a value for id * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId + * @param id desired value to be set + * @return Builder object with new value for id */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); + public B id(String id) { + getBuildingInstance().setId(id); return getSelf(); } /** - * This function allows setting a value for supplementalSemanticIds + * This function allows setting a value for category * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds + * @param category desired value to be set + * @return Builder object with new value for category */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List supplementalSemanticIds + * This function allows setting a value for checksum * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for administration + * This function allows setting a value for description * - * @param administration desired value to be set - * @return Builder object with new value for administration + * @param description desired value to be set + * @return Builder object with new value for description */ - public B administration(AdministrativeInformation administration) { - getBuildingInstance().setAdministration(administration); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for id + * This function allows adding a value to the List description * - * @param id desired value to be set - * @return Builder object with new value for id + * @param description desired value to be added + * @return Builder object with new value for description */ - public B id(String id) { - getBuildingInstance().setId(id); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for displayName * - * @param category desired value to be set - * @return Builder object with new value for category + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } @@ -155,68 +166,68 @@ public B idShort(String idShort) { } /** - * This function allows setting a value for displayNames + * This function allows setting a value for extensions * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param extensions desired value to be set + * @return Builder object with new value for extensions */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows adding a value to the List extensions * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param extensions desired value to be added + * @return Builder object with new value for extensions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows setting a value for semanticId * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for supplementalSemanticIds * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); return getSelf(); } /** - * This function allows setting a value for extensions + * This function allows adding a value to the List supplementalSemanticIds * - * @param extensions desired value to be set - * @return Builder object with new value for extensions + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); return getSelf(); } /** - * This function allows adding a value to the List extensions + * This function allows setting a value for kind * - * @param extensions desired value to be added - * @return Builder object with new value for extensions + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java new file mode 100644 index 000000000..76f32ed66 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +public abstract class SubmodelDescriptorBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for administration + * + * @param administration desired value to be set + * @return Builder object with new value for administration + */ + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param description desired value to be set + * @return Builder object with new value for description + */ + public B description(List description) { + getBuildingInstance().setDescription(description); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayName desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for identification + * + * @param identification desired value to be set + * @return Builder object with new value for identification + */ + public B identification(String identification) { + getBuildingInstance().setIdentification(identification); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for endpoints + * + * @param endpoints desired value to be set + * @return Builder object with new value for endpoints + */ + public B endpoints(List endpoints) { + getBuildingInstance().setEndpoints(endpoints); + return getSelf(); + } + + /** + * This function allows adding a value to the List endpoints + * + * @param endpoints desired value to be added + * @return Builder object with new value for endpoints + */ + public B endpoints(Endpoint endpoints) { + getBuildingInstance().getEndpoints().add(endpoints); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java index 7a97d7a7f..dbaa9905b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,6 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.*; +import java.util.Collection; import java.util.List; @@ -24,24 +25,24 @@ public abstract class SubmodelElementCollectionBuilder { /** - * This function allows setting a value for values + * This function allows setting a value for value * - * @param values desired value to be set - * @return Builder object with new value for values + * @param value desired value to be set + * @return Builder object with new value for value */ - public B values(List values) { - getBuildingInstance().setValues(values); + public B value(Collection value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows adding a value to the List values + * This function allows adding a value to the List value * * @param value desired value to be added - * @return Builder object with new value for values + * @return Builder object with new value for value */ public B value(SubmodelElement value) { - getBuildingInstance().getValues().add(value); + getBuildingInstance().getValue().add(value); return getSelf(); } @@ -101,90 +102,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -209,4 +210,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java index a346c19ef..f677a5553 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -57,35 +57,35 @@ public B typeValueListElement(AasSubmodelElements typeValueListElement) { } /** - * This function allows setting a value for valueTypeListElement + * This function allows setting a value for value * - * @param valueTypeListElement desired value to be set - * @return Builder object with new value for valueTypeListElement + * @param value desired value to be set + * @return Builder object with new value for value */ - public B valueTypeListElement(DataTypeDefXsd valueTypeListElement) { - getBuildingInstance().setValueTypeListElement(valueTypeListElement); + public B value(List value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for values + * This function allows adding a value to the List value * - * @param values desired value to be set - * @return Builder object with new value for values + * @param value desired value to be added + * @return Builder object with new value for value */ - public B values(List values) { - getBuildingInstance().setValues(values); + public B value(SubmodelElement value) { + getBuildingInstance().getValue().add(value); return getSelf(); } /** - * This function allows adding a value to the List values + * This function allows setting a value for valueTypeListElement * - * @param value desired value to be added - * @return Builder object with new value for values + * @param valueTypeListElement desired value to be set + * @return Builder object with new value for valueTypeListElement */ - public B value(SubmodelElement value) { - getBuildingInstance().getValues().add(value); + public B valueTypeListElement(DataTypeDefXsd valueTypeListElement) { + getBuildingInstance().setValueTypeListElement(valueTypeListElement); return getSelf(); } @@ -145,90 +145,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -253,4 +253,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java index dd9bbe22e..9a86cd699 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,7 +17,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.AdministrativeInformationBuilder; @@ -36,29 +35,23 @@ @IRI("aas:AdministrativeInformation") public class DefaultAdministrativeInformation implements AdministrativeInformation { - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/creator") - protected Reference creator; - - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/revision") + @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") protected String revision; - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId") - protected String templateId; - - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") + @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") protected String version; - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - public DefaultAdministrativeInformation() {} + public DefaultAdministrativeInformation() { + + } @Override public int hashCode() { - return Objects.hash(this.version, - this.revision, - this.creator, - this.templateId, + return Objects.hash(this.revision, + this.version, this.embeddedDataSpecifications); } @@ -72,24 +65,12 @@ public boolean equals(Object obj) { return false; } else { DefaultAdministrativeInformation other = (DefaultAdministrativeInformation) obj; - return Objects.equals(this.version, other.version) && - Objects.equals(this.revision, other.revision) && - Objects.equals(this.creator, other.creator) && - Objects.equals(this.templateId, other.templateId) && + return Objects.equals(this.revision, other.revision) && + Objects.equals(this.version, other.version) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); } } - @Override - public String getVersion() { - return version; - } - - @Override - public void setVersion(String version) { - this.version = version; - } - @Override public String getRevision() { return revision; @@ -101,23 +82,13 @@ public void setRevision(String revision) { } @Override - public Reference getCreator() { - return creator; - } - - @Override - public void setCreator(Reference creator) { - this.creator = creator; - } - - @Override - public String getTemplateId() { - return templateId; + public String getVersion() { + return version; } @Override - public void setTemplateId(String templateId) { - this.templateId = templateId; + public void setVersion(String version) { + this.version = version; } @Override @@ -130,16 +101,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - public String toString() { - return String.format( - "DefaultAdministrativeInformation (" + "version=%s," - + "revision=%s," - + "creator=%s," - + "templateId=%s," - + ")", - this.version, this.revision, this.creator, this.templateId); - } - /** * This builder class can be used to construct a DefaultAdministrativeInformation bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java index 8a4f964a8..b92558245 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,43 +35,53 @@ @IRI("aas:AnnotatedRelationshipElement") public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshipElement { - @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations") + @IRI("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations") protected List annotations = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/first") + @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") protected Reference first; - @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") + @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") protected Reference second; - public DefaultAnnotatedRelationshipElement() {} + public DefaultAnnotatedRelationshipElement() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { @@ -81,12 +91,14 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -105,12 +117,14 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -175,13 +189,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -195,33 +209,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -234,11 +258,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultAnnotatedRelationshipElement (" + "annotations=%s," - + ")", - this.annotations); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java index 13bc5b590..ffc80b112 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,53 +33,59 @@ @IRI("aas:AssetAdministrationShell") public class DefaultAssetAdministrationShell implements AssetAdministrationShell { - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") protected AssetInformation assetInformation; - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") protected Reference derivedFrom; - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels") protected List submodels = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultAssetAdministrationShell() {} + public DefaultAssetAdministrationShell() { + + } @Override public int hashCode() { - return Objects.hash(this.derivedFrom, - this.assetInformation, + return Objects.hash(this.assetInformation, + this.derivedFrom, this.submodels, this.embeddedDataSpecifications, this.administration, this.id, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, this.extensions); } @@ -93,38 +99,39 @@ public boolean equals(Object obj) { return false; } else { DefaultAssetAdministrationShell other = (DefaultAssetAdministrationShell) obj; - return Objects.equals(this.derivedFrom, other.derivedFrom) && - Objects.equals(this.assetInformation, other.assetInformation) && + return Objects.equals(this.assetInformation, other.assetInformation) && + Objects.equals(this.derivedFrom, other.derivedFrom) && Objects.equals(this.submodels, other.submodels) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && Objects.equals(this.extensions, other.extensions); } } @Override - public Reference getDerivedFrom() { - return derivedFrom; + public AssetInformation getAssetInformation() { + return assetInformation; } @Override - public void setDerivedFrom(Reference derivedFrom) { - this.derivedFrom = derivedFrom; + public void setAssetInformation(AssetInformation assetInformation) { + this.assetInformation = assetInformation; } @Override - public AssetInformation getAssetInformation() { - return assetInformation; + public Reference getDerivedFrom() { + return derivedFrom; } @Override - public void setAssetInformation(AssetInformation assetInformation) { - this.assetInformation = assetInformation; + public void setDerivedFrom(Reference derivedFrom) { + this.derivedFrom = derivedFrom; } @Override @@ -178,33 +185,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; } @Override - public List getDisplayNames() { - return displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public List getDisplayName() { + return displayName; } @Override - public List getDescriptions() { - return descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -217,15 +234,6 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultAssetAdministrationShell (" + "derivedFrom=%s," - + "assetInformation=%s," - + "submodels=%s," - + ")", - this.derivedFrom, this.assetInformation, this.submodels); - } - /** * This builder class can be used to construct a DefaultAssetAdministrationShell bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java new file mode 100644 index 000000000..998f3dd4e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetAdministrationShellDescriptorBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@IRI("aas:AssetAdministrationShellDescriptor") +public class DefaultAssetAdministrationShellDescriptor implements AssetAdministrationShellDescriptor { + + @IRI("https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints") + protected List endpoints = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/administration") + protected AdministrativeInformation administration; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description") + protected List description; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName") + protected List displayName; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/identification") + protected String identification; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId") + protected Reference globalAssetId; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetIds") + protected SpecificAssetId specificAssetId; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor") + protected List submodelDescriptor; + + + public DefaultAssetAdministrationShellDescriptor() { + } + + @Override + public int hashCode() { + return Objects.hash(this.administration, + this.description, + this.displayName, + this.idShort, + this.identification, + this.globalAssetId, + this.specificAssetId, + this.submodelDescriptor, + this.endpoints); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultAssetAdministrationShellDescriptor other = (DefaultAssetAdministrationShellDescriptor) obj; + return Objects.equals(this.administration, other.administration) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.identification, other.identification) && + Objects.equals(this.globalAssetId, other.globalAssetId) && + Objects.equals(this.specificAssetId, other.specificAssetId) && + Objects.equals(this.submodelDescriptor, other.submodelDescriptor) && + Objects.equals(this.endpoints, other.endpoints); + } + } + + @Override + public AdministrativeInformation getAdministration() { + return administration; + } + + @Override + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public String getIdentification() { + return identification; + } + + @Override + public void setIdentification(String identification) { + this.identification = identification; + } + + @Override + public Reference getGlobalAssetId() { + return globalAssetId; + } + + @Override + public void setGlobalAssetId(Reference globalAssetId) { + this.globalAssetId = globalAssetId; + } + + @Override + public SpecificAssetId getSpecificAssetIds() { + return specificAssetId; + } + + @Override + public void setSpecificAssetIds(SpecificAssetId specificAssetId) { + this.specificAssetId = specificAssetId; + } + + @Override + public List getSubmodelDescriptor() { + return submodelDescriptor; + } + + @Override + public void setSubmodelDescriptor(List submodelDescriptor) { + this.submodelDescriptor = submodelDescriptor; + } + + + @Override + public List getEndpoints() { + return endpoints; + } + + @Override + public void setEndpoints(List endpoints) { + this.endpoints = endpoints; + } + + /** + * This builder class can be used to construct a DefaultAssetAdministrationShellDescriptor bean. + */ + public static class Builder extends AssetAdministrationShellDescriptorBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultAssetAdministrationShellDescriptor newBuildingInstance() { + return new DefaultAssetAdministrationShellDescriptor(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java index eaaeff408..9b31fb191 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,10 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetInformationBuilder; @@ -37,30 +34,28 @@ @IRI("aas:AssetInformation") public class DefaultAssetInformation implements AssetInformation { - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetKind") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") protected AssetKind assetKind; - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetType") - protected String assetType; - - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") protected Resource defaultThumbnail; - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId") - protected String globalAssetId; + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") + protected Reference globalAssetId; - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") protected List specificAssetIds = new ArrayList<>(); - public DefaultAssetInformation() {} + public DefaultAssetInformation() { + + } @Override public int hashCode() { return Objects.hash(this.assetKind, + this.defaultThumbnail, this.globalAssetId, - this.specificAssetIds, - this.assetType, - this.defaultThumbnail); + this.specificAssetIds); } @Override @@ -74,10 +69,9 @@ public boolean equals(Object obj) { } else { DefaultAssetInformation other = (DefaultAssetInformation) obj; return Objects.equals(this.assetKind, other.assetKind) && + Objects.equals(this.defaultThumbnail, other.defaultThumbnail) && Objects.equals(this.globalAssetId, other.globalAssetId) && - Objects.equals(this.specificAssetIds, other.specificAssetIds) && - Objects.equals(this.assetType, other.assetType) && - Objects.equals(this.defaultThumbnail, other.defaultThumbnail); + Objects.equals(this.specificAssetIds, other.specificAssetIds); } } @@ -92,54 +86,33 @@ public void setAssetKind(AssetKind assetKind) { } @Override - public String getGlobalAssetId() { - return globalAssetId; - } - - @Override - public void setGlobalAssetId(String globalAssetId) { - this.globalAssetId = globalAssetId; - } - - @Override - public List getSpecificAssetIds() { - return specificAssetIds; + public Resource getDefaultThumbnail() { + return defaultThumbnail; } @Override - public void setSpecificAssetIds(List specificAssetIds) { - this.specificAssetIds = specificAssetIds; + public void setDefaultThumbnail(Resource defaultThumbnail) { + this.defaultThumbnail = defaultThumbnail; } @Override - public String getAssetType() { - return assetType; + public Reference getGlobalAssetId() { + return globalAssetId; } @Override - public void setAssetType(String assetType) { - this.assetType = assetType; + public void setGlobalAssetId(Reference globalAssetId) { + this.globalAssetId = globalAssetId; } @Override - public Resource getDefaultThumbnail() { - return defaultThumbnail; + public List getSpecificAssetIds() { + return specificAssetIds; } @Override - public void setDefaultThumbnail(Resource defaultThumbnail) { - this.defaultThumbnail = defaultThumbnail; - } - - public String toString() { - return String.format( - "DefaultAssetInformation (" + "assetKind=%s," - + "globalAssetId=%s," - + "specificAssetIds=%s," - + "assetType=%s," - + "defaultThumbnail=%s," - + ")", - this.assetKind, this.globalAssetId, this.specificAssetIds, this.assetType, this.defaultThumbnail); + public void setSpecificAssetIds(List specificAssetIds) { + this.specificAssetIds = specificAssetIds; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java index d7fda6b91..7cdf7feb7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,78 +33,90 @@ @IRI("aas:BasicEventElement") public class DefaultBasicEventElement implements BasicEventElement { - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/direction") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") protected Direction direction; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") protected String lastUpdate; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") protected String maxInterval; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") protected Reference messageBroker; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") protected String messageTopic; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/minInterval") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") protected String minInterval; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/observed") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") protected Reference observed; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/state") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") protected StateOfEvent state; - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultBasicEventElement() {} + public DefaultBasicEventElement() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.observed, - this.direction, - this.state, - this.messageTopic, - this.messageBroker, + return Objects.hash(this.direction, this.lastUpdate, - this.minInterval, this.maxInterval, + this.messageBroker, + this.messageTopic, + this.minInterval, + this.observed, + this.state, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -117,36 +129,28 @@ public boolean equals(Object obj) { return false; } else { DefaultBasicEventElement other = (DefaultBasicEventElement) obj; - return Objects.equals(this.observed, other.observed) && - Objects.equals(this.direction, other.direction) && - Objects.equals(this.state, other.state) && - Objects.equals(this.messageTopic, other.messageTopic) && - Objects.equals(this.messageBroker, other.messageBroker) && + return Objects.equals(this.direction, other.direction) && Objects.equals(this.lastUpdate, other.lastUpdate) && - Objects.equals(this.minInterval, other.minInterval) && Objects.equals(this.maxInterval, other.maxInterval) && + Objects.equals(this.messageBroker, other.messageBroker) && + Objects.equals(this.messageTopic, other.messageTopic) && + Objects.equals(this.minInterval, other.minInterval) && + Objects.equals(this.observed, other.observed) && + Objects.equals(this.state, other.state) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } - @Override - public Reference getObserved() { - return observed; - } - - @Override - public void setObserved(Reference observed) { - this.observed = observed; - } - @Override public Direction getDirection() { return direction; @@ -158,23 +162,23 @@ public void setDirection(Direction direction) { } @Override - public StateOfEvent getState() { - return state; + public String getLastUpdate() { + return lastUpdate; } @Override - public void setState(StateOfEvent state) { - this.state = state; + public void setLastUpdate(String lastUpdate) { + this.lastUpdate = lastUpdate; } @Override - public String getMessageTopic() { - return messageTopic; + public String getMaxInterval() { + return maxInterval; } @Override - public void setMessageTopic(String messageTopic) { - this.messageTopic = messageTopic; + public void setMaxInterval(String maxInterval) { + this.maxInterval = maxInterval; } @Override @@ -188,13 +192,13 @@ public void setMessageBroker(Reference messageBroker) { } @Override - public String getLastUpdate() { - return lastUpdate; + public String getMessageTopic() { + return messageTopic; } @Override - public void setLastUpdate(String lastUpdate) { - this.lastUpdate = lastUpdate; + public void setMessageTopic(String messageTopic) { + this.messageTopic = messageTopic; } @Override @@ -208,13 +212,23 @@ public void setMinInterval(String minInterval) { } @Override - public String getMaxInterval() { - return maxInterval; + public Reference getObserved() { + return observed; } @Override - public void setMaxInterval(String maxInterval) { - this.maxInterval = maxInterval; + public void setObserved(Reference observed) { + this.observed = observed; + } + + @Override + public StateOfEvent getState() { + return state; + } + + @Override + public void setState(StateOfEvent state) { + this.state = state; } @Override @@ -248,13 +262,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -268,33 +282,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; } @Override - public List getDisplayNames() { - return displayNames; + public List getDescription() { + return description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public List getDescriptions() { - return descriptions; + public List getDisplayName() { + return displayName; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -307,19 +331,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultBasicEventElement (" + "observed=%s," - + "direction=%s," - + "state=%s," - + "messageTopic=%s," - + "messageBroker=%s," - + "lastUpdate=%s," - + "minInterval=%s," - + "maxInterval=%s," - + ")", - this.observed, this.direction, this.state, this.messageTopic, this.messageBroker, this.lastUpdate, this.minInterval, - this.maxInterval); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** From 61258fac782581e85a30a1aaa7132378098bbc60 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 30 Jun 2023 09:37:48 +0200 Subject: [PATCH 09/59] Update model project --- .../aas4j/v3/model/impl/DefaultBlob.java | 144 ++++++---- .../v3/model/impl/DefaultCapability.java | 112 +++++--- .../model/impl/DefaultConceptDescription.java | 100 ++++--- .../DefaultDataSpecificationIec61360.java | 201 ++++++------- .../DefaultDataSpecificationPhysicalUnit.java | 268 ++++++++++++++++++ .../v3/model/impl/DefaultDescriptor.java | 80 ++++++ .../DefaultEmbeddedDataSpecification.java | 20 +- .../aas4j/v3/model/impl/DefaultEndpoint.java | 93 ++++++ .../aas4j/v3/model/impl/DefaultEntity.java | 172 ++++++----- .../v3/model/impl/DefaultEnvironment.java | 47 ++- .../v3/model/impl/DefaultEventPayload.java | 110 ++++--- .../aas4j/v3/model/impl/DefaultExtension.java | 58 ++-- .../aas4j/v3/model/impl/DefaultFile.java | 144 ++++++---- .../aas4j/v3/model/impl/DefaultKey.java | 20 +- .../v3/model/impl/DefaultLangString.java | 113 ++++++++ .../impl/DefaultMultiLanguageProperty.java | 134 +++++---- .../aas4j/v3/model/impl/DefaultOperation.java | 149 ++++++---- .../model/impl/DefaultOperationVariable.java | 13 +- .../aas4j/v3/model/impl/DefaultProperty.java | 151 ++++++---- .../impl/DefaultProtocolInformation.java | 152 ++++++++++ .../aas4j/v3/model/impl/DefaultQualifier.java | 58 ++-- .../aas4j/v3/model/impl/DefaultRange.java | 147 ++++++---- .../aas4j/v3/model/impl/DefaultReference.java | 47 ++- .../model/impl/DefaultReferenceElement.java | 117 +++++--- .../impl/DefaultRelationshipElement.java | 118 +++++--- .../aas4j/v3/model/impl/DefaultResource.java | 44 ++- .../v3/model/impl/DefaultSpecificAssetId.java | 148 ++++++++++ .../aas4j/v3/model/impl/DefaultSubmodel.java | 156 +++++----- .../model/impl/DefaultSubmodelDescriptor.java | 173 +++++++++++ 29 files changed, 2262 insertions(+), 1027 deletions(-) create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index 7bf8f2a70..682d2d09d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,54 +35,68 @@ @IRI("aas:Blob") public class DefaultBlob implements Blob { - @IRI("https://admin-shell.io/aas/3/0/Blob/contentType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") protected String contentType; - @IRI("https://admin-shell.io/aas/3/0/Blob/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/value") protected byte[] value; - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultBlob() {} + public DefaultBlob() { + + this.category = "VARIABLE"; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(Arrays.hashCode(this.value), - this.contentType, + return Objects.hash(this.contentType, + Arrays.hashCode(this.value), this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -95,38 +109,40 @@ public boolean equals(Object obj) { return false; } else { DefaultBlob other = (DefaultBlob) obj; - return Arrays.equals(this.value, other.value) && - Objects.equals(this.contentType, other.contentType) && + return Objects.equals(this.contentType, other.contentType) && + Arrays.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @Override - public byte[] getValue() { - return value; + public String getContentType() { + return contentType; } @Override - public void setValue(byte[] value) { - this.value = value; + public void setContentType(String contentType) { + this.contentType = contentType; } @Override - public String getContentType() { - return contentType; + public byte[] getValue() { + return value; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setValue(byte[] value) { + this.value = value; } @Override @@ -160,13 +176,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -180,33 +196,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -219,12 +245,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultBlob (" + "value=%s," - + "contentType=%s," - + ")", - this.value, this.contentType); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java index 4f7a63e40..0a2a528a0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,46 +34,58 @@ @IRI("aas:Capability") public class DefaultCapability implements Capability { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultCapability() {} + public DefaultCapability() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { return Objects.hash(this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -89,12 +101,14 @@ public boolean equals(Object obj) { return Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -129,13 +143,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -149,33 +163,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; } @Override - public List getDisplayNames() { - return displayNames; + public List getDescription() { + return description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public List getDescriptions() { - return descriptions; + public List getDisplayName() { + return displayName; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -188,12 +212,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultCapability (" - + ")" + @Override + public List getQualifiers() { + return qualifiers; + } - ); + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java index 62a5cb678..d0b7fcbb6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,45 +34,53 @@ @IRI("aas:ConceptDescription") public class DefaultConceptDescription implements ConceptDescription { - @IRI("https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf") - protected List isCaseOfs = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") + protected List isCaseOf = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultConceptDescription() {} + public DefaultConceptDescription() { + + this.category = "PROPERTY"; + + } @Override public int hashCode() { - return Objects.hash(this.isCaseOfs, + return Objects.hash(this.isCaseOf, this.embeddedDataSpecifications, this.administration, this.id, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, this.extensions); } @@ -86,26 +94,27 @@ public boolean equals(Object obj) { return false; } else { DefaultConceptDescription other = (DefaultConceptDescription) obj; - return Objects.equals(this.isCaseOfs, other.isCaseOfs) && + return Objects.equals(this.isCaseOf, other.isCaseOf) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && Objects.equals(this.extensions, other.extensions); } } @Override - public List getIsCaseOfs() { - return isCaseOfs; + public List getIsCaseOf() { + return isCaseOf; } @Override - public void setIsCaseOfs(List isCaseOfs) { - this.isCaseOfs = isCaseOfs; + public void setIsCaseOf(List isCaseOf) { + this.isCaseOf = isCaseOf; } @Override @@ -149,33 +158,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; } @Override - public List getDisplayNames() { - return displayNames; + public List getDescription() { + return description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public List getDescriptions() { - return descriptions; + public List getDisplayName() { + return displayName; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -188,13 +207,6 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultConceptDescription (" + "isCaseOfs=%s," - + ")", - this.isCaseOfs); - } - /** * This builder class can be used to construct a DefaultConceptDescription bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java index 799f3cee9..7c26835ce 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,7 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationIec61360Builder; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationIEC61360Builder; import java.util.ArrayList; import java.util.List; @@ -26,67 +26,69 @@ /** * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360 + * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360 * * Content of data specification template for concept descriptions for properties, values and value * lists conformant to IEC 61360. */ -@IRI("aas:DataSpecificationIec61360") -public class DefaultDataSpecificationIec61360 implements DataSpecificationIec61360 { +@IRI("aas:DataSpecificationIEC61360") +public class DefaultDataSpecificationIEC61360 implements DataSpecificationIEC61360 { - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType") - protected DataTypeIec61360 dataType; + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") + protected DataTypeIEC61360 dataType; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition") - protected List definitions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + protected List definition = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") protected LevelType levelType; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName") - protected List preferredNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + protected List preferredName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName") - protected List shortNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + protected List shortName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") protected String sourceOfDefinition; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") protected String symbol; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") protected String unit; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") protected Reference unitId; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") protected String valueFormat; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") protected ValueList valueList; - public DefaultDataSpecificationIec61360() {} + public DefaultDataSpecificationIEC61360() { + + } @Override public int hashCode() { - return Objects.hash(this.preferredNames, - this.shortNames, - this.unit, - this.unitId, + return Objects.hash(this.dataType, + this.definition, + this.levelType, + this.preferredName, + this.shortName, this.sourceOfDefinition, this.symbol, - this.dataType, - this.definitions, - this.valueFormat, - this.valueList, + this.unit, + this.unitId, this.value, - this.levelType); + this.valueFormat, + this.valueList); } @Override @@ -98,60 +100,70 @@ public boolean equals(Object obj) { } else if (this.getClass() != obj.getClass()) { return false; } else { - DefaultDataSpecificationIec61360 other = (DefaultDataSpecificationIec61360) obj; - return Objects.equals(this.preferredNames, other.preferredNames) && - Objects.equals(this.shortNames, other.shortNames) && - Objects.equals(this.unit, other.unit) && - Objects.equals(this.unitId, other.unitId) && + DefaultDataSpecificationIEC61360 other = (DefaultDataSpecificationIEC61360) obj; + return Objects.equals(this.dataType, other.dataType) && + Objects.equals(this.definition, other.definition) && + Objects.equals(this.levelType, other.levelType) && + Objects.equals(this.preferredName, other.preferredName) && + Objects.equals(this.shortName, other.shortName) && Objects.equals(this.sourceOfDefinition, other.sourceOfDefinition) && Objects.equals(this.symbol, other.symbol) && - Objects.equals(this.dataType, other.dataType) && - Objects.equals(this.definitions, other.definitions) && - Objects.equals(this.valueFormat, other.valueFormat) && - Objects.equals(this.valueList, other.valueList) && + Objects.equals(this.unit, other.unit) && + Objects.equals(this.unitId, other.unitId) && Objects.equals(this.value, other.value) && - Objects.equals(this.levelType, other.levelType); + Objects.equals(this.valueFormat, other.valueFormat) && + Objects.equals(this.valueList, other.valueList); } } @Override - public List getPreferredNames() { - return preferredNames; + public DataTypeIEC61360 getDataType() { + return dataType; } @Override - public void setPreferredNames(List preferredNames) { - this.preferredNames = preferredNames; + public void setDataType(DataTypeIEC61360 dataType) { + this.dataType = dataType; } @Override - public List getShortNames() { - return shortNames; + public List getDefinition() { + return definition; } @Override - public void setShortNames(List shortNames) { - this.shortNames = shortNames; + public void setDefinition(List definition) { + this.definition = definition; } @Override - public String getUnit() { - return unit; + public LevelType getLevelType() { + return levelType; } @Override - public void setUnit(String unit) { - this.unit = unit; + public void setLevelType(LevelType levelType) { + this.levelType = levelType; } @Override - public Reference getUnitId() { - return unitId; + public List getPreferredName() { + return preferredName; } @Override - public void setUnitId(Reference unitId) { - this.unitId = unitId; + public void setPreferredName(List preferredName) { + this.preferredName = preferredName; + } + + @Override + public List getShortName() { + return shortName; + } + + @Override + public void setShortName(List shortName) { + this.shortName = shortName; } @Override @@ -175,23 +187,33 @@ public void setSymbol(String symbol) { } @Override - public DataTypeIec61360 getDataType() { - return dataType; + public String getUnit() { + return unit; } @Override - public void setDataType(DataTypeIec61360 dataType) { - this.dataType = dataType; + public void setUnit(String unit) { + this.unit = unit; } @Override - public List getDefinitions() { - return definitions; + public Reference getUnitId() { + return unitId; } @Override - public void setDefinitions(List definitions) { - this.definitions = definitions; + public void setUnitId(Reference unitId) { + this.unitId = unitId; + } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; } @Override @@ -214,49 +236,10 @@ public void setValueList(ValueList valueList) { this.valueList = valueList; } - @Override - public String getValue() { - return value; - } - - @Override - public void setValue(String value) { - this.value = value; - } - - @Override - public LevelType getLevelType() { - return levelType; - } - - @Override - public void setLevelType(LevelType levelType) { - this.levelType = levelType; - } - - public String toString() { - return String.format( - "DefaultDataSpecificationIec61360 (" + "preferredNames=%s," - + "shortNames=%s," - + "unit=%s," - + "unitId=%s," - + "sourceOfDefinition=%s," - + "symbol=%s," - + "dataType=%s," - + "definitions=%s," - + "valueFormat=%s," - + "valueList=%s," - + "value=%s," - + "levelType=%s," - + ")", - this.preferredNames, this.shortNames, this.unit, this.unitId, this.sourceOfDefinition, this.symbol, this.dataType, - this.definitions, this.valueFormat, this.valueList, this.value, this.levelType); - } - /** - * This builder class can be used to construct a DefaultDataSpecificationIec61360 bean. + * This builder class can be used to construct a DefaultDataSpecificationIEC61360 bean. */ - public static class Builder extends DataSpecificationIec61360Builder { + public static class Builder extends DataSpecificationIEC61360Builder { @Override protected Builder getSelf() { @@ -264,8 +247,8 @@ protected Builder getSelf() { } @Override - protected DefaultDataSpecificationIec61360 newBuildingInstance() { - return new DefaultDataSpecificationIec61360(); + protected DefaultDataSpecificationIEC61360 newBuildingInstance() { + return new DefaultDataSpecificationIEC61360(); } } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java new file mode 100644 index 000000000..5abc284d3 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationPhysicalUnitBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit + * + */ + +@IRI("aas:DataSpecificationPhysicalUnit") +public class DefaultDataSpecificationPhysicalUnit implements DataSpecificationPhysicalUnit { + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") + protected String conversionFactor; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition") + protected List definition = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") + protected String dinNotation; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") + protected String eceCode; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName") + protected String eceName; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName") + protected String nistName; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") + protected String registrationAuthorityId; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName") + protected String siName; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") + protected String siNotation; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition") + protected String sourceOfDefinition; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier") + protected String supplier; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName") + protected String unitName; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") + protected String unitSymbol; + + public DefaultDataSpecificationPhysicalUnit() { + + } + + @Override + public int hashCode() { + return Objects.hash(this.conversionFactor, + this.definition, + this.dinNotation, + this.eceCode, + this.eceName, + this.nistName, + this.registrationAuthorityId, + this.siName, + this.siNotation, + this.sourceOfDefinition, + this.supplier, + this.unitName, + this.unitSymbol); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultDataSpecificationPhysicalUnit other = (DefaultDataSpecificationPhysicalUnit) obj; + return Objects.equals(this.conversionFactor, other.conversionFactor) && + Objects.equals(this.definition, other.definition) && + Objects.equals(this.dinNotation, other.dinNotation) && + Objects.equals(this.eceCode, other.eceCode) && + Objects.equals(this.eceName, other.eceName) && + Objects.equals(this.nistName, other.nistName) && + Objects.equals(this.registrationAuthorityId, other.registrationAuthorityId) && + Objects.equals(this.siName, other.siName) && + Objects.equals(this.siNotation, other.siNotation) && + Objects.equals(this.sourceOfDefinition, other.sourceOfDefinition) && + Objects.equals(this.supplier, other.supplier) && + Objects.equals(this.unitName, other.unitName) && + Objects.equals(this.unitSymbol, other.unitSymbol); + } + } + + @Override + public String getConversionFactor() { + return conversionFactor; + } + + @Override + public void setConversionFactor(String conversionFactor) { + this.conversionFactor = conversionFactor; + } + + @Override + public List getDefinition() { + return definition; + } + + @Override + public void setDefinition(List definition) { + this.definition = definition; + } + + @Override + public String getDinNotation() { + return dinNotation; + } + + @Override + public void setDinNotation(String dinNotation) { + this.dinNotation = dinNotation; + } + + @Override + public String getEceCode() { + return eceCode; + } + + @Override + public void setEceCode(String eceCode) { + this.eceCode = eceCode; + } + + @Override + public String getEceName() { + return eceName; + } + + @Override + public void setEceName(String eceName) { + this.eceName = eceName; + } + + @Override + public String getNistName() { + return nistName; + } + + @Override + public void setNistName(String nistName) { + this.nistName = nistName; + } + + @Override + public String getRegistrationAuthorityId() { + return registrationAuthorityId; + } + + @Override + public void setRegistrationAuthorityId(String registrationAuthorityId) { + this.registrationAuthorityId = registrationAuthorityId; + } + + @Override + public String getSiName() { + return siName; + } + + @Override + public void setSiName(String siName) { + this.siName = siName; + } + + @Override + public String getSiNotation() { + return siNotation; + } + + @Override + public void setSiNotation(String siNotation) { + this.siNotation = siNotation; + } + + @Override + public String getSourceOfDefinition() { + return sourceOfDefinition; + } + + @Override + public void setSourceOfDefinition(String sourceOfDefinition) { + this.sourceOfDefinition = sourceOfDefinition; + } + + @Override + public String getSupplier() { + return supplier; + } + + @Override + public void setSupplier(String supplier) { + this.supplier = supplier; + } + + @Override + public String getUnitName() { + return unitName; + } + + @Override + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + @Override + public String getUnitSymbol() { + return unitSymbol; + } + + @Override + public void setUnitSymbol(String unitSymbol) { + this.unitSymbol = unitSymbol; + } + + /** + * This builder class can be used to construct a DefaultDataSpecificationPhysicalUnit bean. + */ + public static class Builder extends DataSpecificationPhysicalUnitBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultDataSpecificationPhysicalUnit newBuildingInstance() { + return new DefaultDataSpecificationPhysicalUnit(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java new file mode 100644 index 000000000..c1a915ca5 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.Descriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.DescriptorBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@IRI("aas:Descriptor") +public class DefaultDescriptor implements Descriptor { + + @IRI("https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints") + protected List endpoints = new ArrayList<>(); + + public DefaultDescriptor() { + } + + @Override + public int hashCode() { + return Objects.hash(this.endpoints); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultDescriptor other = (DefaultDescriptor) obj; + return Objects.equals(this.endpoints, other.endpoints); + } + } + + @Override + public List getEndpoints() { + return endpoints; + } + + @Override + public void setEndpoints(List endpoints) { + this.endpoints = endpoints; + } + + /** + * This builder class can be used to construct a DefaultDescriptor bean. + */ + public static class Builder extends DescriptorBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultDescriptor newBuildingInstance() { + return new DefaultDescriptor(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java index 093108949..16d9fe711 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,13 +34,15 @@ @IRI("aas:EmbeddedDataSpecification") public class DefaultEmbeddedDataSpecification implements EmbeddedDataSpecification { - @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification") + @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") protected Reference dataSpecification; - @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent") + @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") protected DataSpecificationContent dataSpecificationContent; - public DefaultEmbeddedDataSpecification() {} + public DefaultEmbeddedDataSpecification() { + + } @Override public int hashCode() { @@ -83,14 +85,6 @@ public void setDataSpecificationContent(DataSpecificationContent dataSpecificati this.dataSpecificationContent = dataSpecificationContent; } - public String toString() { - return String.format( - "DefaultEmbeddedDataSpecification (" + "dataSpecification=%s," - + "dataSpecificationContent=%s," - + ")", - this.dataSpecification, this.dataSpecificationContent); - } - /** * This builder class can be used to construct a DefaultEmbeddedDataSpecification bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java new file mode 100644 index 000000000..648e4859d --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.EndpointBuilder; + +import java.util.Objects; + +@IRI("aas:Endpoint") +public class DefaultEndpoint implements Endpoint { + + @IRI("https://admin-shell.io/aas/3/0/RC02/Endpoint/_interface") + protected String interfaceValue; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Endpoint/protocolInformation") + protected ProtocolInformation protocolInformation; + + public DefaultEndpoint() { + } + + @Override + public int hashCode() { + return Objects.hash(this.interfaceValue, + this.protocolInformation); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultEndpoint other = (DefaultEndpoint) obj; + return Objects.equals(this.interfaceValue, other.interfaceValue) && + Objects.equals(this.protocolInformation, other.protocolInformation); + } + } + + @Override + public String getInterface() { + return interfaceValue; + } + + @Override + public void setInterface(String interfaceValue) { + this.interfaceValue = interfaceValue; + } + + @Override + public ProtocolInformation getProtocolInformation() { + return protocolInformation; + } + + @Override + public void setProtocolInformation(ProtocolInformation protocolInformation) { + this.protocolInformation = protocolInformation; + } + + /** + * This builder class can be used to construct a DefaultEndpoint bean. + */ + public static class Builder extends EndpointBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultEndpoint newBuildingInstance() { + return new DefaultEndpoint(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java index f049cb13f..979271811 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,62 +33,74 @@ @IRI("aas:Entity") public class DefaultEntity implements Entity { - @IRI("https://admin-shell.io/aas/3/0/Entity/entityType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") protected EntityType entityType; - @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetId") - protected String globalAssetId; + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") + protected Reference globalAssetId; - @IRI("https://admin-shell.io/aas/3/0/Entity/specificAssetIds") - protected List specificAssetIds = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") + protected SpecificAssetId specificAssetId; - @IRI("https://admin-shell.io/aas/3/0/Entity/statements") + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/statements") protected List statements = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultEntity() {} + public DefaultEntity() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.statements, - this.entityType, + return Objects.hash(this.entityType, this.globalAssetId, - this.specificAssetIds, + this.specificAssetId, + this.statements, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -101,32 +113,24 @@ public boolean equals(Object obj) { return false; } else { DefaultEntity other = (DefaultEntity) obj; - return Objects.equals(this.statements, other.statements) && - Objects.equals(this.entityType, other.entityType) && + return Objects.equals(this.entityType, other.entityType) && Objects.equals(this.globalAssetId, other.globalAssetId) && - Objects.equals(this.specificAssetIds, other.specificAssetIds) && + Objects.equals(this.specificAssetId, other.specificAssetId) && + Objects.equals(this.statements, other.statements) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } - @Override - public List getStatements() { - return statements; - } - - @Override - public void setStatements(List statements) { - this.statements = statements; - } - @Override public EntityType getEntityType() { return entityType; @@ -138,23 +142,33 @@ public void setEntityType(EntityType entityType) { } @Override - public String getGlobalAssetId() { + public Reference getGlobalAssetId() { return globalAssetId; } @Override - public void setGlobalAssetId(String globalAssetId) { + public void setGlobalAssetId(Reference globalAssetId) { this.globalAssetId = globalAssetId; } @Override - public List getSpecificAssetIds() { - return specificAssetIds; + public SpecificAssetId getSpecificAssetId() { + return specificAssetId; } @Override - public void setSpecificAssetIds(List specificAssetIds) { - this.specificAssetIds = specificAssetIds; + public void setSpecificAssetId(SpecificAssetId specificAssetId) { + this.specificAssetId = specificAssetId; + } + + @Override + public List getStatements() { + return statements; + } + + @Override + public void setStatements(List statements) { + this.statements = statements; } @Override @@ -188,13 +202,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -208,33 +222,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -247,14 +271,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultEntity (" + "statements=%s," - + "entityType=%s," - + "globalAssetId=%s," - + "specificAssetIds=%s," - + ")", - this.statements, this.entityType, this.globalAssetId, this.specificAssetIds); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java index 53367b728..012b4aca8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -36,22 +36,24 @@ @IRI("aas:Environment") public class DefaultEnvironment implements Environment { - @IRI("https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells") + @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") protected List assetAdministrationShells = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Environment/conceptDescriptions") + @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") protected List conceptDescriptions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") + @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") protected List submodels = new ArrayList<>(); - public DefaultEnvironment() {} + public DefaultEnvironment() { + + } @Override public int hashCode() { return Objects.hash(this.assetAdministrationShells, - this.submodels, - this.conceptDescriptions); + this.conceptDescriptions, + this.submodels); } @Override @@ -65,8 +67,8 @@ public boolean equals(Object obj) { } else { DefaultEnvironment other = (DefaultEnvironment) obj; return Objects.equals(this.assetAdministrationShells, other.assetAdministrationShells) && - Objects.equals(this.submodels, other.submodels) && - Objects.equals(this.conceptDescriptions, other.conceptDescriptions); + Objects.equals(this.conceptDescriptions, other.conceptDescriptions) && + Objects.equals(this.submodels, other.submodels); } } @@ -80,16 +82,6 @@ public void setAssetAdministrationShells(List assetAdm this.assetAdministrationShells = assetAdministrationShells; } - @Override - public List getSubmodels() { - return submodels; - } - - @Override - public void setSubmodels(List submodels) { - this.submodels = submodels; - } - @Override public List getConceptDescriptions() { return conceptDescriptions; @@ -100,13 +92,14 @@ public void setConceptDescriptions(List conceptDescriptions) this.conceptDescriptions = conceptDescriptions; } - public String toString() { - return String.format( - "DefaultEnvironment (" + "assetAdministrationShells=%s," - + "submodels=%s," - + "conceptDescriptions=%s," - + ")", - this.assetAdministrationShells, this.submodels, this.conceptDescriptions); + @Override + public List getSubmodels() { + return submodels; + } + + @Override + public void setSubmodels(List submodels) { + this.submodels = submodels; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java index 49453f922..ff4ffe345 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,7 +20,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.EventPayloadBuilder; -import java.util.Arrays; import java.util.Objects; @@ -33,42 +32,44 @@ @IRI("aas:EventPayload") public class DefaultEventPayload implements EventPayload { - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference") protected Reference observableReference; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId") protected Reference observableSemanticId; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") - protected byte[] payload; + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/payload") + protected String payload; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/source") protected Reference source; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId") protected Reference sourceSemanticId; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectId") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId") protected Reference subjectId; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/timeStamp") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp") protected String timeStamp; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/topic") protected String topic; - public DefaultEventPayload() {} + public DefaultEventPayload() { + + } @Override public int hashCode() { - return Objects.hash(this.source, - this.sourceSemanticId, - this.observableReference, + return Objects.hash(this.observableReference, this.observableSemanticId, - this.topic, + this.payload, + this.source, + this.sourceSemanticId, this.subjectId, this.timeStamp, - Arrays.hashCode(this.payload)); + this.topic); } @Override @@ -81,65 +82,65 @@ public boolean equals(Object obj) { return false; } else { DefaultEventPayload other = (DefaultEventPayload) obj; - return Objects.equals(this.source, other.source) && - Objects.equals(this.sourceSemanticId, other.sourceSemanticId) && - Objects.equals(this.observableReference, other.observableReference) && + return Objects.equals(this.observableReference, other.observableReference) && Objects.equals(this.observableSemanticId, other.observableSemanticId) && - Objects.equals(this.topic, other.topic) && + Objects.equals(this.payload, other.payload) && + Objects.equals(this.source, other.source) && + Objects.equals(this.sourceSemanticId, other.sourceSemanticId) && Objects.equals(this.subjectId, other.subjectId) && Objects.equals(this.timeStamp, other.timeStamp) && - Arrays.equals(this.payload, other.payload); + Objects.equals(this.topic, other.topic); } } @Override - public Reference getSource() { - return source; + public Reference getObservableReference() { + return observableReference; } @Override - public void setSource(Reference source) { - this.source = source; + public void setObservableReference(Reference observableReference) { + this.observableReference = observableReference; } @Override - public Reference getSourceSemanticId() { - return sourceSemanticId; + public Reference getObservableSemanticId() { + return observableSemanticId; } @Override - public void setSourceSemanticId(Reference sourceSemanticId) { - this.sourceSemanticId = sourceSemanticId; + public void setObservableSemanticId(Reference observableSemanticId) { + this.observableSemanticId = observableSemanticId; } @Override - public Reference getObservableReference() { - return observableReference; + public String getPayload() { + return payload; } @Override - public void setObservableReference(Reference observableReference) { - this.observableReference = observableReference; + public void setPayload(String payload) { + this.payload = payload; } @Override - public Reference getObservableSemanticId() { - return observableSemanticId; + public Reference getSource() { + return source; } @Override - public void setObservableSemanticId(Reference observableSemanticId) { - this.observableSemanticId = observableSemanticId; + public void setSource(Reference source) { + this.source = source; } @Override - public String getTopic() { - return topic; + public Reference getSourceSemanticId() { + return sourceSemanticId; } @Override - public void setTopic(String topic) { - this.topic = topic; + public void setSourceSemanticId(Reference sourceSemanticId) { + this.sourceSemanticId = sourceSemanticId; } @Override @@ -163,28 +164,13 @@ public void setTimeStamp(String timeStamp) { } @Override - public byte[] getPayload() { - return payload; + public String getTopic() { + return topic; } @Override - public void setPayload(byte[] payload) { - this.payload = payload; - } - - public String toString() { - return String.format( - "DefaultEventPayload (" + "source=%s," - + "sourceSemanticId=%s," - + "observableReference=%s," - + "observableSemanticId=%s," - + "topic=%s," - + "subjectId=%s," - + "timeStamp=%s," - + "payload=%s," - + ")", - this.source, this.sourceSemanticId, this.observableReference, this.observableSemanticId, this.topic, this.subjectId, - this.timeStamp, this.payload); + public void setTopic(String topic) { + this.topic = topic; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java index 60f3a99bf..ffe3224de 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,32 +35,36 @@ @IRI("aas:Extension") public class DefaultExtension implements Extension { - @IRI("https://admin-shell.io/aas/3/0/Extension/name") + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/name") protected String name; - @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") - protected List refersTos = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") + protected Reference refersTo; - @IRI("https://admin-shell.io/aas/3/0/Extension/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - public DefaultExtension() {} + public DefaultExtension() { + + this.valueType = DataTypeDefXsd.STRING; + + } @Override public int hashCode() { return Objects.hash(this.name, - this.valueType, + this.refersTo, this.value, - this.refersTos, + this.valueType, this.semanticId, this.supplementalSemanticIds); } @@ -76,9 +80,9 @@ public boolean equals(Object obj) { } else { DefaultExtension other = (DefaultExtension) obj; return Objects.equals(this.name, other.name) && - Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.refersTo, other.refersTo) && Objects.equals(this.value, other.value) && - Objects.equals(this.refersTos, other.refersTos) && + Objects.equals(this.valueType, other.valueType) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } @@ -95,13 +99,13 @@ public void setName(String name) { } @Override - public DataTypeDefXsd getValueType() { - return valueType; + public Reference getRefersTo() { + return refersTo; } @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; + public void setRefersTo(Reference refersTo) { + this.refersTo = refersTo; } @Override @@ -115,13 +119,13 @@ public void setValue(String value) { } @Override - public List getRefersTos() { - return refersTos; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setRefersTos(List refersTos) { - this.refersTos = refersTos; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override @@ -144,16 +148,6 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } - public String toString() { - return String.format( - "DefaultExtension (" + "name=%s," - + "valueType=%s," - + "value=%s," - + "refersTos=%s," - + ")", - this.name, this.valueType, this.value, this.refersTos); - } - /** * This builder class can be used to construct a DefaultExtension bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java index 908dbfbb0..543eafd41 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,54 +33,68 @@ @IRI("aas:File") public class DefaultFile implements File { - @IRI("https://admin-shell.io/aas/3/0/File/contentType") + @IRI("https://admin-shell.io/aas/3/0/RC02/File/contentType") protected String contentType; - @IRI("https://admin-shell.io/aas/3/0/File/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/File/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultFile() {} + public DefaultFile() { + + this.category = "VARIABLE"; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.value, - this.contentType, + return Objects.hash(this.contentType, + this.value, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -93,38 +107,40 @@ public boolean equals(Object obj) { return false; } else { DefaultFile other = (DefaultFile) obj; - return Objects.equals(this.value, other.value) && - Objects.equals(this.contentType, other.contentType) && + return Objects.equals(this.contentType, other.contentType) && + Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @Override - public String getValue() { - return value; + public String getContentType() { + return contentType; } @Override - public void setValue(String value) { - this.value = value; + public void setContentType(String contentType) { + this.contentType = contentType; } @Override - public String getContentType() { - return contentType; + public String getValue() { + return value; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setValue(String value) { + this.value = value; } @Override @@ -158,13 +174,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -178,33 +194,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -217,12 +243,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultFile (" + "value=%s," - + "contentType=%s," - + ")", - this.value, this.contentType); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java index a5be28afe..ad4f10f7f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,13 +32,15 @@ @IRI("aas:Key") public class DefaultKey implements Key { - @IRI("https://admin-shell.io/aas/3/0/Key/type") + @IRI("https://admin-shell.io/aas/3/0/RC02/Key/type") protected KeyTypes type; - @IRI("https://admin-shell.io/aas/3/0/Key/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Key/value") protected String value; - public DefaultKey() {} + public DefaultKey() { + + } @Override public int hashCode() { @@ -81,14 +83,6 @@ public void setValue(String value) { this.value = value; } - public String toString() { - return String.format( - "DefaultKey (" + "type=%s," - + "value=%s," - + ")", - this.type, this.value); - } - /** * This builder class can be used to construct a DefaultKey bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java new file mode 100644 index 000000000..30b2300cf --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringBuilder; + +import java.util.Objects; + + +@IRI("rdf:langString") +public class DefaultLangString implements LangString { + + protected String language = null; + protected String text = null; + + public DefaultLangString() { + super(); + } + + public DefaultLangString(String textAndLanguage) { + if (textAndLanguage.contains("@")) { + String[] splitString = textAndLanguage.split("@"); + this.text = splitString[0]; + this.language = splitString[1]; + } else { + this.text = textAndLanguage; + } + } + + public DefaultLangString(String text, String language) { + this.text = text; + this.language = language; + } + + @Override + public String getLanguage() { + return language; + } + + @Override + public void setLanguage(String language) { + this.language = language; + } + + @Override + public String getText() { + return text; + } + + @Override + public void setText(String text) { + this.text = text; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultLangString other = (DefaultLangString) obj; + return Objects.equals(this.language, other.language) && Objects.equals(this.text, other.text); + } + } + + @Override + public int hashCode() { + return Objects.hash(this.language, this.text); + } + + @Override + public String toString() { + String result = this.text; + if (this.language != null && !this.language.isEmpty()) { + return "\"" + result + "\"@" + this.language; + } + return result; + } + + /** + * This builder class can be used to construct a DefaultLangString bean. + */ + public static class Builder extends LangStringBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultLangString newBuildingInstance() { + return new DefaultLangString(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java index 27bf73690..0bdc7638a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,54 +33,68 @@ @IRI("aas:MultiLanguageProperty") public class DefaultMultiLanguageProperty implements MultiLanguageProperty { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/value") - protected List values = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") + protected List value = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") protected Reference valueId; - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultMultiLanguageProperty() {} + public DefaultMultiLanguageProperty() { + + this.category = "VARIABLE"; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.values, + return Objects.hash(this.value, this.valueId, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -93,28 +107,30 @@ public boolean equals(Object obj) { return false; } else { DefaultMultiLanguageProperty other = (DefaultMultiLanguageProperty) obj; - return Objects.equals(this.values, other.values) && + return Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @Override - public List getValues() { - return values; + public List getValue() { + return value; } @Override - public void setValues(List values) { - this.values = values; + public void setValue(List value) { + this.value = value; } @Override @@ -158,13 +174,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -178,33 +194,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; } @Override - public List getDisplayNames() { - return displayNames; + public List getDescription() { + return description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public List getDescriptions() { - return descriptions; + public List getDisplayName() { + return displayName; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -217,12 +243,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultMultiLanguageProperty (" + "values=%s," - + "valueId=%s," - + ")", - this.values, this.valueId); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java index b4f359f66..fe8d5e818 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,58 +33,70 @@ @IRI("aas:Operation") public class DefaultOperation implements Operation { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Operation/inoutputVariables") + @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables") protected List inoutputVariables = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Operation/inputVariables") + @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables") protected List inputVariables = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Operation/outputVariables") + @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables") protected List outputVariables = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultOperation() {} + public DefaultOperation() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.inputVariables, + return Objects.hash(this.inoutputVariables, + this.inputVariables, this.outputVariables, - this.inoutputVariables, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -97,21 +109,33 @@ public boolean equals(Object obj) { return false; } else { DefaultOperation other = (DefaultOperation) obj; - return Objects.equals(this.inputVariables, other.inputVariables) && + return Objects.equals(this.inoutputVariables, other.inoutputVariables) && + Objects.equals(this.inputVariables, other.inputVariables) && Objects.equals(this.outputVariables, other.outputVariables) && - Objects.equals(this.inoutputVariables, other.inoutputVariables) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } + @Override + public List getInoutputVariables() { + return inoutputVariables; + } + + @Override + public void setInoutputVariables(List inoutputVariables) { + this.inoutputVariables = inoutputVariables; + } + @Override public List getInputVariables() { return inputVariables; @@ -132,16 +156,6 @@ public void setOutputVariables(List outputVariables) { this.outputVariables = outputVariables; } - @Override - public List getInoutputVariables() { - return inoutputVariables; - } - - @Override - public void setInoutputVariables(List inoutputVariables) { - this.inoutputVariables = inoutputVariables; - } - @Override public List getEmbeddedDataSpecifications() { return embeddedDataSpecifications; @@ -173,13 +187,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -193,33 +207,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -232,13 +256,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultOperation (" + "inputVariables=%s," - + "outputVariables=%s," - + "inoutputVariables=%s," - + ")", - this.inputVariables, this.outputVariables, this.inoutputVariables); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java index 5d30e0263..a559f8ac1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,7 +33,7 @@ @IRI("aas:OperationVariable") public class DefaultOperationVariable implements OperationVariable { - @IRI("https://admin-shell.io/aas/3/0/OperationVariable/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") protected SubmodelElement value; public DefaultOperationVariable() {} @@ -67,13 +67,6 @@ public void setValue(SubmodelElement value) { this.value = value; } - public String toString() { - return String.format( - "DefaultOperationVariable (" + "value=%s," - + ")", - this.value); - } - /** * This builder class can be used to construct a DefaultOperationVariable bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java index 273ac55b9..a83c00054 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,58 +33,72 @@ @IRI("aas:Property") public class DefaultProperty implements Property { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Property/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Property/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/Property/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueId") protected Reference valueId; - @IRI("https://admin-shell.io/aas/3/0/Property/valueType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueType") protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultProperty() {} + public DefaultProperty() { + + this.category = "VARIABLE"; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.valueType, - this.value, + return Objects.hash(this.value, this.valueId, + this.valueType, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -97,31 +111,23 @@ public boolean equals(Object obj) { return false; } else { DefaultProperty other = (DefaultProperty) obj; - return Objects.equals(this.valueType, other.valueType) && - Objects.equals(this.value, other.value) && + return Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && + Objects.equals(this.valueType, other.valueType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } - @Override - public DataTypeDefXsd getValueType() { - return valueType; - } - - @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; - } - @Override public String getValue() { return value; @@ -142,6 +148,16 @@ public void setValueId(Reference valueId) { this.valueId = valueId; } + @Override + public DataTypeDefXsd getValueType() { + return valueType; + } + + @Override + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; + } + @Override public List getEmbeddedDataSpecifications() { return embeddedDataSpecifications; @@ -173,13 +189,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -193,33 +209,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -232,13 +258,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultProperty (" + "valueType=%s," - + "value=%s," - + "valueId=%s," - + ")", - this.valueType, this.value, this.valueId); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java new file mode 100644 index 000000000..4f2d99fb2 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.ProtocolInformationBuilder; + +import java.util.Objects; + +@IRI("aas:ProtocolInformation") +public class DefaultProtocolInformation implements ProtocolInformation { + + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointAddress") + protected String endpointAddress; + + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol") + protected String endpointProtocol; + + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion") + protected String endpointProtocolVersion; + + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol") + protected String subprotocol; + + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBody") + protected String subprotocolBody; + + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBodyEncoding") + protected String subprotocolBodyEncoding; + + public DefaultProtocolInformation() { + } + + @Override + public int hashCode() { + return Objects.hash(this.endpointAddress, + this.endpointProtocol, + this.endpointProtocolVersion, + this.subprotocol, + this.subprotocolBody, + this.subprotocolBodyEncoding); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultProtocolInformation other = (DefaultProtocolInformation) obj; + return Objects.equals(this.endpointAddress, other.endpointAddress) && + Objects.equals(this.endpointProtocol, other.endpointProtocol) && + Objects.equals(this.endpointProtocolVersion, other.endpointProtocolVersion) && + Objects.equals(this.subprotocol, other.subprotocol) && + Objects.equals(this.subprotocolBody, other.subprotocolBody) && + Objects.equals(this.subprotocolBodyEncoding, other.subprotocolBodyEncoding); + } + } + + @Override + public String getEndpointAddress() { + return endpointAddress; + } + + @Override + public void setEndpointAddress(String endpointAddress) { + this.endpointAddress = endpointAddress; + } + + @Override + public String getEndpointProtocol() { + return endpointProtocol; + } + + @Override + public void setEndpointProtocol(String endpointProtocol) { + this.endpointProtocol = endpointProtocol; + } + + @Override + public String getEndpointProtocolVersion() { + return endpointProtocolVersion; + } + + @Override + public void setEndpointProtocolVersion(String endpointProtocolVersion) { + this.endpointProtocolVersion = endpointProtocolVersion; + } + + @Override + public String getSubprotocol() { + return subprotocol; + } + + @Override + public void setSubprotocol(String subprotocol) { + this.subprotocol = subprotocol; + } + + @Override + public String getSubprotocolBody() { + return subprotocolBody; + } + + @Override + public void setSubprotocolBody(String subprotocolBody) { + this.subprotocolBody = subprotocolBody; + } + + @Override + public String getSubprotocolBodyEncoding() { + return subprotocolBodyEncoding; + } + + @Override + public void setSubprotocolBodyEncoding(String subprotocolBodyEncoding) { + this.subprotocolBodyEncoding = subprotocolBodyEncoding; + } + + /** + * This builder class can be used to construct a DefaultProtocolInformation bean. + */ + public static class Builder extends ProtocolInformationBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultProtocolInformation newBuildingInstance() { + return new DefaultProtocolInformation(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java index 2bb2a7182..659a522bd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -37,36 +37,39 @@ @IRI("aas:Qualifier") public class DefaultQualifier implements Qualifier { - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifier/kind") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/kind") protected QualifierKind kind; - @IRI("https://admin-shell.io/aas/3/0/Qualifier/type") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") protected String type; - @IRI("https://admin-shell.io/aas/3/0/Qualifier/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") protected Reference valueId; - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") protected DataTypeDefXsd valueType; - public DefaultQualifier() {} + public DefaultQualifier() { + this.kind = QualifierKind.CONCEPT_QUALIFIER; + + } @Override public int hashCode() { return Objects.hash(this.kind, this.type, - this.valueType, this.value, this.valueId, + this.valueType, this.semanticId, this.supplementalSemanticIds); } @@ -83,9 +86,9 @@ public boolean equals(Object obj) { DefaultQualifier other = (DefaultQualifier) obj; return Objects.equals(this.kind, other.kind) && Objects.equals(this.type, other.type) && - Objects.equals(this.valueType, other.valueType) && Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && + Objects.equals(this.valueType, other.valueType) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } @@ -111,16 +114,6 @@ public void setType(String type) { this.type = type; } - @Override - public DataTypeDefXsd getValueType() { - return valueType; - } - - @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; - } - @Override public String getValue() { return value; @@ -141,6 +134,16 @@ public void setValueId(Reference valueId) { this.valueId = valueId; } + @Override + public DataTypeDefXsd getValueType() { + return valueType; + } + + @Override + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; + } + @Override public Reference getSemanticId() { return semanticId; @@ -161,17 +164,6 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } - public String toString() { - return String.format( - "DefaultQualifier (" + "kind=%s," - + "type=%s," - + "valueType=%s," - + "value=%s," - + "valueId=%s," - + ")", - this.kind, this.type, this.valueType, this.value, this.valueId); - } - /** * This builder class can be used to construct a DefaultQualifier bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java index 1e80d3426..1b1b12f53 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,58 +33,72 @@ @IRI("aas:Range") public class DefaultRange implements Range { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Range/max") + @IRI("https://admin-shell.io/aas/3/0/RC02/Range/max") protected String max; - @IRI("https://admin-shell.io/aas/3/0/Range/min") + @IRI("https://admin-shell.io/aas/3/0/RC02/Range/min") protected String min; - @IRI("https://admin-shell.io/aas/3/0/Range/valueType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Range/valueType") protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultRange() {} + public DefaultRange() { + + this.category = "VARIABLE"; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.valueType, + return Objects.hash(this.max, this.min, - this.max, + this.valueType, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -97,29 +111,31 @@ public boolean equals(Object obj) { return false; } else { DefaultRange other = (DefaultRange) obj; - return Objects.equals(this.valueType, other.valueType) && + return Objects.equals(this.max, other.max) && Objects.equals(this.min, other.min) && - Objects.equals(this.max, other.max) && + Objects.equals(this.valueType, other.valueType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @Override - public DataTypeDefXsd getValueType() { - return valueType; + public String getMax() { + return max; } @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; + public void setMax(String max) { + this.max = max; } @Override @@ -133,13 +149,13 @@ public void setMin(String min) { } @Override - public String getMax() { - return max; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setMax(String max) { - this.max = max; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override @@ -173,13 +189,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -193,33 +209,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -232,13 +258,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultRange (" + "valueType=%s," - + "min=%s," - + "max=%s," - + ")", - this.valueType, this.min, this.max); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java index 79d0f7a68..be3e718f9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,22 +35,24 @@ @IRI("aas:Reference") public class DefaultReference implements Reference { - @IRI("https://admin-shell.io/aas/3/0/Reference/keys") + @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/keys") protected List keys = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId") protected Reference referredSemanticId; - @IRI("https://admin-shell.io/aas/3/0/Reference/type") + @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/type") protected ReferenceTypes type; - public DefaultReference() {} + public DefaultReference() { + + } @Override public int hashCode() { - return Objects.hash(this.type, + return Objects.hash(this.keys, this.referredSemanticId, - this.keys); + this.type); } @Override @@ -63,20 +65,20 @@ public boolean equals(Object obj) { return false; } else { DefaultReference other = (DefaultReference) obj; - return Objects.equals(this.type, other.type) && + return Objects.equals(this.keys, other.keys) && Objects.equals(this.referredSemanticId, other.referredSemanticId) && - Objects.equals(this.keys, other.keys); + Objects.equals(this.type, other.type); } } @Override - public ReferenceTypes getType() { - return type; + public List getKeys() { + return keys; } @Override - public void setType(ReferenceTypes type) { - this.type = type; + public void setKeys(List keys) { + this.keys = keys; } @Override @@ -90,22 +92,13 @@ public void setReferredSemanticId(Reference referredSemanticId) { } @Override - public List getKeys() { - return keys; + public ReferenceTypes getType() { + return type; } @Override - public void setKeys(List keys) { - this.keys = keys; - } - - public String toString() { - return String.format( - "DefaultReference (" + "type=%s," - + "referredSemanticId=%s," - + "keys=%s," - + ")", - this.type, this.referredSemanticId, this.keys); + public void setType(ReferenceTypes type) { + this.type = type; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java index 032121dd0..23c2f26da 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,37 +34,49 @@ @IRI("aas:ReferenceElement") public class DefaultReferenceElement implements ReferenceElement { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/ReferenceElement/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") protected Reference value; - public DefaultReferenceElement() {} + public DefaultReferenceElement() { + + this.category = "VARIABLE"; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { @@ -72,12 +84,14 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -94,12 +108,14 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -144,13 +160,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -164,33 +180,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; } @Override - public List getDisplayNames() { - return displayNames; + public List getDescription() { + return description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public List getDescriptions() { - return descriptions; + public List getDisplayName() { + return displayName; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -203,11 +229,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultReferenceElement (" + "value=%s," - + ")", - this.value); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java index df41bf9e7..99361ba3c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,40 +34,50 @@ @IRI("aas:RelationshipElement") public class DefaultRelationshipElement implements RelationshipElement { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/first") + @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") protected Reference first; - @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") + @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") protected Reference second; - public DefaultRelationshipElement() {} + public DefaultRelationshipElement() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { @@ -76,12 +86,14 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -99,12 +111,14 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -159,13 +173,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -179,33 +193,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -218,12 +242,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultRelationshipElement (" + "first=%s," - + "second=%s," - + ")", - this.first, this.second); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java index fa28ac29e..ae673a6b6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,18 +32,20 @@ @IRI("aas:Resource") public class DefaultResource implements Resource { - @IRI("https://admin-shell.io/aas/3/0/Resource/contentType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") protected String contentType; - @IRI("https://admin-shell.io/aas/3/0/Resource/path") + @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/path") protected String path; - public DefaultResource() {} + public DefaultResource() { + + } @Override public int hashCode() { - return Objects.hash(this.path, - this.contentType); + return Objects.hash(this.contentType, + this.path); } @Override @@ -56,21 +58,11 @@ public boolean equals(Object obj) { return false; } else { DefaultResource other = (DefaultResource) obj; - return Objects.equals(this.path, other.path) && - Objects.equals(this.contentType, other.contentType); + return Objects.equals(this.contentType, other.contentType) && + Objects.equals(this.path, other.path); } } - @Override - public String getPath() { - return path; - } - - @Override - public void setPath(String path) { - this.path = path; - } - @Override public String getContentType() { return contentType; @@ -81,12 +73,14 @@ public void setContentType(String contentType) { this.contentType = contentType; } - public String toString() { - return String.format( - "DefaultResource (" + "path=%s," - + "contentType=%s," - + ")", - this.path, this.contentType); + @Override + public String getPath() { + return path; + } + + @Override + public void setPath(String path) { + this.path = path; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java new file mode 100644 index 000000000..a7ecb4299 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.SpecificAssetIdBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId + * + * A specific asset ID describes a generic supplementary identifying attribute of the asset. + */ + +@IRI("aas:SpecificAssetId") +public class DefaultSpecificAssetId implements SpecificAssetId { + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") + protected Reference externalSubjectId; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") + protected String name; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") + protected String value; + + public DefaultSpecificAssetId() { + + } + + @Override + public int hashCode() { + return Objects.hash(this.externalSubjectId, + this.name, + this.value, + this.semanticId, + this.supplementalSemanticIds); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultSpecificAssetId other = (DefaultSpecificAssetId) obj; + return Objects.equals(this.externalSubjectId, other.externalSubjectId) && + Objects.equals(this.name, other.name) && + Objects.equals(this.value, other.value) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); + } + } + + @Override + public Reference getExternalSubjectId() { + return externalSubjectId; + } + + @Override + public void setExternalSubjectId(Reference externalSubjectId) { + this.externalSubjectId = externalSubjectId; + } + + @Override + public String getName() { + return name; + } + + @Override + public void setName(String name) { + this.name = name; + } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + /** + * This builder class can be used to construct a DefaultSpecificAssetId bean. + */ + public static class Builder extends SpecificAssetIdBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultSpecificAssetId newBuildingInstance() { + return new DefaultSpecificAssetId(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java index 5ae55c885..a1e816feb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,61 +33,69 @@ @IRI("aas:Submodel") public class DefaultSubmodel implements Submodel { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasKind/kind") - protected ModellingKind kind; + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/Submodel/submodelElements") + @IRI("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements") protected List submodelElements = new ArrayList<>(); - public DefaultSubmodel() {} + public DefaultSubmodel() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { return Objects.hash(this.submodelElements, this.embeddedDataSpecifications, - this.kind, - this.semanticId, - this.supplementalSemanticIds, this.administration, this.id, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.kind, this.qualifiers); } @@ -103,16 +111,17 @@ public boolean equals(Object obj) { DefaultSubmodel other = (DefaultSubmodel) obj; return Objects.equals(this.submodelElements, other.submodelElements) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.kind, other.kind) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.qualifiers, other.qualifiers); } } @@ -138,63 +147,63 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public ModellingKind getKind() { - return kind; + public AdministrativeInformation getAdministration() { + return administration; } @Override - public void setKind(ModellingKind kind) { - this.kind = kind; + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; } @Override - public Reference getSemanticId() { - return semanticId; + public String getId() { + return id; } @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; + public void setId(String id) { + this.id = id; } @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; + public String getCategory() { + return category; } @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; + public void setCategory(String category) { + this.category = category; } @Override - public AdministrativeInformation getAdministration() { - return administration; + public String getChecksum() { + return checksum; } @Override - public void setAdministration(AdministrativeInformation administration) { - this.administration = administration; + public void setChecksum(String checksum) { + this.checksum = checksum; } @Override - public String getId() { - return id; + public List getDescription() { + return description; } @Override - public void setId(String id) { - this.id = id; + public void setDescription(List description) { + this.description = description; } @Override - public String getCategory() { - return category; + public List getDisplayName() { + return displayName; } @Override - public void setCategory(String category) { - this.category = category; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override @@ -208,33 +217,43 @@ public void setIdShort(String idShort) { } @Override - public List getDisplayNames() { - return displayNames; + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override - public List getDescriptions() { - return descriptions; + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; } @Override - public List getExtensions() { - return extensions; + public ModelingKind getKind() { + return kind; } @Override - public void setExtensions(List extensions) { - this.extensions = extensions; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -247,13 +266,6 @@ public void setQualifiers(List qualifiers) { this.qualifiers = qualifiers; } - public String toString() { - return String.format( - "DefaultSubmodel (" + "submodelElements=%s," - + ")", - this.submodelElements); - } - /** * This builder class can be used to construct a DefaultSubmodel bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java new file mode 100644 index 000000000..580519f78 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelDescriptorBuilder; + +@IRI("aas:SubmodelDescriptor") +public class DefaultSubmodelDescriptor implements SubmodelDescriptor { + + @IRI("https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints") + protected List endpoints = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/administration") + protected AdministrativeInformation administration; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description") + protected List description; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName") + protected List displayName; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification") + protected String identification; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId") + protected Reference semanticId; + + public DefaultSubmodelDescriptor() { + } + + @Override + public int hashCode() { + return Objects.hash(this.administration, + this.description, + this.displayName, + this.idShort, + this.identification, + this.semanticId, + this.endpoints); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultSubmodelDescriptor other = (DefaultSubmodelDescriptor) obj; + return Objects.equals(this.administration, other.administration) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.identification, other.identification) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.endpoints, other.endpoints); + } + } + + @Override + public AdministrativeInformation getAdministration() { + return administration; + } + + @Override + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public String getIdentification() { + return identification; + } + + @Override + public void setIdentification(String identification) { + this.identification = identification; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getEndpoints() { + return endpoints; + } + + @Override + public void setEndpoints(List endpoints) { + this.endpoints = endpoints; + } + + /** + * This builder class can be used to construct a DefaultSubmodelDescriptor bean. + */ + public static class Builder extends SubmodelDescriptorBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultSubmodelDescriptor newBuildingInstance() { + return new DefaultSubmodelDescriptor(); + } + } +} From 534bbec4acef754977aabb49f9687c25d5f3063f Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 30 Jun 2023 10:07:59 +0200 Subject: [PATCH 10/59] Update model project --- .../digitaltwin/aas4j/v3/model/Key.java | 16 +- .../digitaltwin/aas4j/v3/model/KeyTypes.java | 52 +++--- .../aas4j/v3/model/LangString.java | 33 ++++ .../digitaltwin/aas4j/v3/model/LevelType.java | 107 +++---------- .../{ModellingKind.java => ModelingKind.java} | 18 +-- .../aas4j/v3/model/MultiLanguageProperty.java | 24 +-- .../digitaltwin/aas4j/v3/model/Operation.java | 54 +++---- .../aas4j/v3/model/OperationVariable.java | 10 +- .../digitaltwin/aas4j/v3/model/Property.java | 54 +++---- .../aas4j/v3/model/ProtocolInformation.java | 135 ++++++++++++++++ .../aas4j/v3/model/Qualifiable.java | 10 +- .../digitaltwin/aas4j/v3/model/Qualifier.java | 66 ++++---- .../aas4j/v3/model/QualifierKind.java | 10 +- .../digitaltwin/aas4j/v3/model/Range.java | 46 +++--- .../digitaltwin/aas4j/v3/model/Referable.java | 89 +++++++---- .../digitaltwin/aas4j/v3/model/Reference.java | 46 +++--- .../aas4j/v3/model/ReferenceElement.java | 10 +- .../aas4j/v3/model/ReferenceTypes.java | 16 +- .../aas4j/v3/model/RelationshipElement.java | 16 +- .../digitaltwin/aas4j/v3/model/Resource.java | 40 ++--- .../aas4j/v3/model/SpecificAssetId.java | 89 +++++++++++ .../aas4j/v3/model/StateOfEvent.java | 8 +- .../digitaltwin/aas4j/v3/model/Submodel.java | 12 +- .../aas4j/v3/model/SubmodelDescriptor.java | 133 ++++++++++++++++ .../aas4j/v3/model/SubmodelElement.java | 10 +- .../v3/model/SubmodelElementCollection.java | 20 +-- .../aas4j/v3/model/SubmodelElementList.java | 64 ++++---- .../digitaltwin/aas4j/v3/model/ValueList.java | 10 +- .../aas4j/v3/model/ValueReferencePair.java | 20 +-- .../DefaultSubmodelElementCollection.java | 130 +++++++++------ .../impl/DefaultSubmodelElementList.java | 150 ++++++++++-------- .../aas4j/v3/model/impl/DefaultValueList.java | 13 +- .../model/impl/DefaultValueReferencePair.java | 20 +-- 33 files changed, 962 insertions(+), 569 deletions(-) create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java rename model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/{ModellingKind.java => ModelingKind.java} (64%) create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java index c91f83277..80ead008c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,17 +32,17 @@ public interface Key { /** * Denotes which kind of entity is referenced. * - * More information under https://admin-shell.io/aas/3/0/Key/type + * More information under https://admin-shell.io/aas/3/0/RC02/Key/type * * @return Returns the KeyTypes for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/Key/type") + @IRI("https://admin-shell.io/aas/3/0/RC02/Key/type") KeyTypes getType(); /** * Denotes which kind of entity is referenced. * - * More information under https://admin-shell.io/aas/3/0/Key/type + * More information under https://admin-shell.io/aas/3/0/RC02/Key/type * * @param type desired value for the property type. */ @@ -51,17 +51,17 @@ public interface Key { /** * The key value, for example an IRDI or an URI * - * More information under https://admin-shell.io/aas/3/0/Key/value + * More information under https://admin-shell.io/aas/3/0/RC02/Key/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/Key/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Key/value") String getValue(); /** * The key value, for example an IRDI or an URI * - * More information under https://admin-shell.io/aas/3/0/Key/value + * More information under https://admin-shell.io/aas/3/0/RC02/Key/value * * @param value desired value for the property value. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java index fd44ac144..5e6cec41e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,133 +28,133 @@ public enum KeyTypes { /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/AnnotatedRelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/AnnotatedRelationshipElement") ANNOTATED_RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/AssetAdministrationShell") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/AssetAdministrationShell") ASSET_ADMINISTRATION_SHELL, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/BasicEventElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/BasicEventElement") BASIC_EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Blob") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Blob") BLOB, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Capability") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Capability") CAPABILITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/ConceptDescription") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/ConceptDescription") CONCEPT_DESCRIPTION, /** * Data element. */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/DataElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/DataElement") DATA_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Entity") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Entity") ENTITY, /** * Event. */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/EventElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/EventElement") EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/File") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/File") FILE, /** * Bookmark or a similar local identifier of a subordinate part of a primary resource */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/FragmentReference") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/FragmentReference") FRAGMENT_REFERENCE, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/GlobalReference") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/GlobalReference") GLOBAL_REFERENCE, /** * Identifiable. */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Identifiable") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Identifiable") IDENTIFIABLE, /** * Property with a value that can be provided in multiple languages */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/MultiLanguageProperty") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/MultiLanguageProperty") MULTI_LANGUAGE_PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Operation") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Operation") OPERATION, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Property") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Property") PROPERTY, /** * Range with min and max */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Range") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Range") RANGE, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Referable") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Referable") REFERABLE, /** * Reference */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/ReferenceElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/ReferenceElement") REFERENCE_ELEMENT, /** * Relationship */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/RelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/RelationshipElement") RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Submodel") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Submodel") SUBMODEL, /** * Submodel Element */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/SubmodelElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/SubmodelElement") SUBMODEL_ELEMENT, /** * Struct of Submodel Elements */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/SubmodelElementCollection") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/SubmodelElementCollection") SUBMODEL_ELEMENT_COLLECTION, /** * List of Submodel Elements */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/SubmodelElementList") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/SubmodelElementList") SUBMODEL_ELEMENT_LIST; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java new file mode 100644 index 000000000..9d374c663 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + +import java.io.Serializable; + + +@IRI("rdf:langString") +public interface LangString extends Serializable { + + public String getLanguage(); + + public void setLanguage(String language); + + public String getText(); + + public void setText(String text); +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java index df6a1ac15..e3ab34e5f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -16,94 +16,33 @@ package org.eclipse.digitaltwin.aas4j.v3.model; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLevelType; - -/** - * Value represented by up to four variants of a numeric value in a specific role: MIN, NOM, TYP and - * MAX. True means that the value is available, false means the value is not available. - */ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultLevelType.class) -}) -public interface LevelType { - - /** - * Minimum of the value - * - * More information under https://admin-shell.io/aas/3/0/LevelType/min - * - * @return Returns the boolean for the property min. - */ - @IRI("https://admin-shell.io/aas/3/0/LevelType/min") - boolean getMin(); - - /** - * Minimum of the value - * - * More information under https://admin-shell.io/aas/3/0/LevelType/min - * - * @param min desired value for the property min. - */ - void setMin(boolean min); +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - /** - * Nominal value (value as designated) - * - * More information under https://admin-shell.io/aas/3/0/LevelType/nom - * - * @return Returns the boolean for the property nom. - */ - @IRI("https://admin-shell.io/aas/3/0/LevelType/nom") - boolean getNom(); - /** - * Nominal value (value as designated) - * - * More information under https://admin-shell.io/aas/3/0/LevelType/nom - * - * @param nom desired value for the property nom. - */ - void setNom(boolean nom); +/** +*/ +@IRI("aas:LevelType") +public enum LevelType { - /** - * Value as typically present - * - * More information under https://admin-shell.io/aas/3/0/LevelType/typ - * - * @return Returns the boolean for the property typ. - */ - @IRI("https://admin-shell.io/aas/3/0/LevelType/typ") - boolean getTyp(); + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Max") + MAX, - /** - * Value as typically present - * - * More information under https://admin-shell.io/aas/3/0/LevelType/typ - * - * @param typ desired value for the property typ. - */ - void setTyp(boolean typ); + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Min") + MIN, - /** - * Maximum of the value - * - * More information under https://admin-shell.io/aas/3/0/LevelType/max - * - * @return Returns the boolean for the property max. - */ - @IRI("https://admin-shell.io/aas/3/0/LevelType/max") - boolean getMax(); + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Nom") + NOM, - /** - * Maximum of the value - * - * More information under https://admin-shell.io/aas/3/0/LevelType/max - * - * @param max desired value for the property max. - */ - void setMax(boolean max); + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Typ") + TYP; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java similarity index 64% rename from model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java rename to model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java index 50aba3530..a0e26f775 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,21 +23,19 @@ /** * Enumeration for denoting whether an element is a template or an instance. */ -@IRI("aas:ModellingKind") -public enum ModellingKind { +@IRI("aas:ModelingKind") +public enum ModelingKind { /** - * Concrete, clearly identifiable element instance. Its creation and validation may be guided by a - * corresponding element template. + * Concrete, clearly identifiable component of a certain template. */ - @IRI("https://admin-shell.io/aas/3/0/ModellingKind/Instance") + @IRI("https://admin-shell.io/aas/3/0/RC02/ModelingKind/Instance") INSTANCE, /** - * Specification of the common features of a structured element in sufficient detail that such a - * instance can be instantiated using it + * Software element which specifies the common attributes shared by all instances of the template. */ - @IRI("https://admin-shell.io/aas/3/0/ModellingKind/Template") + @IRI("https://admin-shell.io/aas/3/0/RC02/ModelingKind/Template") TEMPLATE; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java index d828bec39..3ab965e2d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,36 +33,36 @@ public interface MultiLanguageProperty extends DataElement { /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/value + * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value * - * @return Returns the List of LangStringTextTypes for the property values. + * @return Returns the List of LangStrings for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/value") - List getValues(); + @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") + List getValue(); /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/value + * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value * - * @param values desired value for the property values. + * @param value desired value for the property value. */ - void setValues(List values); + void setValue(List value); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId * * @param valueId desired value for the property valueId. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java index 17a2ea927..4ba439e71 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,20 +30,39 @@ }) public interface Operation extends SubmodelElement { + /** + * Parameter that is input and output of the operation. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables + * + * @return Returns the List of OperationVariables for the property inoutputVariables. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables") + List getInoutputVariables(); + + /** + * Parameter that is input and output of the operation. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables + * + * @param inoutputVariables desired value for the property inoutputVariables. + */ + void setInoutputVariables(List inoutputVariables); + /** * Input parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/Operation/inputVariables + * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables * * @return Returns the List of OperationVariables for the property inputVariables. */ - @IRI("https://admin-shell.io/aas/3/0/Operation/inputVariables") + @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables") List getInputVariables(); /** * Input parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/Operation/inputVariables + * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables * * @param inputVariables desired value for the property inputVariables. */ @@ -52,39 +71,20 @@ public interface Operation extends SubmodelElement { /** * Output parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/Operation/outputVariables + * More information under https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables * * @return Returns the List of OperationVariables for the property outputVariables. */ - @IRI("https://admin-shell.io/aas/3/0/Operation/outputVariables") + @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables") List getOutputVariables(); /** * Output parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/Operation/outputVariables + * More information under https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables * * @param outputVariables desired value for the property outputVariables. */ void setOutputVariables(List outputVariables); - /** - * Parameter that is input and output of the operation. - * - * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables - * - * @return Returns the List of OperationVariables for the property inoutputVariables. - */ - @IRI("https://admin-shell.io/aas/3/0/Operation/inoutputVariables") - List getInoutputVariables(); - - /** - * Parameter that is input and output of the operation. - * - * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables - * - * @param inoutputVariables desired value for the property inoutputVariables. - */ - void setInoutputVariables(List inoutputVariables); - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java index d62fa0440..2975e42e9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface OperationVariable { /** * Describes an argument or result of an operation via a submodel element * - * More information under https://admin-shell.io/aas/3/0/OperationVariable/value + * More information under https://admin-shell.io/aas/3/0/RC02/OperationVariable/value * * @return Returns the SubmodelElement for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/OperationVariable/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") SubmodelElement getValue(); /** * Describes an argument or result of an operation via a submodel element * - * More information under https://admin-shell.io/aas/3/0/OperationVariable/value + * More information under https://admin-shell.io/aas/3/0/RC02/OperationVariable/value * * @param value desired value for the property value. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java index 7df12e7ef..b937792da 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,39 +29,20 @@ }) public interface Property extends DataElement { - /** - * Data type of the value - * - * More information under https://admin-shell.io/aas/3/0/Property/valueType - * - * @return Returns the DataTypeDefXsd for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/Property/valueType") - DataTypeDefXsd getValueType(); - - /** - * Data type of the value - * - * More information under https://admin-shell.io/aas/3/0/Property/valueType - * - * @param valueType desired value for the property valueType. - */ - void setValueType(DataTypeDefXsd valueType); - /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/Property/value + * More information under https://admin-shell.io/aas/3/0/RC02/Property/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/Property/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Property/value") String getValue(); /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/Property/value + * More information under https://admin-shell.io/aas/3/0/RC02/Property/value * * @param value desired value for the property value. */ @@ -70,20 +51,39 @@ public interface Property extends DataElement { /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Property/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/Property/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueId") Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Property/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueId * * @param valueId desired value for the property valueId. */ void setValueId(Reference valueId); + /** + * Data type of the value + * + * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueType") + DataTypeDefXsd getValueType(); + + /** + * Data type of the value + * + * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java new file mode 100644 index 000000000..8b4527f69 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultProtocolInformation.class) +}) +public interface ProtocolInformation { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointAddress + * + * @return Returns the String for the property endpointAddress. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointAddress") + String getEndpointAddress(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointAddress + * + * @param endpointAddress desired value for the property endpointAddress. + */ + void setEndpointAddress(String endpointAddress); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol + * + * @return Returns the String for the property endpointProtocol. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol") + String getEndpointProtocol(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol + * + * @param endpointProtocol desired value for the property endpointProtocol. + */ + void setEndpointProtocol(String endpointProtocol); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion + * + * @return Returns the String for the property endpointProtocolVersion. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion") + String getEndpointProtocolVersion(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion + * + * @param endpointProtocolVersion desired value for the property endpointProtocolVersion. + */ + void setEndpointProtocolVersion(String endpointProtocolVersion); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol + * + * @return Returns the String for the property subprotocol. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol") + String getSubprotocol(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol + * + * @param subprotocol desired value for the property subprotocol. + */ + void setSubprotocol(String subprotocol); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBody + * + * @return Returns the String for the property subprotocolBody. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBody") + String getSubprotocolBody(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBody + * + * @param subprotocolBody desired value for the property subprotocolBody. + */ + void setSubprotocolBody(String subprotocolBody); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBodyEncoding + * + * @return Returns the String for the property subprotocolBodyEncoding. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBodyEncoding") + String getSubprotocolBodyEncoding(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBodyEncoding + * + * @param subprotocolBodyEncoding desired value for the property subprotocolBodyEncoding. + */ + void setSubprotocolBodyEncoding(String subprotocolBodyEncoding); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java index da02ca695..6e4389d84 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface Qualifiable { /** * Additional qualification of a qualifiable element. * - * More information under https://admin-shell.io/aas/3/0/Qualifiable/qualifiers + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers * * @return Returns the List of Qualifiers for the property qualifiers. */ - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") List getQualifiers(); /** * Additional qualification of a qualifiable element. * - * More information under https://admin-shell.io/aas/3/0/Qualifiable/qualifiers + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers * * @param qualifiers desired value for the property qualifiers. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java index 624d79ff3..3f2063d97 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface Qualifier extends HasSemantics { /** * The qualifier kind describes the kind of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/kind + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/kind * * @return Returns the QualifierKind for the property kind. */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/kind") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/kind") QualifierKind getKind(); /** * The qualifier kind describes the kind of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/kind + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/kind * * @param kind desired value for the property kind. */ @@ -52,55 +52,36 @@ public interface Qualifier extends HasSemantics { /** * The qualifier type describes the type of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/type + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/type * * @return Returns the String for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/type") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") String getType(); /** * The qualifier type describes the type of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/type + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/type * * @param type desired value for the property type. */ void setType(String type); - /** - * Data type of the qualifier value. - * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType - * - * @return Returns the DataTypeDefXsd for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") - DataTypeDefXsd getValueType(); - - /** - * Data type of the qualifier value. - * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType - * - * @param valueType desired value for the property valueType. - */ - void setValueType(DataTypeDefXsd valueType); - /** * The qualifier value is the value of the qualifier. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/value + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") String getValue(); /** * The qualifier value is the value of the qualifier. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/value + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/value * * @param value desired value for the property value. */ @@ -109,20 +90,39 @@ public interface Qualifier extends HasSemantics { /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId * * @param valueId desired value for the property valueId. */ void setValueId(Reference valueId); + /** + * Data type of the qualifier value. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") + DataTypeDefXsd getValueType(); + + /** + * Data type of the qualifier value. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java index 844a14308..3919791a2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,19 +29,19 @@ public enum QualifierKind { /** * qualifies the semantic definition the element is referring to ('semanticId') */ - @IRI("https://admin-shell.io/aas/3/0/QualifierKind/ConceptQualifier") + @IRI("https://admin-shell.io/aas/3/0/RC02/QualifierKind/ConceptQualifier") CONCEPT_QUALIFIER, /** * qualifies the elements within a specific submodel on concept level. */ - @IRI("https://admin-shell.io/aas/3/0/QualifierKind/TemplateQualifier") + @IRI("https://admin-shell.io/aas/3/0/RC02/QualifierKind/TemplateQualifier") TEMPLATE_QUALIFIER, /** * qualifies the value of the element and can change during run-time. */ - @IRI("https://admin-shell.io/aas/3/0/QualifierKind/ValueQualifier") + @IRI("https://admin-shell.io/aas/3/0/RC02/QualifierKind/ValueQualifier") VALUE_QUALIFIER; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java index 1ff17790c..26b1b0c6e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,60 +30,60 @@ public interface Range extends DataElement { /** - * Data type of the min und max + * The maximum value of the range. * - * More information under https://admin-shell.io/aas/3/0/Range/valueType + * More information under https://admin-shell.io/aas/3/0/RC02/Range/max * - * @return Returns the DataTypeDefXsd for the property valueType. + * @return Returns the String for the property max. */ - @IRI("https://admin-shell.io/aas/3/0/Range/valueType") - DataTypeDefXsd getValueType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Range/max") + String getMax(); /** - * Data type of the min und max + * The maximum value of the range. * - * More information under https://admin-shell.io/aas/3/0/Range/valueType + * More information under https://admin-shell.io/aas/3/0/RC02/Range/max * - * @param valueType desired value for the property valueType. + * @param max desired value for the property max. */ - void setValueType(DataTypeDefXsd valueType); + void setMax(String max); /** * The minimum value of the range. * - * More information under https://admin-shell.io/aas/3/0/Range/min + * More information under https://admin-shell.io/aas/3/0/RC02/Range/min * * @return Returns the String for the property min. */ - @IRI("https://admin-shell.io/aas/3/0/Range/min") + @IRI("https://admin-shell.io/aas/3/0/RC02/Range/min") String getMin(); /** * The minimum value of the range. * - * More information under https://admin-shell.io/aas/3/0/Range/min + * More information under https://admin-shell.io/aas/3/0/RC02/Range/min * * @param min desired value for the property min. */ void setMin(String min); /** - * The maximum value of the range. + * Data type of the min und max * - * More information under https://admin-shell.io/aas/3/0/Range/max + * More information under https://admin-shell.io/aas/3/0/RC02/Range/valueType * - * @return Returns the String for the property max. + * @return Returns the DataTypeDefXsd for the property valueType. */ - @IRI("https://admin-shell.io/aas/3/0/Range/max") - String getMax(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Range/valueType") + DataTypeDefXsd getValueType(); /** - * The maximum value of the range. + * Data type of the min und max * - * More information under https://admin-shell.io/aas/3/0/Range/max + * More information under https://admin-shell.io/aas/3/0/RC02/Range/valueType * - * @param max desired value for the property max. + * @param valueType desired value for the property valueType. */ - void setMax(String max); + void setValueType(DataTypeDefXsd valueType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java index f85391a54..87346d826 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -25,8 +25,8 @@ * An element that is referable by its 'idShort'. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = SubmodelElement.class), - @KnownSubtypes.Type(value = Identifiable.class) + @KnownSubtypes.Type(value = Identifiable.class), + @KnownSubtypes.Type(value = SubmodelElement.class) }) public interface Referable extends HasExtensions { @@ -34,80 +34,101 @@ public interface Referable extends HasExtensions { * The category is a value that gives further meta information w.r.t. to the class of the element. * It affects the expected existence of attributes and the applicability of constraints. * - * More information under https://admin-shell.io/aas/3/0/Referable/category + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/category * * @return Returns the String for the property category. */ - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") String getCategory(); /** * The category is a value that gives further meta information w.r.t. to the class of the element. * It affects the expected existence of attributes and the applicability of constraints. * - * More information under https://admin-shell.io/aas/3/0/Referable/category + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/category * * @param category desired value for the property category. */ void setCategory(String category); /** - * In case of identifiables this attribute is a short name of the element. In case of referable this - * ID is an identifying string of the element within its name space. + * Checksum to be used to determine if an Referable (including its aggregated child elements) has + * changed. * - * More information under https://admin-shell.io/aas/3/0/Referable/idShort + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/checksum * - * @return Returns the String for the property idShort. + * @return Returns the String for the property checksum. */ - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - String getIdShort(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + String getChecksum(); /** - * In case of identifiables this attribute is a short name of the element. In case of referable this - * ID is an identifying string of the element within its name space. + * Checksum to be used to determine if an Referable (including its aggregated child elements) has + * changed. * - * More information under https://admin-shell.io/aas/3/0/Referable/idShort + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/checksum * - * @param idShort desired value for the property idShort. + * @param checksum desired value for the property checksum. */ - void setIdShort(String idShort); + void setChecksum(String checksum); + + /** + * Description or comments on the element. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/description + * + * @return Returns the List of LangStrings for the property description. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + List getDescription(); + + /** + * Description or comments on the element. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/description + * + * @param description desired value for the property description. + */ + void setDescription(List description); /** * Display name. Can be provided in several languages. * - * More information under https://admin-shell.io/aas/3/0/Referable/displayName + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/displayName * - * @return Returns the List of LangStringNameTypes for the property displayNames. + * @return Returns the List of LangStrings for the property displayName. */ - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - List getDisplayNames(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + List getDisplayName(); /** * Display name. Can be provided in several languages. * - * More information under https://admin-shell.io/aas/3/0/Referable/displayName + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/displayName * - * @param displayNames desired value for the property displayNames. + * @param displayName desired value for the property displayName. */ - void setDisplayNames(List displayNames); + void setDisplayName(List displayName); /** - * Description or comments on the element. + * In case of identifiables this attribute is a short name of the element. In case of referable this + * ID is an identifying string of the element within its name space. * - * More information under https://admin-shell.io/aas/3/0/Referable/description + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/idShort * - * @return Returns the List of LangStringTextTypes for the property descriptions. + * @return Returns the String for the property idShort. */ - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - List getDescriptions(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + String getIdShort(); /** - * Description or comments on the element. + * In case of identifiables this attribute is a short name of the element. In case of referable this + * ID is an identifying string of the element within its name space. * - * More information under https://admin-shell.io/aas/3/0/Referable/description + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/idShort * - * @param descriptions desired value for the property descriptions. + * @param idShort desired value for the property idShort. */ - void setDescriptions(List descriptions); + void setIdShort(String idShort); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java index 2aa779da6..8575d95e8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,60 +31,60 @@ public interface Reference { /** - * Type of the reference. + * Unique references in their name space. * - * More information under https://admin-shell.io/aas/3/0/Reference/type + * More information under https://admin-shell.io/aas/3/0/RC02/Reference/keys * - * @return Returns the ReferenceTypes for the property type. + * @return Returns the List of Keys for the property keys. */ - @IRI("https://admin-shell.io/aas/3/0/Reference/type") - ReferenceTypes getType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/keys") + List getKeys(); /** - * Type of the reference. + * Unique references in their name space. * - * More information under https://admin-shell.io/aas/3/0/Reference/type + * More information under https://admin-shell.io/aas/3/0/RC02/Reference/keys * - * @param type desired value for the property type. + * @param keys desired value for the property keys. */ - void setType(ReferenceTypes type); + void setKeys(List keys); /** * 'semanticId' of the referenced model element ('type' = 'ModelReference'). * - * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticId + * More information under https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId * * @return Returns the Reference for the property referredSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId") Reference getReferredSemanticId(); /** * 'semanticId' of the referenced model element ('type' = 'ModelReference'). * - * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticId + * More information under https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId * * @param referredSemanticId desired value for the property referredSemanticId. */ void setReferredSemanticId(Reference referredSemanticId); /** - * Unique references in their name space. + * Type of the reference. * - * More information under https://admin-shell.io/aas/3/0/Reference/keys + * More information under https://admin-shell.io/aas/3/0/RC02/Reference/type * - * @return Returns the List of Keys for the property keys. + * @return Returns the ReferenceTypes for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/Reference/keys") - List getKeys(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/type") + ReferenceTypes getType(); /** - * Unique references in their name space. + * Type of the reference. * - * More information under https://admin-shell.io/aas/3/0/Reference/keys + * More information under https://admin-shell.io/aas/3/0/RC02/Reference/type * - * @param keys desired value for the property keys. + * @param type desired value for the property type. */ - void setKeys(List keys); + void setType(ReferenceTypes type); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java index 95fe8bd7e..cd13ceb32 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,18 +34,18 @@ public interface ReferenceElement extends DataElement { * Global reference to an external object or entity or a logical reference to another element within * the same or another AAS (i.e. a model reference to a Referable). * - * More information under https://admin-shell.io/aas/3/0/ReferenceElement/value + * More information under https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value * * @return Returns the Reference for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/ReferenceElement/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") Reference getValue(); /** * Global reference to an external object or entity or a logical reference to another element within * the same or another AAS (i.e. a model reference to a Referable). * - * More information under https://admin-shell.io/aas/3/0/ReferenceElement/value + * More information under https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value * * @param value desired value for the property value. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java index 305a50ee9..fa65393f9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -21,21 +21,21 @@ /** - * Reference types + * ReferenceTypes */ @IRI("aas:ReferenceTypes") public enum ReferenceTypes { /** - * External reference. + * GlobalReference. */ - @IRI("https://admin-shell.io/aas/3/0/ReferenceTypes/ExternalReference") - EXTERNAL_REFERENCE, + @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceTypes/GlobalReference") + GLOBAL_REFERENCE, /** - * Model reference. + * ModelReference */ - @IRI("https://admin-shell.io/aas/3/0/ReferenceTypes/ModelReference") + @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceTypes/ModelReference") MODEL_REFERENCE; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java index 4caefc472..e2ffe5b1d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,17 +34,17 @@ public interface RelationshipElement extends SubmodelElement { /** * Reference to the first element in the relationship taking the role of the subject. * - * More information under https://admin-shell.io/aas/3/0/RelationshipElement/first + * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first * * @return Returns the Reference for the property first. */ - @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/first") + @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") Reference getFirst(); /** * Reference to the first element in the relationship taking the role of the subject. * - * More information under https://admin-shell.io/aas/3/0/RelationshipElement/first + * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first * * @param first desired value for the property first. */ @@ -53,17 +53,17 @@ public interface RelationshipElement extends SubmodelElement { /** * Reference to the second element in the relationship taking the role of the object. * - * More information under https://admin-shell.io/aas/3/0/RelationshipElement/second + * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second * * @return Returns the Reference for the property second. */ - @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") + @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") Reference getSecond(); /** * Reference to the second element in the relationship taking the role of the object. * - * More information under https://admin-shell.io/aas/3/0/RelationshipElement/second + * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second * * @param second desired value for the property second. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java index 5c01c0149..ac9f59ae6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,41 +31,41 @@ public interface Resource { /** - * Path and name of the resource (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/Resource/path + * More information under https://admin-shell.io/aas/3/0/RC02/Resource/contentType * - * @return Returns the String for the property path. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/Resource/path") - String getPath(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") + String getContentType(); /** - * Path and name of the resource (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/Resource/path + * More information under https://admin-shell.io/aas/3/0/RC02/Resource/contentType * - * @param path desired value for the property path. + * @param contentType desired value for the property contentType. */ - void setPath(String path); + void setContentType(String contentType); /** - * Content type of the content of the file. + * Path and name of the resource (with file extension). * - * More information under https://admin-shell.io/aas/3/0/Resource/contentType + * More information under https://admin-shell.io/aas/3/0/RC02/Resource/path * - * @return Returns the String for the property contentType. + * @return Returns the String for the property path. */ - @IRI("https://admin-shell.io/aas/3/0/Resource/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/path") + String getPath(); /** - * Content type of the content of the file. + * Path and name of the resource (with file extension). * - * More information under https://admin-shell.io/aas/3/0/Resource/contentType + * More information under https://admin-shell.io/aas/3/0/RC02/Resource/path * - * @param contentType desired value for the property contentType. + * @param path desired value for the property path. */ - void setContentType(String contentType); + void setPath(String path); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java new file mode 100644 index 000000000..6c54d5d28 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; + + +/** + * A specific asset ID describes a generic supplementary identifying attribute of the asset. + */ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultSpecificAssetId.class) +}) +public interface SpecificAssetId extends HasSemantics { + + /** + * The (external) subject the key belongs to or has meaning to. + * + * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId + * + * @return Returns the Reference for the property externalSubjectId. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") + Reference getExternalSubjectId(); + + /** + * The (external) subject the key belongs to or has meaning to. + * + * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId + * + * @param externalSubjectId desired value for the property externalSubjectId. + */ + void setExternalSubjectId(Reference externalSubjectId); + + /** + * Name of the identifier + * + * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name + * + * @return Returns the String for the property name. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") + String getName(); + + /** + * Name of the identifier + * + * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name + * + * @param name desired value for the property name. + */ + void setName(String name); + + /** + * The value of the specific asset identifier with the corresponding name. + * + * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value + * + * @return Returns the String for the property value. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") + String getValue(); + + /** + * The value of the specific asset identifier with the corresponding name. + * + * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value + * + * @param value desired value for the property value. + */ + void setValue(String value); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java index c976edd7a..a52edcf60 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,13 +29,13 @@ public enum StateOfEvent { /** * Event is off. */ - @IRI("https://admin-shell.io/aas/3/0/StateOfEvent/Off") + @IRI("https://admin-shell.io/aas/3/0/RC02/StateOfEvent/Off") OFF, /** * Event is on */ - @IRI("https://admin-shell.io/aas/3/0/StateOfEvent/On") + @IRI("https://admin-shell.io/aas/3/0/RC02/StateOfEvent/On") ON; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java index eeffb4150..12789fff0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,22 +28,22 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultSubmodel.class) }) -public interface Submodel extends HasDataSpecification, HasKind, HasSemantics, Identifiable, Qualifiable { +public interface Submodel extends HasDataSpecification, Identifiable, HasSemantics, HasKind, Qualifiable { /** * A submodel consists of zero or more submodel elements. * - * More information under https://admin-shell.io/aas/3/0/Submodel/submodelElements + * More information under https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements * * @return Returns the List of SubmodelElements for the property submodelElements. */ - @IRI("https://admin-shell.io/aas/3/0/Submodel/submodelElements") + @IRI("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements") List getSubmodelElements(); /** * A submodel consists of zero or more submodel elements. * - * More information under https://admin-shell.io/aas/3/0/Submodel/submodelElements + * More information under https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements * * @param submodelElements desired value for the property submodelElements. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java new file mode 100644 index 000000000..83a51cfb4 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; + +import java.util.List; + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultSubmodelDescriptor.class) +}) +public interface SubmodelDescriptor extends Descriptor { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/administration + * + * @return Returns the AdministrativeInformation for the property administration. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/administration") + AdministrativeInformation getAdministration(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/administration + * + * @param administration desired value for the property administration. + */ + void setAdministration(AdministrativeInformation administration); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description + * + * @return Returns the LangStringSet for the property description. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description") + List getDescription(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description + * + * @param description desired value for the property description. + */ + void setDescription(List description); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName + * + * @return Returns the LangStringSet for the property displayName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName") + List getDisplayName(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName + * + * @param displayName desired value for the property displayName. + */ + void setDisplayName(List displayName); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort + * + * @return Returns the String for the property idShort. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort") + String getIdShort(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort + * + * @param idShort desired value for the property idShort. + */ + void setIdShort(String idShort); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification + * + * @return Returns the String for the property identification. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification") + String getIdentification(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification + * + * @param identification desired value for the property identification. + */ + void setIdentification(String identification); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId + * + * @return Returns the Reference for the property semanticId. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId") + Reference getSemanticId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId + * + * @param semanticId desired value for the property semanticId. + */ + void setSemanticId(Reference semanticId); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java index c18a4f6bb..d864c6344 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,15 +24,15 @@ * A submodel element is an element suitable for the description and differentiation of assets. */ @KnownSubtypes({ + @KnownSubtypes.Type(value = RelationshipElement.class), @KnownSubtypes.Type(value = DataElement.class), + @KnownSubtypes.Type(value = EventElement.class), @KnownSubtypes.Type(value = Capability.class), @KnownSubtypes.Type(value = Entity.class), - @KnownSubtypes.Type(value = EventElement.class), @KnownSubtypes.Type(value = Operation.class), - @KnownSubtypes.Type(value = RelationshipElement.class), @KnownSubtypes.Type(value = SubmodelElementCollection.class), @KnownSubtypes.Type(value = SubmodelElementList.class) }) -public interface SubmodelElement extends HasDataSpecification, HasSemantics, Qualifiable, Referable { +public interface SubmodelElement extends HasDataSpecification, HasSemantics, HasKind, Referable, Qualifiable { } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java index 67c357f26..7a913462d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -19,7 +19,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import java.util.List; +import java.util.Collection; /** @@ -34,20 +34,20 @@ public interface SubmodelElementCollection extends SubmodelElement { /** * Submodel element contained in the collection. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementCollection/value + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value * - * @return Returns the List of SubmodelElements for the property values. + * @return Returns the Collection of SubmodelElements for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementCollection/value") - List getValues(); + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") + Collection getValue(); /** * Submodel element contained in the collection. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementCollection/value + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value * - * @param values desired value for the property values. + * @param value desired value for the property value. */ - void setValues(List values); + void setValue(Collection value); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java index 7d5895e6e..34d62ee6c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,18 +34,18 @@ public interface SubmodelElementList extends SubmodelElement { * Defines whether order in list is relevant. If 'orderRelevant' = False then the list is * representing a set or a bag. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant * * @return Returns the boolean for the property orderRelevant. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") boolean getOrderRelevant(); /** * Defines whether order in list is relevant. If 'orderRelevant' = False then the list is * representing a set or a bag. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant * * @param orderRelevant desired value for the property orderRelevant. */ @@ -54,17 +54,19 @@ public interface SubmodelElementList extends SubmodelElement { /** * Semantic ID the submodel elements contained in the list match to. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement + * More information under + * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement * * @return Returns the Reference for the property semanticIdListElement. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") Reference getSemanticIdListElement(); /** * Semantic ID the submodel elements contained in the list match to. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement + * More information under + * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement * * @param semanticIdListElement desired value for the property semanticIdListElement. */ @@ -73,58 +75,62 @@ public interface SubmodelElementList extends SubmodelElement { /** * The submodel element type of the submodel elements contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement + * More information under + * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement * * @return Returns the AasSubmodelElements for the property typeValueListElement. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") AasSubmodelElements getTypeValueListElement(); /** * The submodel element type of the submodel elements contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement + * More information under + * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement * * @param typeValueListElement desired value for the property typeValueListElement. */ void setTypeValueListElement(AasSubmodelElements typeValueListElement); /** - * The value type of the submodel element contained in the list. + * Submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value * - * @return Returns the DataTypeDefXsd for the property valueTypeListElement. + * @return Returns the List of SubmodelElements for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") - DataTypeDefXsd getValueTypeListElement(); + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") + List getValue(); /** - * The value type of the submodel element contained in the list. + * Submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value * - * @param valueTypeListElement desired value for the property valueTypeListElement. + * @param value desired value for the property value. */ - void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); + void setValue(List value); /** - * Submodel element contained in the list. + * The value type of the submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value + * More information under + * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement * - * @return Returns the List of SubmodelElements for the property values. + * @return Returns the DataTypeDefXsd for the property valueTypeListElement. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") - List getValues(); + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") + DataTypeDefXsd getValueTypeListElement(); /** - * Submodel element contained in the list. + * The value type of the submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value + * More information under + * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement * - * @param values desired value for the property values. + * @param valueTypeListElement desired value for the property valueTypeListElement. */ - void setValues(List values); + void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java index d5e66885c..cc89c5dcc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface ValueList { /** * A pair of a value together with its global unique id. * - * More information under https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs + * More information under https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs * * @return Returns the List of ValueReferencePairs for the property valueReferencePairs. */ - @IRI("https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs") + @IRI("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") List getValueReferencePairs(); /** * A pair of a value together with its global unique id. * - * More information under https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs + * More information under https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs * * @param valueReferencePairs desired value for the property valueReferencePairs. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java index 426ff7b51..3f6b6dcf2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,19 +31,19 @@ public interface ValueReferencePair { /** - * The value of the referenced concept definition of the value in 'valueId'. + * The value of the referenced concept definition of the value in valueId. * - * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/value + * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") String getValue(); /** - * The value of the referenced concept definition of the value in 'valueId'. + * The value of the referenced concept definition of the value in valueId. * - * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/value + * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value * * @param value desired value for the property value. */ @@ -52,17 +52,17 @@ public interface ValueReferencePair { /** * Global unique id of the value. * - * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") Reference getValueId(); /** * Global unique id of the value. * - * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId * * @param valueId desired value for the property valueId. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java index e321cce9a..5713fbe6b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,6 +20,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelElementCollectionBuilder; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Objects; @@ -35,50 +36,62 @@ @IRI("aas:SubmodelElementCollection") public class DefaultSubmodelElementCollection implements SubmodelElementCollection { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementCollection/value") - protected List values = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") + protected Collection value = new ArrayList<>(); + + public DefaultSubmodelElementCollection() { - public DefaultSubmodelElementCollection() {} + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.values, + return Objects.hash(this.value, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -91,27 +104,29 @@ public boolean equals(Object obj) { return false; } else { DefaultSubmodelElementCollection other = (DefaultSubmodelElementCollection) obj; - return Objects.equals(this.values, other.values) && + return Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @Override - public List getValues() { - return values; + public Collection getValue() { + return value; } @Override - public void setValues(List values) { - this.values = values; + public void setValue(Collection value) { + this.value = value; } @Override @@ -145,13 +160,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -165,33 +180,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -204,11 +229,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultSubmodelElementCollection (" + "values=%s," - + ")", - this.values); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java index bf6140f48..d81d64b4d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,66 +33,79 @@ @IRI("aas:SubmodelElementList") public class DefaultSubmodelElementList implements SubmodelElementList { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") protected boolean orderRelevant; - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") protected Reference semanticIdListElement; - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") protected AasSubmodelElements typeValueListElement; - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") - protected List values = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") + protected List value = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") protected DataTypeDefXsd valueTypeListElement; - public DefaultSubmodelElementList() {} + public DefaultSubmodelElementList() { + this.orderRelevant = Boolean.TRUE; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { return Objects.hash(this.orderRelevant, this.semanticIdListElement, this.typeValueListElement, + this.value, this.valueTypeListElement, - this.values, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -108,17 +121,19 @@ public boolean equals(Object obj) { return Objects.equals(this.orderRelevant, other.orderRelevant) && Objects.equals(this.semanticIdListElement, other.semanticIdListElement) && Objects.equals(this.typeValueListElement, other.typeValueListElement) && + Objects.equals(this.value, other.value) && Objects.equals(this.valueTypeListElement, other.valueTypeListElement) && - Objects.equals(this.values, other.values) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -153,23 +168,23 @@ public void setTypeValueListElement(AasSubmodelElements typeValueListElement) { } @Override - public DataTypeDefXsd getValueTypeListElement() { - return valueTypeListElement; + public List getValue() { + return value; } @Override - public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement) { - this.valueTypeListElement = valueTypeListElement; + public void setValue(List value) { + this.value = value; } @Override - public List getValues() { - return values; + public DataTypeDefXsd getValueTypeListElement() { + return valueTypeListElement; } @Override - public void setValues(List values) { - this.values = values; + public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement) { + this.valueTypeListElement = valueTypeListElement; } @Override @@ -203,13 +218,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -223,33 +238,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; } @Override - public List getDisplayNames() { - return displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public List getDisplayName() { + return displayName; } @Override - public List getDescriptions() { - return descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -262,15 +287,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultSubmodelElementList (" + "orderRelevant=%s," - + "semanticIdListElement=%s," - + "typeValueListElement=%s," - + "valueTypeListElement=%s," - + "values=%s," - + ")", - this.orderRelevant, this.semanticIdListElement, this.typeValueListElement, this.valueTypeListElement, this.values); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java index be8669adf..d9a5cba53 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,7 +34,7 @@ @IRI("aas:ValueList") public class DefaultValueList implements ValueList { - @IRI("https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs") + @IRI("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") protected List valueReferencePairs = new ArrayList<>(); public DefaultValueList() {} @@ -68,13 +68,6 @@ public void setValueReferencePairs(List valueReferencePairs) this.valueReferencePairs = valueReferencePairs; } - public String toString() { - return String.format( - "DefaultValueList (" + "valueReferencePairs=%s," - + ")", - this.valueReferencePairs); - } - /** * This builder class can be used to construct a DefaultValueList bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java index 7464601a0..af589cd39 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,13 +33,15 @@ @IRI("aas:ValueReferencePair") public class DefaultValueReferencePair implements ValueReferencePair { - @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") protected Reference valueId; - public DefaultValueReferencePair() {} + public DefaultValueReferencePair() { + + } @Override public int hashCode() { @@ -82,14 +84,6 @@ public void setValueId(Reference valueId) { this.valueId = valueId; } - public String toString() { - return String.format( - "DefaultValueReferencePair (" + "value=%s," - + "valueId=%s," - + ")", - this.value, this.valueId); - } - /** * This builder class can be used to construct a DefaultValueReferencePair bean. */ From 78c8cc373f4a460b396032bf63d3aa277143ee53 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 3 Jul 2023 14:24:15 +0200 Subject: [PATCH 11/59] Revert the changed files Revert the changed files --- .../v3/dataformat/aasx/AASXDeserializer.java | 26 +- .../v3/dataformat/aasx/AASXSerializer.java | 75 +- .../deserialization/AASXDeserializerTest.java | 8 +- .../aasx/deserialization/ValidationTest.java | 16 +- .../serialization/AASXSerializerTest.java | 17 +- .../src/test/resources/jsonExample.json | 2 +- .../dataformat/DeserializationException.java | 2 +- .../v3/dataformat/SerializationException.java | 2 +- .../deserialization/EnumDeserializer.java | 29 +- .../core/serialization/EnumSerializer.java | 68 +- .../v3/dataformat/core/util/AasUtils.java | 452 +--- .../aas4j/v3/dataformat/core/AASFull.java | 840 +++--- .../aas4j/v3/dataformat/core/AASSimple.java | 185 +- .../v3/dataformat/core/CustomProperty.java | 47 +- .../dataformat/core/EnumDeserializerTest.java | 72 +- .../dataformat/core/EnumSerializerTest.java | 73 +- .../aas4j/v3/model/TypedProperty.java | 2 - dataformat-json/pom.xml | 4 +- .../v3/dataformat/json/JsonDeserializer.java | 336 ++- .../v3/dataformat/json/JsonSerializer.java | 274 +- .../json/mixins/AssetInformationMixin.java | 25 +- .../json/mixins/ConceptDescriptionMixin.java | 14 +- .../DataSpecificationIec61360Mixin.java | 25 +- .../dataformat/json/mixins/EntityMixin.java | 10 +- .../v3/dataformat/json/mixins/FileMixin.java | 3 +- .../json/mixins/HasExtensionsMixin.java | 5 +- .../mixins/MultiLanguagePropertyMixin.java | 15 +- .../json/mixins/QualifierMixin.java | 9 +- .../json/mixins/ReferableMixin.java | 21 +- .../json/mixins/SubmodelElementListMixin.java | 6 +- dataformat-json/src/main/resources/aas.json | 641 +++-- .../dataformat/json/JsonDeserializerTest.java | 29 +- .../json/JsonReferableDeserializerTest.java | 104 +- .../json/JsonReferableSerializerTest.java | 110 +- .../dataformat/json/JsonSerializerTest.java | 37 +- .../dataformat/json/JsonValidationTest.java | 32 +- .../ReflectionAnnotationIntrospectorTest.java | 2 +- .../resources/AssetAdministrationShell.json | 137 +- .../src/test/resources/MotorAAS.json | 101 +- .../src/test/resources/Submodel.json | 268 +- .../src/test/resources/SubmodelElement.json | 108 +- .../resources/SubmodelElementCollection.json | 168 +- .../test/resources/SubmodelElementList.json | 277 +- .../v3/dataformat/xml/XmlDeserializer.java | 130 +- .../v3/dataformat/xml/XmlSerializer.java | 111 +- ...mbeddedDataSpecificationsDeserializer.java | 41 +- .../OperationVariableDeserializer.java | 22 +- .../QualifierDeserializer.java | 16 +- .../ReferencesDeserializer.java | 6 +- .../SubmodelElementDeserializer.java | 3 +- .../SubmodelElementsDeserializer.java | 17 +- .../xml/internal/AasXmlNamespaceContext.java | 39 + .../xml/internal/SubmodelElementManager.java | 84 + .../XmlDataformatAnnotationIntrospector.java | 89 + .../mixins/AssetAdministrationShellMixin.java | 12 +- .../xml/mixins/AssetInformationMixin.java | 29 +- .../xml/mixins/ConceptDescriptionMixin.java | 9 +- .../DataSpecificationIec61360Mixin.java | 73 +- .../EmbeddedDataSpecificationMixin.java | 82 +- .../v3/dataformat/xml/mixins/EntityMixin.java | 21 +- .../xml/mixins/EnvironmentMixin.java | 4 +- .../xml/mixins/HasDataSpecificationMixin.java | 10 +- .../xml/mixins/HasExtensionsMixin.java | 3 +- .../v3/dataformat/xml/mixins/KeyMixin.java | 3 +- .../mixins/MultiLanguagePropertyMixin.java | 22 +- .../dataformat/xml/mixins/OperationMixin.java | 20 +- .../xml/mixins/OperationVariableMixin.java | 4 +- .../xml/mixins/QualifiableMixin.java | 10 +- .../dataformat/xml/mixins/QualifierMixin.java | 11 +- .../dataformat/xml/mixins/ReferableMixin.java | 40 +- .../dataformat/xml/mixins/ReferenceMixin.java | 3 +- .../dataformat/xml/mixins/ResourceMixin.java | 9 +- .../xml/mixins/SpecificAssetIDMixin.java | 13 +- .../SubmodelElementCollectionMixin.java | 3 +- .../xml/mixins/SubmodelElementMixin.java | 7 +- .../dataformat/xml/mixins/SubmodelMixin.java | 7 +- .../dataformat/xml/mixins/ValueListMixin.java | 18 +- .../xml/mixins/ValueReferencePairMixin.java | 11 +- .../AbstractLangStringSerializer.java | 2 +- .../AbstractLangStringsSerializer.java | 4 +- ...inistrationShellEnvironmentSerializer.java | 19 +- .../serialization/DataElementsSerializer.java | 3 +- .../EmbeddedDataSpecificationSerializer.java | 22 +- .../OperationVariableSerializer.java | 27 +- .../SubmodelElementSerializer.java | 12 +- .../SubmodelElementsSerializer.java | 5 +- dataformat-xml/src/main/resources/AAS.xsd | 1937 +++++++++----- .../dataformat/xml/XMLDeserializerTest.java | 63 +- .../v3/dataformat/xml/XmlSerializerTest.java | 110 +- .../v3/dataformat/xml/XmlValidationTest.java | 5 +- .../annotated_relationship_example.xml | 9 +- .../src/test/resources/invalidXmlExample.xml | 2 +- dataformat-xml/src/test/resources/minimum.xml | 7 +- .../src/test/resources/operation_example.xml | 47 +- .../src/test/resources/qualifier_example.xml | 6 +- .../test/resources/test_demo_full_example.xml | 2246 +++++------------ .../src/test/resources/xmlExample.xml | 170 +- .../xmlExampleWithModifiedPrefix.xml | 171 +- 98 files changed, 5400 insertions(+), 5126 deletions(-) create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index 0a3b4da65..5108b7bf9 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -31,7 +33,7 @@ import org.apache.poi.openxml4j.opc.PackagingURIHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; @@ -47,8 +49,10 @@ public class AASXDeserializer { private static final String XML_TYPE = "http://www.admin-shell.io/aasx/relationships/aas-spec"; private static final String AASX_ORIGIN = "/aasx/aasx-origin"; + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - private XmlDeserializer deserializer = new XmlDeserializer(); + + private final XmlDeserializer deserializer; private Environment environment; private final OPCPackage aasxRoot; @@ -62,6 +66,7 @@ public class AASXDeserializer { */ public AASXDeserializer(InputStream inputStream) throws InvalidFormatException, IOException { aasxRoot = OPCPackage.open(inputStream); + this.deserializer = new XmlDeserializer(); } /** @@ -126,7 +131,7 @@ private String getXMLResourceString(OPCPackage aasxPackage) throws InvalidFormat // Read the content from the PackagePart InputStream stream = xmlPart.getInputStream(); StringWriter writer = new StringWriter(); - IOUtils.copy(stream, writer, Serializer.DEFAULT_CHARSET); + IOUtils.copy(stream, writer, DEFAULT_CHARSET); return writer.toString(); } @@ -134,7 +139,7 @@ private String getXMLResourceString(OPCPackage aasxPackage) throws InvalidFormat * Load the referenced filepaths in the submodels such as PDF, PNG files from * the package * - * @return a map of the folder name and folder path, the folder holds the files + * @return a list of the folder name and folder path, the folder holds the files * @throws IOException if creating input streams for aasx fails * @throws InvalidFormatException if aasx package format is invalid * @throws DeserializationException if deserialization of the serialized aas environment fails @@ -161,15 +166,10 @@ private List parseElements(Collection elements) { for (SubmodelElement element : elements) { if (element instanceof File) { File file = (File) element; - // If the path contains a "://", we can assume, that the Path is a link to an - // other server - // e.g. http://localhost:8080/aasx/... - if (!file.getValue().contains("://")) { - paths.add(file.getValue()); - } + paths.add(file.getValue()); } else if (element instanceof SubmodelElementCollection) { SubmodelElementCollection collection = (SubmodelElementCollection) element; - paths.addAll(parseElements(collection.getValue())); + paths.addAll(parseElements(collection.getValues())); } } return paths; @@ -193,7 +193,7 @@ public List getRelatedFiles() throws InvalidFormatException, IOExc } private InMemoryFile readFile(OPCPackage aasxRoot, String filePath) throws InvalidFormatException, IOException { - PackagePart part = aasxRoot.getPart(PackagingURIHelper.createPartName(filePath)); + PackagePart part = aasxRoot.getPart(PackagingURIHelper.createPartName(AASXUtils.getPathFromURL(filePath))); InputStream stream = part.getInputStream(); return new InMemoryFile(stream.readAllBytes(), filePath); } diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index 050dce41e..449be54c3 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,8 @@ import java.io.IOException; import java.io.OutputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -31,18 +33,20 @@ import org.apache.poi.openxml4j.opc.RelationshipSource; import org.apache.poi.openxml4j.opc.TargetMode; import org.apache.poi.openxml4j.opc.internal.MemoryPackagePart; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSerializer; + /** * This class can be used to generate an .aasx file from Metamodel Objects and * the Files referred to in the Submodels @@ -62,12 +66,15 @@ public class AASXSerializer { private static final String AASSUPPL_RELTYPE = "http://www.admin-shell.io/aasx/relationships/aas-suppl"; - private Serializer xmlSerializer = new XmlSerializer(); + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + + private final XmlSerializer xmlSerializer; /** * Default constructor */ public AASXSerializer() { + this.xmlSerializer = new XmlSerializer(); } /** @@ -75,7 +82,7 @@ public AASXSerializer() { * * @param xmlSerializer a custom serializer used for serializing the aas environment */ - public AASXSerializer(Serializer xmlSerializer) { + public AASXSerializer(XmlSerializer xmlSerializer) { this.xmlSerializer = xmlSerializer; } @@ -102,7 +109,7 @@ public void write(Environment environment, Collection files, Outpu String xml = xmlSerializer.write(environment); // Save the XML to aasx/xml/content.xml - PackagePart xmlPart = createAASXPart(rootPackage, origin, XML_PATH, MIME_XML, AASSPEC_RELTYPE, xml.getBytes(Serializer.DEFAULT_CHARSET)); + PackagePart xmlPart = createAASXPart(rootPackage, origin, XML_PATH, MIME_XML, AASSPEC_RELTYPE, xml.getBytes(DEFAULT_CHARSET)); storeFilesInAASX(environment.getSubmodels(), files, rootPackage, xmlPart); @@ -118,11 +125,11 @@ public void write(Environment environment, Collection files, Outpu * @param xmlPart the Part the files should be related to */ private void storeFilesInAASX(List submodelList, Collection files, OPCPackage rootPackage, - PackagePart xmlPart) { + PackagePart xmlPart) { for (Submodel sm : submodelList) { for (File file : findFileElements(sm.getSubmodelElements())) { - String filePath = file.getValue(); + String filePath = AASXUtils.getPathFromURL(file.getValue()); try { InMemoryFile content = findFileByPath(files, filePath); logger.trace("Writing file '" + filePath + "' to .aasx."); @@ -196,7 +203,7 @@ private PackagePart createAASXPart(OPCPackage root, RelationshipSource relateTo, * @param content the content to be written to the part */ private void writeDataToPart(PackagePart part, byte[] content) { - try (OutputStream ostream = part.getOutputStream();) { + try (OutputStream ostream = part.getOutputStream()) { ostream.write(content); ostream.flush(); } catch (Exception e) { @@ -219,7 +226,7 @@ private Collection findFileElements(Collection elements) files.add((File) element); } else if (element instanceof SubmodelElementCollection) { // Recursive call to deal with SubmodelElementCollections - files.addAll(findFileElements(((SubmodelElementCollection) element).getValue())); + files.addAll(findFileElements(((SubmodelElementCollection) element).getValues())); } } @@ -245,7 +252,7 @@ private void prepareFilePaths(Collection submodels) { */ private InMemoryFile findFileByPath(Collection files, String path) { for (InMemoryFile file : files) { - if (preparePath(file.getPath()).equals(path)) { + if (AASXUtils.getPathFromURL(file.getPath()).equals(path)) { return file; } } @@ -253,51 +260,17 @@ private InMemoryFile findFileByPath(Collection files, String path) } /** - * Removes the serverpart from a path and ensures it starts with a slash + * Removes the serverpart from a path and ensures it starts with "file://" * * @param path the path to be prepared * @return the prepared path */ private String preparePath(String path) { - String newPath = getPathFromURL(path); - if (!newPath.startsWith("/")) { - newPath = "/" + newPath; + String newPath = AASXUtils.getPathFromURL(path); + if (!newPath.startsWith("file://")) { + newPath = "file://" + newPath; } return newPath; } - /** - * Gets the path from a URL e.g "http://localhost:8080/path/to/test.file" - * results in "/path/to/test.file" - * - * @param url - * @return the path from the URL - */ - private String getPathFromURL(String url) { - if (url == null) { - return null; - } - - if (url.contains("://")) { - - // Find the ":" and and remove the "http://" from the url - int index = url.indexOf(":") + 3; - url = url.substring(index); - - // Find the first "/" from the URL (now without the "http://") and remove - // everything before that - index = url.indexOf("/"); - url = url.substring(index); - - // Recursive call to deal with more than one server parts - // (e.g. basyx://127.0.0.1:6998//https://localhost/test/) - return getPathFromURL(url); - } else { - // Make sure the path has a / at the start - if (!url.startsWith("/")) { - url = "/" + url; - } - return url; - } - } } \ No newline at end of file diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java index 465f8b8be..77425197e 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,19 +47,20 @@ public class AASXDeserializerTest { @Test public void testRoundTrip() throws SerializationException, IOException, InvalidFormatException, DeserializationException, ParserConfigurationException, SAXException { + List fileList = new ArrayList<>(); byte[] operationManualContent = { 0, 1, 2, 3, 4 }; - InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "/aasx/OperatingManual.pdf"); + InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); fileList.add(inMemoryFile); File file = tempFolder.newFile("output.aasx"); - new AASXSerializer().write(AASSimple.ENVIRONMENT, fileList, new FileOutputStream(file)); + new AASXSerializer().write(AASSimple.createEnvironment(), fileList, new FileOutputStream(file)); InputStream in = new FileInputStream(file); AASXDeserializer deserializer = new AASXDeserializer(in); - assertEquals(AASSimple.ENVIRONMENT, deserializer.read()); + assertEquals(AASSimple.createEnvironment(), deserializer.read()); assertEquals(fileList, deserializer.getRelatedFiles()); } } diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java index 5fe63adfb..6b1622c43 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,17 +29,16 @@ import javax.xml.parsers.ParserConfigurationException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXValidator; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.xml.sax.SAXException; - import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXValidator; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.xml.sax.SAXException; public class ValidationTest { @@ -51,12 +49,12 @@ public class ValidationTest { public void validateXmlInsideAasx() throws SerializationException, IOException, InvalidFormatException, DeserializationException, ParserConfigurationException, SAXException { List fileList = new ArrayList<>(); byte[] operationManualContent = { 0, 1, 2, 3, 4 }; - InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "/aasx/OperatingManual.pdf"); + InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); fileList.add(inMemoryFile); File file = tempFolder.newFile("output.aasx"); - new AASXSerializer().write(AASSimple.ENVIRONMENT, fileList, new FileOutputStream(file)); + new AASXSerializer().write(AASSimple.createEnvironment(), fileList, new FileOutputStream(file)); InputStream in = new FileInputStream(file); AASXValidator v = new AASXValidator(in); diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java index f3830bb2c..cfce0d5c1 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,15 +40,15 @@ public class AASXSerializerTest { - private static final String XML_PATH = "aasx/xml/content.xml"; - private static final String ORIGIN_PATH = "aasx/aasx-origin"; + private static final String XML_PATH_URI = "file:///aasx/xml/content.xml"; + private static final String ORIGIN_PATH_URI = "file:///aasx/aasx-origin"; private List fileList = new ArrayList<>(); @Before public void setup() throws IOException { byte[] operationManualContent = { 0, 1, 2, 3, 4 }; - InMemoryFile file = new InMemoryFile(operationManualContent, "aasx/OperatingManual.pdf"); + InMemoryFile file = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); fileList.add(file); } @@ -62,7 +61,7 @@ public void testBuildAASX() throws IOException, TransformerException, ParserConf // This stream keeps the output of the AASXFactory only in memory ByteArrayOutputStream out = new ByteArrayOutputStream(); - new AASXSerializer().write(AASSimple.ENVIRONMENT, fileList, out); + new AASXSerializer().write(AASSimple.createEnvironment(), fileList, out); validateAASX(out); } @@ -74,7 +73,7 @@ private void validateAASX(ByteArrayOutputStream byteStream) throws IOException { ArrayList filePaths = new ArrayList<>(); while ((zipEntry = in.getNextEntry()) != null) { - if (zipEntry.getName().equals(XML_PATH)) { + if (zipEntry.getName().equals(XML_PATH_URI)) { // Read the first 5 bytes of the XML file to make sure it is in fact XML file // No further test of XML file necessary as XML-Converter is tested separately @@ -85,11 +84,11 @@ private void validateAASX(ByteArrayOutputStream byteStream) throws IOException { } // Write the paths of all files contained in the .aasx into filePaths - filePaths.add(zipEntry.getName()); + filePaths.add("file:///" + zipEntry.getName()); } - assertTrue(filePaths.contains(XML_PATH)); - assertTrue(filePaths.contains(ORIGIN_PATH)); + assertTrue(filePaths.contains(XML_PATH_URI)); + assertTrue(filePaths.contains(ORIGIN_PATH_URI)); // Check if all expected files are present // Needs to strip the first slash of the paths, as ZipEntry gives paths without diff --git a/dataformat-aasx/src/test/resources/jsonExample.json b/dataformat-aasx/src/test/resources/jsonExample.json index 26cd27970..f6421ef44 100644 --- a/dataformat-aasx/src/test/resources/jsonExample.json +++ b/dataformat-aasx/src/test/resources/jsonExample.json @@ -192,7 +192,7 @@ }, "idShort": "DigitalFile_PDF", "mimeType": "application/pdf", - "value": "/aasx/OperatingManual.pdf" + "value": "file:///aasx/OperatingManual.pdf" } ] } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java index f201050f7..26e0f1868 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +15,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat; +@SuppressWarnings("serial") public class DeserializationException extends Exception { public DeserializationException(String msg) { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java index 00ccc1b95..981d657cb 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +15,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat; +@SuppressWarnings("serial") public class SerializationException extends Exception { public SerializationException(String msg) { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java index b087fab00..76ba4040b 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +21,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; /** * Deserializes enum values converting element names from UpperCamelCase to @@ -30,7 +28,7 @@ * * @param Type of enum to deserialize */ -public class EnumDeserializer extends JsonDeserializer { +public class EnumDeserializer> extends JsonDeserializer { protected final Class type; @@ -48,7 +46,30 @@ public T deserialize(JsonParser parser, DeserializationContext context) throws I value = value.substring(0, 1).toUpperCase() + value.substring(1); } - return (T) Enum.valueOf(type, AasUtils.deserializeEnumName(value)); + return Enum.valueOf(type, deserializeEnumName(value)); } + /** + * Translates an enum value from CamelCase to SCREAMING_SNAKE_CASE + * + * @param input + * input name in CamelCase + * @return name in SCREAMING_SNAKE_CASE + */ + public static String deserializeEnumName(String input) { + String result = ""; + if (input == null || input.isEmpty()) { + return result; + } + result += Character.toUpperCase(input.charAt(0)); + for (int i = 1; i < input.length(); i++) { + char currentChar = input.charAt(i), previousChar = input.charAt(i - 1); + if (Character.isUpperCase(currentChar) && Character.isLowerCase(previousChar)) { + result += "_"; + } + result += Character.toUpperCase(currentChar); + } + return result; + } + } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index c0f3631a5..bc015d93e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,45 +18,81 @@ import java.io.IOException; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + /** * Serializes enum values. If enum is part of the AAS Java model, the name will * be converted from SCREAMING_SNAKE_CASE to UpperCamelCase, else default * serialization will be used */ +@SuppressWarnings("rawtypes") public class EnumSerializer extends JsonSerializer { - protected static final char UNDERSCORE = '_'; - - @Override - public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { + @Override + public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { if (value instanceof DataTypeDefXsd) { // only for the DataTypeDefXsd notation if (value.equals(DataTypeDefXsd.ANY_URI)) { gen.writeString("xs:anyURI"); } else if (value.equals(DataTypeDefXsd.NON_NEGATIVE_INTEGER)) { - gen.writeString("xs:NonNegativeInteger"); + gen.writeString("xs:nonNegativeInteger"); + } else if(isTimeRelatedValue(value)) { + handleTimeRelatedValue(gen, value); } else { // pattern: 'xs:' + camelCase - String enum_string = AasUtils.serializeEnumName(value.name()); + String enum_string = serializeEnumName(value.name()); gen.writeString("xs:" + enum_string.substring(0, 1).toLowerCase() + enum_string.substring(1)); } - } else if (value instanceof DataTypeIEC61360 || value instanceof Direction || value instanceof StateOfEvent) { - gen.writeString(value.name()); + } else if (value instanceof DataTypeIec61360) { + gen.writeString(value.name().toUpperCase()); + } else if (value instanceof Direction || value instanceof StateOfEvent) { + gen.writeString(value.name().toLowerCase()); } else if (ReflectionHelper.ENUMS.contains(value.getClass())) { - gen.writeString(AasUtils.serializeEnumName(value.name())); + gen.writeString(serializeEnumName(value.name())); } else { provider.findValueSerializer(Enum.class).serialize(value, gen, provider); } } + private void handleTimeRelatedValue(JsonGenerator gen, Enum value) throws IOException { + String enum_string = serializeEnumName(value.name()); + String adaptedEnumString = "xs:g" + enum_string.substring(1, 2).toUpperCase() + enum_string.substring(2); + gen.writeString(adaptedEnumString); + } + + private boolean isTimeRelatedValue(Enum value) { + String enum_string = serializeEnumName(value.name()); + return enum_string.startsWith("G"); + } + + /** + * Translates an enum value from SCREAMING_SNAKE_CASE to CamelCase + * + * @param input + * input name in SCREAMING_SNAKE_CASE + * @return name in CamelCase + */ + public static String serializeEnumName(String input) { + String result = ""; + boolean capitalize = true; + for (int i = 0; i < input.length(); i++) { + char currentChar = input.charAt(i); + if ('_' == currentChar) { + capitalize = true; + } else { + result += capitalize ? currentChar : Character.toLowerCase(currentChar); + capitalize = false; + } + } + return result; + } + } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index cd3b04514..46985b03e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,24 +16,38 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; -import com.google.common.reflect.TypeToken; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Type; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.IdentifiableCollector; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.MostSpecificTypeTokenComparator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.Operation; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.reflect.TypeToken; + /** * Provides utility functions related to AAS */ @@ -41,176 +55,29 @@ public class AasUtils { private static final Logger log = LoggerFactory.getLogger(AasUtils.class); - private static final char UNDERSCORE = '_'; - private static final String KEY_REGEX_GROUP_TYPE = "type"; - private static final String KEY_REGEX_GROUP_ID_TYPE = "idtype"; - private static final String KEY_REGEX_GROUP_VALUE = "value"; - private static final Pattern KEY_REGEX = Pattern.compile( - String.format("\\((?<%s>\\w+)\\)\\[(?<%s>\\w+)\\](?<%s>.*)", - KEY_REGEX_GROUP_TYPE, - KEY_REGEX_GROUP_ID_TYPE, - KEY_REGEX_GROUP_VALUE)); + private static final String REFERENCE_ELEMENT_DELIMITER = ", "; private AasUtils() { } - /** - * Formats a Reference as string - * - * @param reference Reference to serialize - * @return string representation of the reference for serialization, null if - * reference is null - */ - public static String asString(Reference reference) { - if (reference == null) { - return null; - } - return reference.getKeys().stream() - .map(x -> String.format("(%s)[%s]%s", - serializeEnumName(x.getType().name()), - x.getValue())) - .collect(Collectors.joining(",")); - } - - /** - * Parses a given string as Reference. If the given string is not a valid - * reference, null is returned. - * - * @param value String representation of the reference - * @return parsed Reference or null is given value is not a valid Reference - */ - public static Reference parseReference(String value) { - return parseReference(value, - ReflectionHelper.getDefaultImplementation(Reference.class), - ReflectionHelper.getDefaultImplementation(Key.class)); - } - - /** - * Parses a given string as Reference using the provided implementation of - * Reference and Key interface. If the given string is not a valid - * reference, null is returned. - * - * @param value String representation of the reference - * @param referenceType implementation type of Reference interface - * @param keyType implementation type of Key interface - * @return parsed Reference or null is given value is not a valid Reference - */ - public static Reference parseReference(String value, Class referenceType, Class keyType) { - if (value == null || value.isBlank()) { - return null; - } - try { - Reference result = referenceType.getConstructor().newInstance(); - result.setKeys(Stream.of(value.split(",")).map(x -> parseKey(x)).collect(Collectors.toList())); - // TODO: ReferenceType is ignored - // result.setType(Stream.of(value.split(",")).map(x -> parseReferenceType(x)).collect(Collectors.toList())); - return result; - } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { - throw new IllegalArgumentException("error parsing reference - could not instantiate reference type", ex); - } - } - - /** - * Gets property with given name as defined in type of given parent or null - * if not defined - * - * @param parent parent object - * @param propertyName name of the property - * @return property with given name as defined in type of given parent or - * null if not defined - */ - public static PropertyDescriptor getProperty(Object parent, String propertyName) { - if (parent == null || propertyName == null || propertyName.isBlank()) { - return null; - } - return getAasProperties(parent.getClass()).stream() - .filter(x -> x.getName().equals(propertyName)) - .findAny() - .orElse(null); - } - - /** - * Gets the content type of a generic collection type - * - * @param genericCollectionType the generic collection type - * @return the content type of the generic collection type - */ - public static Class getCollectionContentType(Type genericCollectionType) { - return TypeToken.of(genericCollectionType).resolveType(Collection.class.getTypeParameters()[0]).getRawType(); - } - - /** - * Gets property with given name as defined in given type or null if not - * defined - * - * @param type type containing the property - * @param propertyName name of the property - * @return property with given name as defined in given type or null if not - * defined - */ - public static PropertyDescriptor getProperty(Class type, String propertyName) { - if (type == null || propertyName == null || propertyName.isBlank()) { - return null; - } - return getAasProperties(type).stream() - .filter(x -> x.getName().equals(propertyName)) - .findAny() - .orElse(null); - } - - /** - * Parses a given string as Key. If the given string is not a valid key, - * null is returned. - * - * @param value String representation of the key - * @return parsed Key or null is given value is not a valid Key - */ - public static Key parseKey(String value) { - Matcher matcher = KEY_REGEX.matcher(value); - if (matcher.find()) { - KeyTypes keyType = KeyTypes.valueOf(deserializeEnumName(matcher.group(KEY_REGEX_GROUP_ID_TYPE))); - return new DefaultKey.Builder() - .type(keyType) - .value(matcher.group(KEY_REGEX_GROUP_VALUE)) - .build(); - } - return null; - } + /** + * Formats a Reference as string + * + * @param reference + * Reference to serialize + * @return string representation of the reference for serialization, null if + * reference is null + */ + private static String asString(Reference reference) { + if (reference == null) { + return null; + } + return String.format("[%s]%s", reference.getType(), + reference.getKeys().stream().map(x -> String.format("(%s)%s", EnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); + } /** - * Checks if a reference is a local reference or not. This functionality may - * not be 100% correct as since v3.0RC01 of the AAS specification there no - * longer is an isLocal property to check this and no alternative way to - * determine whether a reference is local or not is introduced. This method - * only checks for the presence of any Key with type GLOBAL_REFERENCE. - * Another approach would be to actually try resolving the reference - * locally. - * - * @param reference The reference to check - * @param environment The environment context the reference resides. In - * current implementation this is not used - * @return true if the reference is a local reference to the given - * environment, false otherwise - */ - public static boolean isLocal(Reference reference, Environment environment) { - return !reference.getKeys().stream().anyMatch(x -> x.getType() == KeyTypes.GLOBAL_REFERENCE); - } - - public static List getSubmodelTemplates(AssetAdministrationShell aas, Environment environment) { - return aas.getSubmodels().stream() - .map(ref -> resolve(ref, environment, Submodel.class)) - .filter(sm -> sm != null) - .filter(sm -> sm.getKind() != ModelingKind.INSTANCE) - .collect(Collectors.toList()); - } - - public static boolean hasTemplate(AssetAdministrationShell aas, Environment environment) { - return !getSubmodelTemplates(aas, environment).isEmpty(); - } - - /** - * Creates a reference for an Identifiable instance using provided - * implementation types for reference and key + * Creates a reference for an Identifiable instance using provided implementation types for reference and key * * @param identifiable the identifiable to create the reference for * @param referenceType implementation type of Reference interface @@ -220,6 +87,7 @@ public static boolean hasTemplate(AssetAdministrationShell aas, Environment envi public static Reference toReference(Identifiable identifiable, Class referenceType, Class keyType) { try { Reference reference = referenceType.getConstructor().newInstance(); + reference.setType(ReferenceTypes.MODEL_REFERENCE); Key key = keyType.getConstructor().newInstance(); key.setType(referableToKeyType(identifiable)); key.setValue(identifiable.getId()); @@ -244,93 +112,44 @@ public static Reference toReference(Identifiable identifiable) { * Gets the KeyElements type matching the provided Referable * * @param referable The referable to convert to KeyElements type - * @return the most specific KeyElements type representing the Referable, - * i.e. abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT are never - * returned; null if there is no corresponding KeyElements type + * @return the most specific KeyElements type representing the Referable, i.e. abstract types like SUBMODEL_ELEMENT + * or DATA_ELEMENT are never returned; null if there is no corresponding KeyElements type */ public static KeyTypes referableToKeyType(Referable referable) { Class aasInterface = ReflectionHelper.getAasInterface(referable.getClass()); if (aasInterface != null) { - return KeyTypes.valueOf(deserializeEnumName(aasInterface.getSimpleName())); + return KeyTypes.valueOf(EnumDeserializer.deserializeEnumName(aasInterface.getSimpleName())); } return null; } - /** - * Translates an enum value from SCREAMING_SNAKE_CASE to CamelCase - * - * @param input input name in SCREAMING_SNAKE_CASE - * @return name in CamelCase - */ - public static String serializeEnumName(String input) { - String result = ""; - boolean capitalize = true; - for (int i = 0; i < input.length(); i++) { - char currentChar = input.charAt(i); - if (UNDERSCORE == currentChar) { - capitalize = true; - } else { - result += capitalize - ? currentChar - : Character.toLowerCase(currentChar); - capitalize = false; - } - } - return result; - } - - /** - * Translates an enum value from CamelCase to SCREAMING_SNAKE_CASE - * - * @param input input name in CamelCase - * @return name in SCREAMING_SNAKE_CASE - */ - public static String deserializeEnumName(String input) { - String result = ""; - if (input == null || input.isEmpty()) { - return result; - } - result += Character.toUpperCase(input.charAt(0)); - for (int i = 1; i < input.length(); i++) { - char currentChar = input.charAt(i), - previousChar = input.charAt(i - 1); - if (Character.isUpperCase(currentChar) && Character.isLowerCase(previousChar)) { - result += UNDERSCORE; - } - result += Character.toUpperCase(currentChar); - } - return result; - } - /** * Gets a Java interface representing the type provided by key. * * @param key The KeyElements type - * @return a Java interface representing the provided KeyElements type or - * null if no matching Class/interface could be found. It also returns - * abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT + * @return a Java interface representing the provided KeyElements type or null if no matching Class/interface could + * be found. It also returns abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT */ - public static Class keyTypeToClass(KeyTypes key) { + private static Class keyTypeToClass(KeyTypes key) { return Stream.concat(ReflectionHelper.INTERFACES.stream(), ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream()) - .filter(x -> x.getSimpleName().equals(serializeEnumName(key.name()))) + .filter(x -> x.getSimpleName().equals(EnumSerializer.serializeEnumName(key.name()))) .findAny() .orElse(null); } /** - * Creates a reference for an element given a potential parent using - * provided implementation types for reference and key + * Creates a reference for an element given a potential parent using provided implementation types for reference and + * key * - * @param parent Reference to the parent. Can only be null when element is - * instance of Identifiable, otherwise result will always be null + * @param parent Reference to the parent. Can only be null when element is instance of Identifiable, otherwise + * result will always be null * @param element the element to create a reference for * @param referenceType implementation type of Reference interface * @param keyType implementation type of Key interface * - * @return A reference representing the element or null if either element is - * null or parent is null and element not an instance of Identifiable. In - * case element is an instance of Identifiable, the returned reference will - * only contain one key pointing directly to the element. + * @return A reference representing the element or null if either element is null or parent is null and element not + * an instance of Identifiable. In case element is an instance of Identifiable, the returned reference will only + * contain one key pointing directly to the element. */ public static Reference toReference(Reference parent, Referable element, Class referenceType, Class keyType) { if (element == null) { @@ -356,13 +175,12 @@ public static Reference toReference(Reference parent, Referable element, Class referenceType, Class keyType) { + private static Reference clone(Reference reference, Class referenceType, Class keyType) { if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } try { Reference result = referenceType.getConstructor().newInstance(); List newKeys = new ArrayList<>(); + result.setType(reference.getType()); for (Key key : reference.getKeys()) { Key newKey = keyType.getConstructor().newInstance(); newKey.setType(key.getType()); @@ -449,15 +256,13 @@ public static Reference clone(Reference reference, Class re } /** - * Resolves a Reference within an AssetAdministrationShellEnvironment and - * returns the targeted object if available, null otherwise + * Resolves a Reference within an AssetAdministrationShellEnvironment and returns the targeted object if available, + * null otherwise * * * @param reference The reference to resolve - * @param env The AssetAdministrationShellEnvironment to resolve the - * reference against - * @return returns an instance of T if the reference could successfully be - * resolved, otherwise null + * @param env The AssetAdministrationShellEnvironment to resolve the reference against + * @return returns an instance of T if the reference could successfully be resolved, otherwise null * @throws IllegalArgumentException if something goes wrong while resolving */ public static Referable resolve(Reference reference, Environment env) { @@ -465,21 +270,18 @@ public static Referable resolve(Reference reference, Environment env) { } /** - * Resolves a Reference within an AssetAdministrationShellEnvironment and - * returns the targeted object if available, null otherwise + * Resolves a Reference within an AssetAdministrationShellEnvironment and returns the targeted object if available, + * null otherwise * - * @param sub-type of Referable of the targeted type. If unknown use - * Referable.class + * @param sub-type of Referable of the targeted type. If unknown use Referable.class * @param reference The reference to resolve - * @param env The AssetAdministrationShellEnvironment to resolve the - * reference against - * @param type desired return type, use Referable.class is unknwon/not - * needed - * @return returns an instance of T if the reference could successfully be - * resolved, otherwise null + * @param env The AssetAdministrationShellEnvironment to resolve the reference against + * @param type desired return type, use Referable.class is unknwon/not needed + * @return returns an instance of T if the reference could successfully be resolved, otherwise null * @throws IllegalArgumentException if something goes wrong while resolving */ - public static T resolve(Reference reference, Environment env, Class type) { + @SuppressWarnings("unchecked") + public static T resolve(Reference reference, Environment env, Class type) { if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } @@ -528,42 +330,54 @@ public static T resolve(Reference reference, Environment e Key key = reference.getKeys().get(i); Class keyType = keyTypeToClass(key.getType()); if (keyType != null) { - Collection collection; - // operation needs special handling because of nested values - if (Operation.class.isAssignableFrom(current.getClass())) { - Operation operation = (Operation) current; - - collection = Stream.of(operation.getInputVariables().stream(), - operation.getOutputVariables().stream(), - operation.getInoutputVariables().stream()) - .flatMap(x -> x.map(y -> y.getValue())) - .collect(Collectors.toSet()); - } else { - List matchingProperties = getAasProperties(current.getClass()).stream() - .filter(x -> Collection.class.isAssignableFrom(x.getReadMethod().getReturnType())) - .filter(x -> TypeToken.of(x.getReadMethod().getGenericReturnType()) - .resolveType(Collection.class.getTypeParameters()[0]) - .isSupertypeOf(keyType)) - .collect(Collectors.toList()); - if (matchingProperties.isEmpty()) { - throw new IllegalArgumentException(String.format("error resolving reference - could not find matching property for type %s in class %s", - keyType.getSimpleName(), - current.getClass().getSimpleName())); - } - if (matchingProperties.size() > 1) { - throw new IllegalArgumentException(String.format("error resolving reference - found %d possible property paths for class %s (%s)", - matchingProperties.size(), - current.getClass().getSimpleName(), - matchingProperties.stream() - .map(x -> x.getName()) - .collect(Collectors.joining(", ")))); - } + if (SubmodelElementList.class.isAssignableFrom(current.getClass())) { try { - collection = (Collection) matchingProperties.get(0).getReadMethod().invoke(current); - } catch (Exception ex) { - throw new IllegalArgumentException("error resolving reference", ex); + current = ((SubmodelElementList) current).getValues().get(Integer.parseInt(key.getValue())); + } catch (NumberFormatException ex) { + throw new IllegalArgumentException(String.format("invalid value for key with index %d, expected integer values >= 0, but found '%s'", + i, key.getValue())); + } catch (IndexOutOfBoundsException ex) { + throw new IllegalArgumentException(String.format("index out of bounds exception for key with index %d, expected integer values >= 0 and < %d, but found '%s'", + i, + ((SubmodelElementList) current).getValues().size(), + key.getValue())); + } + } else { + Collection collection; + if (Operation.class.isAssignableFrom(current.getClass())) { + Operation operation = (Operation) current; + collection = Stream.of(operation.getInputVariables().stream(), + operation.getOutputVariables().stream(), + operation.getInoutputVariables().stream()) + .flatMap(x -> x.map(y -> y.getValue())) + .collect(Collectors.toSet()); + } else { + List matchingProperties = getAasProperties(current.getClass()).stream() + .filter(x -> Collection.class.isAssignableFrom(x.getReadMethod().getReturnType())) + .filter(x -> TypeToken.of(x.getReadMethod().getGenericReturnType()) + .resolveType(Collection.class.getTypeParameters()[0]) + .isSupertypeOf(keyType)) + .collect(Collectors.toList()); + if (matchingProperties.isEmpty()) { + throw new IllegalArgumentException(String.format("error resolving reference - could not find matching property for type %s in class %s", + keyType.getSimpleName(), + current.getClass().getSimpleName())); + } + if (matchingProperties.size() > 1) { + throw new IllegalArgumentException(String.format("error resolving reference - found %d possible property paths for class %s (%s)", + matchingProperties.size(), + current.getClass().getSimpleName(), + matchingProperties.stream() + .map(x -> x.getName()) + .collect(Collectors.joining(", ")))); + } + try { + collection = (Collection) matchingProperties.get(0).getReadMethod().invoke(current); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new IllegalArgumentException("error resolving reference", ex); + } } - Optional next = collection.stream() + Optional next = collection.stream() .filter(x -> ((Referable) x).getIdShort().equals(key.getValue())) .findFirst(); if (next.isEmpty()) { @@ -577,16 +391,14 @@ public static T resolve(Reference reference, Environment e } /** - * Gets a list of all properties defined for a class implementing at least - * one AAS interface. + * Gets a list of all properties defined for a class implementing at least one AAS interface. * - * @param type A class implementing at least one AAS interface. If it is - * does not implement any AAS interface the result will be an empty list - * @return a list of all properties defined in any of AAS interface - * implemented by type. If type does not implement any AAS interface an - * empty list is returned. + * @param type A class implementing at least one AAS interface. If it is does not implement any AAS interface the + * result will be an empty list + * @return a list of all properties defined in any of AAS interface implemented by type. If type does not implement + * any AAS interface an empty list is returned. */ - public static List getAasProperties(Class type) { + private static List getAasProperties(Class type) { Class aasType = ReflectionHelper.getAasInterface(type); if (aasType == null) { aasType = ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream() @@ -613,4 +425,4 @@ public static List getAasProperties(Class type) { .sorted(Comparator.comparing(x -> x.getName())) .collect(Collectors.toList()); } -} +} \ No newline at end of file diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index e20d26153..483d4a0d9 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,53 @@ import java.util.Arrays; import java.util.Base64; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; - +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.Direction; +import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultCapability; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultQualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueReferencePair; public class AASFull { @@ -40,64 +84,50 @@ public class AASFull { public final static ConceptDescription CONCEPT_DESCRIPTION_2 = createConceptDescription2(); public final static ConceptDescription CONCEPT_DESCRIPTION_3 = createConceptDescription3(); public final static ConceptDescription CONCEPT_DESCRIPTION_4 = createConceptDescription4(); - public static final Environment ENVIRONMENT = createEnvironment(); public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"; public static AssetAdministrationShell createAAS1() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() - )) + .description(new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build()) + .description(new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + ) .id("https://acplt.org/Test_AssetAdministrationShell") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .derivedFrom(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) .value("https://acplt.org/TestAssetAdministrationShell2") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) - //.billOfMaterial((new DefaultReference.Builder() - // .keys(new DefaultKey.Builder() - // .type(KeyTypes.SUBMODEL) - // .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") - // .build())) - // .build()) + .globalAssetId("https://acplt.org/Test_Asset") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -108,27 +138,21 @@ public static AssetAdministrationShell createAAS2() { .id("https://acplt.org/Test_AssetAdministrationShell_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset_Mandatory") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset_Mandatory") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel_Mandatory") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel2_Mandatory") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -139,13 +163,7 @@ public static AssetAdministrationShell createAAS3() { .id("https://acplt.org/Test_AssetAdministrationShell2_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset_Mandatory") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset_Mandatory") .build()) .build(); } @@ -153,31 +171,25 @@ public static AssetAdministrationShell createAAS3() { public static AssetAdministrationShell createAAS4() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_AssetAdministrationShell_Missing") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset_Missing") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset_Missing") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel_Missing") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -185,28 +197,31 @@ public static AssetAdministrationShell createAAS4() { public static Submodel createSubmodel1() { return new DefaultSubmodel.Builder() .idShort("Identification") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() )) .id("http://acplt.org/Submodels/Assets/TestAsset/Identification") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/AssetIdentification") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultProperty.Builder() .idShort("ManufacturerName") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .displayName( + new DefaultLangStringNameType.Builder().text("Manufacturer Name").language("en-us").build() + ) + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -214,7 +229,7 @@ public static Submodel createSubmodel1() { .value("0173-1#02-AAO677#002") .build() ) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .value("100") @@ -226,21 +241,22 @@ public static Submodel createSubmodel1() { .type("http://acplt.org/Qualifier/ExampleQualifier2") .valueType(DataTypeDefXsd.INT) .build()) - .value("http://acplt.org/ValueId/ACPLT") + .value("http://acplt.org/valueId/ACPLT") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ACPLT") + .value("http://acplt.org/valueId/ACPLT") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultProperty.Builder() .idShort("InstanceId") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .category("VARIABLE") + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -248,8 +264,23 @@ public static Submodel createSubmodel1() { .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build() ) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) + .supplementalSemanticIds(Arrays.asList( + new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("something_random_e14ad770") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build(), + new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("something_random_bd061acd") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build())) .value("978-8234-234-342") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() @@ -257,7 +288,7 @@ public static Submodel createSubmodel1() { .type(KeyTypes.GLOBAL_REFERENCE) .value("978-8234-234-342") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .build(); @@ -266,106 +297,100 @@ public static Submodel createSubmodel1() { public static Submodel createSubmodel2() { return new DefaultSubmodel.Builder() .idShort("BillOfMaterial") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() )) .id("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") + .version("0") .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/BillOfMaterial") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .statements(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValue2") + .value("http://acplt.org/valueId/ExampleValue2") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValue2") + .value("http://acplt.org/valueId/ExampleValue2") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .statements(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .entityType(EntityType.CO_MANAGED_ENTITY) .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity2") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .entityType(EntityType.SELF_MANAGED_ENTITY) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset2") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset2") .build()) .build(); } @@ -373,36 +398,36 @@ public static Submodel createSubmodel2() { public static Submodel createSubmodel3() { return new DefaultSubmodel.Builder() .idShort("TestSubmodel") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -438,16 +463,16 @@ public static Submodel createSubmodel3() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -480,7 +505,6 @@ public static Submodel createSubmodel3() { .type(ReferenceTypes.MODEL_REFERENCE) .build()) .annotations(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .idShort("ExampleProperty3") .category("PARAMETER") .value("some example annotation") @@ -489,41 +513,40 @@ public static Submodel createSubmodel3() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -532,24 +555,24 @@ public static Submodel createSubmodel3() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -558,24 +581,24 @@ public static Submodel createSubmodel3() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty3") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -584,16 +607,16 @@ public static Submodel createSubmodel3() { .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultBasicEventElement.Builder() @@ -601,16 +624,16 @@ public static Submodel createSubmodel3() { .category("PARAMETER") .direction(Direction.INPUT) .state(StateOfEvent.ON) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -632,113 +655,114 @@ public static Submodel createSubmodel3() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .value(Arrays.asList( - new DefaultLangString.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), - new DefaultLangString.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() + .values(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleMultiLanguageValueId") + .value("http://acplt.org/valueId/ExampleMultiLanguagevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) - .value(new DefaultRange.Builder() + .value(new DefaultRange.Builder() // TODO: a SME-List must only contain one SME-Type, e.g. Property or Range .idShort("ExampleRange") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .min("0") .max("100") .valueType(DataTypeDefXsd.INT) .build()) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .contentType("application/pdf") .value(Base64.getDecoder().decode("AQIDBAU=")) @@ -746,16 +770,16 @@ public static Submodel createSubmodel3() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example File object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("file:///TestFile.pdf") .contentType("application/pdf") @@ -763,16 +787,16 @@ public static Submodel createSubmodel3() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -787,7 +811,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.PROPERTY) .value("ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .build()) @@ -798,7 +822,7 @@ public static Submodel createSubmodel4() { return new DefaultSubmodel.Builder() .idShort("Test_Submodel_Mandatory") .id("https://acplt.org/Test_Submodel_Mandatory") - .kind(ModelingKind.TEMPLATE) + .kind(ModellingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .first(new DefaultReference.Builder() @@ -867,7 +891,6 @@ public static Submodel createSubmodel4() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .build()) .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") @@ -910,6 +933,7 @@ public static Submodel createSubmodel4() { .max(null) .valueType(DataTypeDefXsd.INT) .build()) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") @@ -935,7 +959,7 @@ public static Submodel createSubmodel4() { public static Submodel createSubmodel5() { return new DefaultSubmodel.Builder() .idShort("Test_Submodel2_Mandatory") - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .id("https://acplt.org/Test_Submodel2_Mandatory") .build(); } @@ -943,35 +967,36 @@ public static Submodel createSubmodel5() { public static Submodel createSubmodel6() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelMissing") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Missing") - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0").build()) + .version("0") + .revision("9") + .build()) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1007,16 +1032,16 @@ public static Submodel createSubmodel6() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1049,7 +1074,6 @@ public static Submodel createSubmodel6() { .type(ReferenceTypes.MODEL_REFERENCE) .build()) .annotations(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .idShort("ExampleProperty") .category("PARAMETER") .value("some example annotation") @@ -1058,33 +1082,32 @@ public static Submodel createSubmodel6() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1098,16 +1121,16 @@ public static Submodel createSubmodel6() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1121,16 +1144,16 @@ public static Submodel createSubmodel6() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty3") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1144,16 +1167,16 @@ public static Submodel createSubmodel6() { .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultBasicEventElement.Builder() @@ -1161,16 +1184,16 @@ public static Submodel createSubmodel6() { .category("PARAMETER") .direction(Direction.INPUT) .state(StateOfEvent.ON) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1185,7 +1208,7 @@ public static Submodel createSubmodel6() { .type(KeyTypes.PROPERTY) .value("ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultSubmodelElementList.Builder() @@ -1193,30 +1216,30 @@ public static Submodel createSubmodel6() { .category("PARAMETER") .orderRelevant(true) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1228,68 +1251,69 @@ public static Submodel createSubmodel6() { .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .value(Arrays.asList( - new DefaultLangString.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), - new DefaultLangString.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() + .values(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .min("0") .max("100") .valueType(DataTypeDefXsd.INT) .build()) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .contentType("application/pdf") .value(Base64.getDecoder().decode("AQIDBAU=")) @@ -1297,16 +1321,16 @@ public static Submodel createSubmodel6() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example File object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("file:///TestFile.pdf") .contentType("application/pdf") @@ -1314,16 +1338,16 @@ public static Submodel createSubmodel6() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1348,39 +1372,38 @@ public static Submodel createSubmodel6() { public static Submodel createSubmodel7() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelTemplate") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Template") - .kind(ModelingKind.TEMPLATE) + .kind(ModellingKind.TEMPLATE) .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) + .kind(ModellingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1415,18 +1438,17 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1460,36 +1482,33 @@ public static Submodel createSubmodel7() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1498,18 +1517,17 @@ public static Submodel createSubmodel7() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1518,18 +1536,17 @@ public static Submodel createSubmodel7() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1538,36 +1555,34 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .submodelElements(new DefaultBasicEventElement.Builder() .idShort("ExampleBasicEvent") .category("PARAMETER") .direction(Direction.OUTPUT) .state(StateOfEvent.OFF) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1588,68 +1603,64 @@ public static Submodel createSubmodel7() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .min(null) .max("100") .valueType(DataTypeDefXsd.INT) @@ -1657,105 +1668,100 @@ public static Submodel createSubmodel7() { .value(new DefaultRange.Builder() .idShort("ExampleRange2") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .min("0") .max(null) .valueType(DataTypeDefXsd.INT) .build()) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .contentType("application/pdf") .build()) .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example File object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .contentType("application/pdf") .build()) .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection2") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .build(); } @@ -1763,21 +1769,21 @@ public static Submodel createSubmodel7() { public static ConceptDescription createConceptDescription1() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example concept description for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_ConceptDescription") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -1792,14 +1798,15 @@ public static ConceptDescription createConceptDescription2() { public static ConceptDescription createConceptDescription3() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription1") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example concept description for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) + .category("PROPERTY") .id("https://acplt.org/Test_ConceptDescription_Missing") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .build(); } @@ -1809,71 +1816,66 @@ public static ConceptDescription createConceptDescription4() { .idShort("TestSpec_01") .id("http://acplt.org/DataSpecifciations/Example/Identification") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() .dataSpecification(new DefaultReference.Builder() - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .preferredName(Arrays.asList( - new DefaultLangString.Builder().text("Test Specification").language("de").build(), - new DefaultLangString.Builder().text("TestSpecification").language("en-us").build() + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredNames(Arrays.asList( + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() )) - .dataType(DataTypeIEC61360.REAL_MEASURE) - .definition(new DefaultLangString.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) - .definition(new DefaultLangString.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) - .shortName(new DefaultLangString.Builder().text("Test Spec").language("de").build()) - .shortName(new DefaultLangString.Builder().text("TestSpec").language("en-us").build()) + .dataType(DataTypeIec61360.REAL_MEASURE) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) .unit("SpaceUnit") .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/Units/SpaceUnit") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") .symbol("SU") .valueFormat("string") .value("TEST") -// .levelType(LevelType.MIN) - .levelType(LevelType.MAX) .valueList(new DefaultValueList.Builder() .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - // TODO valueType? .build()) .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId2") + .value("http://acplt.org/valueId/ExamplevalueId2") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId2") + .value("http://acplt.org/valueId/ExamplevalueId2") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - // TODO valueType? .build()) .build()) .build()) @@ -1904,4 +1906,4 @@ public static Environment createEnvironment() { .build(); } -} \ No newline at end of file +} diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index d48733dae..a57f4a418 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,39 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResource; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; +import org.junit.Assert; +import org.junit.Test; public class AASSimple { @@ -29,7 +59,7 @@ public class AASSimple { private static final String WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DOCUMENT = "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"; private static final String ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED = "Actual rotationspeed with which the motor or feedingunit is operated"; private static final String AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD = "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird"; - private static final String ACTUAL_ROTATION_SPEED = "ActualRotationSpeed"; + private static final String ACTUAL_ROTATION_SPEED = "ActRotationSpeed"; private static final String ACTUALROTATIONSPEED = "Actualrotationspeed"; private static final String AKTUELLE_DREHZAHL = "AktuelleDrehzahl"; private static final String _1_MIN = "1/min"; @@ -51,10 +81,8 @@ public class AASSimple { private static final String TITEL = "Titel"; private static final String WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DESCRIPTION_TITLE = "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"; private static final String TITLE = "Title"; - private static final String SERVO_DC_MOTOR = "ServoDCMotor"; private static final String FILE_MASTER_VERWALTUNGSSCHALE_DETAIL_PART1_PNG = "file:///master/verwaltungsschale-detail-part1.png"; private static final String IMAGE_PNG = "image/png"; - private static final String THUMBNAIL = "thumbnail"; private static final String HTTP_CUSTOMER_COM_SYSTEMS_IO_T_1 = "http://customer.com/Systems/IoT/1"; private static final String QJ_YG_PGGJWKI_HK4_RR_QI_YS_LG = "QjYgPggjwkiHk4RrQiYSLg=="; private static final String DEVICE_ID = "DeviceID"; @@ -84,7 +112,6 @@ public class AASSimple { private static final String SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID = WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DESCRIPTION_TITLE; private static final String SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT = TITLE; private static final String SUBMODEL_DOCUMENTATION_PROPERTY_VALUE = "OperatingManual"; - private static final String SUBMODEL_DOCUMENTATION_PROPERTY_VALUETYPE = "langString"; private static final String SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID = WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_STORED_DOCUMENT_REPRESENTATION_DIGITAL_FILE; private static final String SUBMODEL_DOCUMENTATION_FILE_ID_SHORT = "DigitalFile_PDF"; private static final String SUBMODEL_DOCUMENTATION_FILE_contentType = "application/pdf"; @@ -97,7 +124,6 @@ public class AASSimple { private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT = ROTATION_SPEED; private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY = "VARIABLE"; private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE = "4370"; - private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUETYPE = "integer"; public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"; public AASSimple() { @@ -112,7 +138,6 @@ public AASSimple() { public static final ConceptDescription CONCEPT_DESCRIPTION_MAXROTATIONSPEED = createConceptDescriptionMaxRotationSpeed(); public static final ConceptDescription CONCEPT_DESCRIPTION_ROTATIONSPEED = createConceptDescriptionRotationSpeed(); public static final ConceptDescription CONCEPT_DESCRIPTION_DOCUMENT = createConceptDescriptionDocument(); - public static final Environment ENVIRONMENT = createEnvironment(); public static AssetAdministrationShell createAAS() { return new DefaultAssetAdministrationShell.Builder() @@ -120,13 +145,7 @@ public static AssetAdministrationShell createAAS() { .id(AAS_IDENTIFIER) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) .specificAssetIds(new DefaultSpecificAssetId.Builder() .name(EQUIPMENT_ID) .value(_538FD1B3_F99F_4A52_9C75_72E9FA921270) @@ -135,7 +154,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_ERP_012) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .specificAssetIds(new DefaultSpecificAssetId.Builder() @@ -146,7 +165,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_IO_T_1) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .defaultThumbnail(new DefaultResource.Builder() @@ -159,7 +178,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_TECHNICAL_DATA_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels( new DefaultReference.Builder() @@ -167,20 +186,19 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_OPERATIONAL_DATA_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels( new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.SUBMODEL) - .value(SUBMODEL_DOCUMENTATION_ID) - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL) + .value(SUBMODEL_DOCUMENTATION_ID) + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build()) .build(); } - public static Submodel createSubmodelTechnicalData() { return new DefaultSubmodel.Builder() .semanticId(new DefaultReference.Builder() @@ -188,19 +206,17 @@ public static Submodel createSubmodelTechnicalData() { .type(KeyTypes.GLOBAL_REFERENCE) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.INSTANCE) .idShort(SUBMODEL_TECHNICAL_DATA_ID_SHORT) .id(SUBMODEL_TECHNICAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_PROPERTY) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_TECHNICAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_TECHNICAL_DATA_PROPERTY_CATEGORY) @@ -212,17 +228,16 @@ public static Submodel createSubmodelTechnicalData() { public static Submodel createSubmodelOperationalData() { return new DefaultSubmodel.Builder() - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .idShort(SUBMODEL_OPERATIONAL_DATA_ID_SHORT) .id(SUBMODEL_OPERATIONAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_OPERATIONAL_DATA_SEMANTIC_ID_PROPERTY) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY) @@ -234,40 +249,37 @@ public static Submodel createSubmodelOperationalData() { public static Submodel createSubmodelDocumentation() { return new DefaultSubmodel.Builder() - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .idShort(SUBMODEL_DOCUMENTATION_ID_SHORT) .id(SUBMODEL_DOCUMENTATION_ID) .submodelElements(new DefaultSubmodelElementCollection.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_ID_SHORT) .value(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT) .value(SUBMODEL_DOCUMENTATION_PROPERTY_VALUE) .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultFile.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_FILE_ID_SHORT) .contentType(SUBMODEL_DOCUMENTATION_FILE_contentType) @@ -289,17 +301,17 @@ public static ConceptDescription createConceptDescriptionTitle() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .preferredName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) - .preferredName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) - .shortName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(TITLE).language("EN").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(TITEL).language("DE").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(TITLE).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(TITEL).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) - .definition(new DefaultLangString.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) + .dataType(DataTypeIec61360.STRING_TRANSLATABLE) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) .build()) .build()) .build(); @@ -315,18 +327,18 @@ public static ConceptDescription createConceptDescriptionDigitalFile() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent( - new DefaultDataSpecificationIEC61360.Builder() - .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) - .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DIGITALE_DATEI).language("DE").build()) + new DefaultDataSpecificationIec61360.Builder() + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DIGITALE_DATEI).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.STRING) - .definition(new DefaultLangString.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) + .dataType(DataTypeIec61360.STRING) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) .build()) .build()) .build(); @@ -337,7 +349,7 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .idShort(MAX_ROTATION_SPEED).category(PROPERTY) .administration(new DefaultAdministrativeInformation.Builder() .version("2") - .revision("2.1") + .revision("1") .build()) .id(_0173_1_02_BAA120_008) .embeddedDataSpecifications( @@ -347,23 +359,23 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .preferredName(new DefaultLangString.Builder().text(MAX_DREHZAHL).language("de").build()) - .preferredName(new DefaultLangString.Builder().text(MAX_ROTATIONSPEED).language("en").build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_DREHZAHL).language("de").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_ROTATIONSPEED).language("en").build()) .unit(_1_MIN) .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.REAL_MEASURE) - .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) - .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) + .dataType(DataTypeIec61360.REAL_MEASURE) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) .build()) .build()) .build(); @@ -381,26 +393,26 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent( - new DefaultDataSpecificationIEC61360.Builder() - .preferredName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) - .preferredName(new DefaultLangString.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) - .shortName(new DefaultLangString.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) + new DefaultDataSpecificationIec61360.Builder() + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) .unit(_1_MIN) .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.REAL_MEASURE) - .definition(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) - .definition(new DefaultLangString.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) + .dataType(DataTypeIec61360.REAL_MEASURE) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) .build()) .build()) .build(); @@ -416,16 +428,16 @@ public static ConceptDescription createConceptDescriptionDocument() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .preferredName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DOKUMENT).language("DE").build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DOCUMENT).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DOCUMENT).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DOKUMENT).language("DE").build()) .unit("ExampleString") .sourceOfDefinition(ISO15519_1_2010) - .dataType(DataTypeIEC61360.STRING) - .definition(new DefaultLangString.Builder().text(DOCUMENT_DEF).language("EN").build()) + .dataType(DataTypeIec61360.STRING) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(DOCUMENT_DEF).language("EN").build()) .build()) .build()) .build(); @@ -444,4 +456,11 @@ public static Environment createEnvironment() { .conceptDescriptions(createConceptDescriptionDocument()) .build(); } + + @Test + public void testAasSimpleExtensionsInitialized() { + List extensions = AASSimple.createEnvironment().getAssetAdministrationShells().get(0).getExtensions(); + Assert.assertTrue(extensions != null); + } + } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java index d22adf747..b9bc9de24 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +16,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.*; import java.util.List; import java.util.Objects; @@ -35,7 +28,7 @@ public class CustomProperty implements Property { protected List dataSpecifications; - protected ModelingKind kind; + protected ModellingKind kind; protected Reference semanticId; @@ -49,9 +42,9 @@ public class CustomProperty implements Property { protected String category; - protected List description; + protected List description; - protected List displayName; + protected List displayName; protected String idShort; @@ -84,7 +77,7 @@ public boolean equals(Object obj) { && Objects.equals(this.description, other.description) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.qualifiers, other.qualifiers) - // TODO && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) + && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.kind, other.kind) && Objects.equals(this.semanticId, other.semanticId); } } @@ -130,32 +123,22 @@ final public void setCategory(String category) { } @Override - final public List getDescription() { + final public List getDescriptions() { return description; } @Override - final public void setDescription(List description) { + final public void setDescriptions(List description) { this.description = description; } @Override - public String getChecksum() { - return null; - } - - @Override - public void setChecksum(String checksum) { - - } - - @Override - final public List getDisplayName() { + final public List getDisplayNames() { return displayName; } @Override - final public void setDisplayName(List displayName) { + final public void setDisplayNames(List displayName) { this.displayName = displayName; } @@ -189,16 +172,6 @@ final public void setEmbeddedDataSpecifications(List this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - final public ModelingKind getKind() { - return kind; - } - - @Override - final public void setKind(ModelingKind kind) { - this.kind = kind; - } - @Override final public Reference getSemanticId() { return semanticId; diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java index efd6ef3a1..5908adfb9 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java @@ -1,25 +1,9 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; +import java.io.IOException; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import org.junit.Assert; @@ -27,7 +11,8 @@ import org.junit.Test; import org.mockito.Mockito; -import java.io.IOException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; public class EnumDeserializerTest { @@ -40,22 +25,38 @@ public void setUp() { deserializationContextMock = Mockito.mock(DeserializationContext.class); } + @Test + public void whenDeserializingEnumNames_withUpperCamelCase_shouldReturnScreamingSnakeCase() { + Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("AnyEnum")); + } + + @Test + public void whenDeserializingEnumNames_withLowerCamelCase_shouldReturnScreamingSnakeCase() { + Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("anyEnum")); + } + + @Test + public void whenDeserializingEnumNames_withScreamingSnakeCase_shouldReturnUnchanged() { + final String name = "ANY_ENUM"; + Assert.assertEquals(name, EnumDeserializer.deserializeEnumName(name)); + } + @Test public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { - assertDeserialization("BOOLEAN", DataTypeIEC61360.BOOLEAN); - assertDeserialization("DATE", DataTypeIEC61360.DATE); - assertDeserialization("INTEGER_CURRENCY", DataTypeIEC61360.INTEGER_CURRENCY); - assertDeserialization("INTEGER_COUNT", DataTypeIEC61360.INTEGER_COUNT); - assertDeserialization("INTEGER_MEASURE", DataTypeIEC61360.INTEGER_MEASURE); - assertDeserialization("RATIONAL", DataTypeIEC61360.RATIONAL); - assertDeserialization("RATIONAL_MEASURE", DataTypeIEC61360.RATIONAL_MEASURE); - assertDeserialization("REAL_COUNT", DataTypeIEC61360.REAL_COUNT); - assertDeserialization("REAL_MEASURE", DataTypeIEC61360.REAL_MEASURE); - assertDeserialization("STRING", DataTypeIEC61360.STRING); - assertDeserialization("STRING_TRANSLATABLE", DataTypeIEC61360.STRING_TRANSLATABLE); - assertDeserialization("TIME", DataTypeIEC61360.TIME); - assertDeserialization("TIMESTAMP", DataTypeIEC61360.TIMESTAMP); - assertDeserialization("IRI", DataTypeIEC61360.IRI); + assertDeserialization("BOOLEAN", DataTypeIec61360.BOOLEAN); + assertDeserialization("DATE", DataTypeIec61360.DATE); + assertDeserialization("INTEGER_CURRENCY", DataTypeIec61360.INTEGER_CURRENCY); + assertDeserialization("INTEGER_COUNT", DataTypeIec61360.INTEGER_COUNT); + assertDeserialization("INTEGER_MEASURE", DataTypeIec61360.INTEGER_MEASURE); + assertDeserialization("RATIONAL", DataTypeIec61360.RATIONAL); + assertDeserialization("RATIONAL_MEASURE", DataTypeIec61360.RATIONAL_MEASURE); + assertDeserialization("REAL_COUNT", DataTypeIec61360.REAL_COUNT); + assertDeserialization("REAL_MEASURE", DataTypeIec61360.REAL_MEASURE); + assertDeserialization("STRING", DataTypeIec61360.STRING); + assertDeserialization("STRING_TRANSLATABLE", DataTypeIec61360.STRING_TRANSLATABLE); + assertDeserialization("TIME", DataTypeIec61360.TIME); + assertDeserialization("TIMESTAMP", DataTypeIec61360.TIMESTAMP); + assertDeserialization("IRI", DataTypeIec61360.IRI); } @Test @@ -70,7 +71,8 @@ public void whenSerializingEnum_usingStateOfEvent_shouldReturnLowerCase() { assertDeserialization("off", StateOfEvent.OFF); } - private void assertDeserialization(String value, Enum expected) { + @SuppressWarnings("rawtypes") + private void assertDeserialization(String value, Enum expected) { try { Mockito.doReturn(value).when(jsonParserMock).getText(); Class type = expected.getClass(); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 422766102..2fb858cc0 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -1,34 +1,18 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; +import java.io.IOException; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; -import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import java.io.IOException; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; public class EnumSerializerTest { @@ -52,40 +36,35 @@ public void setUp() throws Exception { @Test public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { - assertSerialization(DataTypeIEC61360.BOOLEAN, "BOOLEAN"); - assertSerialization(DataTypeIEC61360.DATE, "DATE"); - assertSerialization(DataTypeIEC61360.INTEGER_CURRENCY, "INTEGER_CURRENCY"); - assertSerialization(DataTypeIEC61360.INTEGER_COUNT, "INTEGER_COUNT"); - assertSerialization(DataTypeIEC61360.INTEGER_MEASURE, "INTEGER_MEASURE"); - assertSerialization(DataTypeIEC61360.RATIONAL, "RATIONAL"); - assertSerialization(DataTypeIEC61360.RATIONAL_MEASURE, "RATIONAL_MEASURE"); - assertSerialization(DataTypeIEC61360.REAL_COUNT, "REAL_COUNT"); - assertSerialization(DataTypeIEC61360.REAL_MEASURE, "REAL_MEASURE"); - assertSerialization(DataTypeIEC61360.STRING, "STRING"); - assertSerialization(DataTypeIEC61360.STRING_TRANSLATABLE, "STRING_TRANSLATABLE"); - assertSerialization(DataTypeIEC61360.TIME, "TIME"); - assertSerialization(DataTypeIEC61360.TIMESTAMP, "TIMESTAMP"); - assertSerialization(DataTypeIEC61360.IRI, "IRI"); + assertSerialization(DataTypeIec61360.BOOLEAN, "BOOLEAN"); + assertSerialization(DataTypeIec61360.DATE, "DATE"); + assertSerialization(DataTypeIec61360.INTEGER_CURRENCY, "INTEGER_CURRENCY"); + assertSerialization(DataTypeIec61360.INTEGER_COUNT, "INTEGER_COUNT"); + assertSerialization(DataTypeIec61360.INTEGER_MEASURE, "INTEGER_MEASURE"); + assertSerialization(DataTypeIec61360.RATIONAL, "RATIONAL"); + assertSerialization(DataTypeIec61360.RATIONAL_MEASURE, "RATIONAL_MEASURE"); + assertSerialization(DataTypeIec61360.REAL_COUNT, "REAL_COUNT"); + assertSerialization(DataTypeIec61360.REAL_MEASURE, "REAL_MEASURE"); + assertSerialization(DataTypeIec61360.STRING, "STRING"); + assertSerialization(DataTypeIec61360.STRING_TRANSLATABLE, "STRING_TRANSLATABLE"); + assertSerialization(DataTypeIec61360.TIME, "TIME"); + assertSerialization(DataTypeIec61360.TIMESTAMP, "TIMESTAMP"); + assertSerialization(DataTypeIec61360.IRI, "IRI"); } @Test - public void whenSerializingEnum_usingDirection_shouldReturnUpperCase() { - assertSerialization(Direction.INPUT, "INPUT"); - assertSerialization(Direction.OUTPUT, "OUTPUT"); + public void whenSerializingEnum_usingDirection_shouldReturnLowerCase() { + assertSerialization(Direction.INPUT, "input"); + assertSerialization(Direction.OUTPUT, "output"); } @Test - public void whenSerializingEnum_usingStateOfEvent_shouldReturnUpperCase() { - assertSerialization(StateOfEvent.ON, "ON"); - assertSerialization(StateOfEvent.OFF, "OFF"); + public void whenSerializingEnum_usingStateOfEvent_shouldReturnLowerCase() { + assertSerialization(StateOfEvent.ON, "on"); + assertSerialization(StateOfEvent.OFF, "off"); } - @Test - public void whenSerializingEnum_usingModelingKind_shouldReturnCamelCase() { - assertSerialization(ModelingKind.INSTANCE, "Instance"); - assertSerialization(ModelingKind.TEMPLATE, "Template"); - } - private void assertSerialization(Enum value, String expected) { + private void assertSerialization(Enum value, String expected) { this.serializationOutput.setLength(0); try { this.enumSerializer.serialize(value, jsonGeneratorMock, serializerProviderMock); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java index 748aa4bf9..dc5eed87f 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java @@ -15,8 +15,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.model; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; - public interface TypedProperty extends Property { } diff --git a/dataformat-json/pom.xml b/dataformat-json/pom.xml index db3ad313d..6b807cc93 100644 --- a/dataformat-json/pom.xml +++ b/dataformat-json/pom.xml @@ -13,12 +13,12 @@ - ${groupId} + ${project.groupId} dataformat-core ${revision} - ${groupId} + ${project.groupId} dataformat-core ${revision} tests diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index 406ea22e3..d44cafa7f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,36 +15,40 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.List; -import java.util.Map; +import java.util.stream.Collectors; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -// TODO import io.adminshell.aas.v3.dataformat.core.deserialization.EmbeddedDataSpecificationDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; - - /** * Class for deserializing/parsing AAS JSON documents. */ -public class JsonDeserializer implements Deserializer, ReferableDeserializer, ReferenceDeserializer, SpecificAssetIdDeserializer, SubmodelDescriptorDeserializer, AssetAdministrationShellDescriptorDeserializer { +public class JsonDeserializer { protected JsonMapper mapper; protected SimpleAbstractTypeResolver typeResolver; - // TODO - protected static Map, com.fasterxml.jackson.databind.JsonDeserializer> customDeserializers = Map.of( - /* EmbeddedDataSpecification.class, new EmbeddedDataSpecificationDeserializer() */); + + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; public JsonDeserializer() { initTypeResolver(); @@ -59,22 +62,15 @@ protected void buildMapper() { .annotationIntrospector(new ReflectionAnnotationIntrospector()) .addModule(buildEnumModule()) .addModule(buildImplementationModule()) - .addModule(buildCustomDeserializerModule()) .build(); ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); } - protected SimpleModule buildCustomDeserializerModule() { - SimpleModule module = new SimpleModule(); - customDeserializers.forEach(module::addDeserializer); - return module; - } - - private void initTypeResolver() { + @SuppressWarnings("unchecked") + private void initTypeResolver() { typeResolver = new SimpleAbstractTypeResolver(); ReflectionHelper.DEFAULT_IMPLEMENTATIONS .stream() - .filter(x -> !customDeserializers.containsKey(x.getInterfaceType())) .forEach(x -> typeResolver.addMapping(x.getInterfaceType(), x.getImplementationType())); } @@ -90,119 +86,255 @@ protected SimpleModule buildImplementationModule() { return module; } - @Override + + /** + * Deserializes a given string into an instance of + * AssetAdministrationShellEnvironment + * + * @param value a string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ public Environment read(String value) throws DeserializationException { try { - // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore - //return mapper.treeToValue(ModelTypeProcessor.preprocess(value), Environment.class); - return mapper.treeToValue(new ObjectMapper().readTree(value), Environment.class); + return mapper.readValue(value, Environment.class); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); } } - @Override + /** + * Deserializes a given InputStream into an instance of + * AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * + * @param src an InputStream containing the string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + public Environment read(InputStream src) throws DeserializationException { + return read(src, DEFAULT_CHARSET); + } + + /** + * Deserializes a given InputStream into an instance of + * AssetAdministrationShellEnvironment using a given charset + * + * @param src An InputStream containing the string representation of the + * AssetAdministrationShellEnvironment + * @param charset the charset to use for deserialization + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + public Environment read(InputStream src, Charset charset) throws DeserializationException { + return read(new BufferedReader( + new InputStreamReader(src, charset)) + .lines() + .collect(Collectors.joining(System.lineSeparator()))); + } + + /** + * Deserializes a given File into an instance of + * AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * + * @param file A java.io.File containing the string representation of the + * AssetAdministrationShellEnvironment + * @param charset the charset to use for deserialization + * @return an instance of AssetAdministrationShellEnvironment + * @throws FileNotFoundException if file is not present + * @throws DeserializationException if deserialization fails + */ + public Environment read(java.io.File file, Charset charset) + throws FileNotFoundException, DeserializationException { + return read(new FileInputStream(file), charset); + } + + /** + * Deserializes a given File into an instance of + * AssetAdministrationShellEnvironment using a given charset + * + * @param file a java.io.File containing the string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws FileNotFoundException if the file is not present + * @throws DeserializationException if deserialization fails + */ + public Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { + return read(file, DEFAULT_CHARSET); + } + + /** + * Enables usage of custom implementation to be used for deserialization + * instead of default implementation, e.g. defining a custom implementation + * of the Submodel interface {@code class + * CustomSubmodel implements Submodel {}} and calling + * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will + * result in all instances of Submodel will be deserialized as + * CustomSubmodel. Subsequent class with the same aasInterface parameter + * will override the effects of all previous calls. + * + * @param the type of the interface to replace + * @param aasInterface the class of the interface to replace + * @param implementation the class implementing the interface that should be + * used for deserialization. + */ public void useImplementation(Class aasInterface, Class implementation) { typeResolver.addMapping(aasInterface, implementation); buildMapper(); } - @Override - public T readReferable(String referable, Class outputClass) throws DeserializationException { + /** + * Deserializes a given string into an instance of the given Referable + * + * @param src a string representation of the Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ public T readReferable(String src, Class outputClass) throws DeserializationException { try { - // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore - //return mapper.treeToValue(ModelTypeProcessor.preprocess(referable), outputClass); - return mapper.treeToValue(new ObjectMapper().readTree(referable), outputClass); + return mapper.readValue(src, outputClass); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing Referable", ex); } } - @Override - public List readReferables(String referables, Class outputClass) throws DeserializationException { - try { - // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore - // String parsed = mapper.writeValueAsString(ModelTypeProcessor.preprocess(referables)) ; - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(referables)) ; - return mapper.readValue(parsed,new TypeReference>(){}); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of Referables", ex); - } + /** + * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET + * + * @param src a input stream representing a Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ + public T readReferable(InputStream src, Class outputClass) throws DeserializationException { + return readReferable(src, DEFAULT_CHARSET, outputClass); } - @Override - public Reference readReference(String reference) throws DeserializationException { - try { - return mapper.treeToValue(new ObjectMapper().readTree(reference), Reference.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing the Reference", ex); - } + /** + * Deserializes a given input stream into an instance of the given Referable + * + * @param src a input stream representing a Referable + * @param charset the charset to use + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ + public T readReferable(InputStream src, Charset charset, Class outputClass) throws DeserializationException { + return readReferable(new BufferedReader( + new InputStreamReader(src, charset)) + .lines() + .collect(Collectors.joining(System.lineSeparator())), + outputClass); } - @Override - public List readReferences(String references) throws DeserializationException { - try { - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(references)) ; - return mapper.readValue(parsed,new TypeReference>(){}); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of References", ex); - } + /** + * Deserializes a given file into an instance of the given Referable using DEFAULT_CHARSET + * + * @param src a file containing string representation of a Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + * @throws java.io.FileNotFoundException if file is not found + */ + public T readReferable(File src, Class outputClass) throws DeserializationException, FileNotFoundException { + return readReferable(src, DEFAULT_CHARSET, outputClass); } - @Override - public SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException { - try { - return mapper.treeToValue(new ObjectMapper().readTree(specificAssetId), SpecificAssetId.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing the SpecificAssetId", ex); - } + /** + * Deserializes a given file into an instance of the given Referable + * + * @param src a file containing string representation of a Referable + * @param charset the charset to use + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + * @throws java.io.FileNotFoundException if file is not found + */ + public T readReferable(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { + return readReferable(new FileInputStream(src), charset, outputClass); } - @Override - public List readSpecificAssetIds(String specificAssetIds) throws DeserializationException { + /** + * Deserializes a given string into an instance of a list of the given Referables + * + * @param referables a string representation of an array of Referables + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of a list of the referables + * @throws DeserializationException if deserialization of referable fails + */ public List readReferables(String referables, Class outputClass) throws DeserializationException { try { - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(specificAssetIds)) ; - return mapper.readValue(parsed,new TypeReference>(){}); + return mapper.readValue(referables, new TypeReference>() { + }); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of SpecificAssetIds", ex); + throw new DeserializationException("error deserializing list of Referable", ex); } } - @Override - public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException { - try { - return mapper.treeToValue(new ObjectMapper().readTree(submodelDescriptor), SubmodelDescriptor.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing the SubmodelDescriptor", ex); - } + + /** + * Deserializes a given input stream into an instance of a list of the given Referable using DEFAULT_CHARSET + * + * @param src a input stream representing a Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ + public List readReferables(InputStream src, Class outputClass) throws DeserializationException { + return readReferables(src, DEFAULT_CHARSET, outputClass); } - @Override - public List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException { - try { - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(submodelDescriptors)) ; - return mapper.readValue(parsed,new TypeReference>(){}); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of SubmodelDescriptors", ex); - } + /** + * Deserializes a given input stream into an instance of a list of the given Referable + * + * @param src a input stream representing a Referable + * @param charset the charset to use + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ + public List readReferables(InputStream src, Charset charset, Class outputClass) throws DeserializationException { + return readReferables(new BufferedReader( + new InputStreamReader(src, charset)) + .lines() + .collect(Collectors.joining(System.lineSeparator())), + outputClass); } - @Override - public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException { - try { - return mapper.treeToValue(new ObjectMapper().readTree(assetAdministrationShellDescriptor), AssetAdministrationShellDescriptor.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing the AssetAdministrationShellDescriptor", ex); - } + /** + * Deserializes a given file into an instance of a list of the given Referable using DEFAULT_CHARSET + * + * @param src a file containing string representation of a Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + * @throws java.io.FileNotFoundException if file is not found + */ + public List readReferables(File src, Class outputClass) throws DeserializationException, FileNotFoundException { + return readReferables(src, DEFAULT_CHARSET, outputClass); } - @Override - public List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException { - try { - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(assetAdministrationShellDescriptors)) ; - return mapper.readValue(parsed,new TypeReference>(){}); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of AssetAdministrationShellDescriptors", ex); - } + /** + * Deserializes a given file into an instance of a list of the given Referable + * + * @param src a file containing string representation of a Referable + * @param charset the charset to use + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + * @throws java.io.FileNotFoundException if file is not found + */ + public List readReferables(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { + return readReferables(new FileInputStream(src), charset, outputClass); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 31310e560..563e3506e 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,32 +15,35 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.Collection; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleModule; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -// TODO import io.adminshell.aas.v3.dataformat.core.serialization.EmbeddedDataSpecificationSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; - -import java.util.List; /** - * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to - * JSON. + * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to JSON. */ -public class JsonSerializer implements Serializer, ReferableSerializer, ReferenceSerializer, SpecificAssetIdSerializer, SubmodelDescriptorSerializer, AssetAdministrationShellDescriptorSerializer { +public class JsonSerializer { protected JsonMapper mapper; + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + public JsonSerializer() { buildMapper(); } @@ -51,194 +53,136 @@ protected void buildMapper() { .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .serializationInclusion(JsonInclude.Include.NON_NULL) .addModule(buildEnumModule()) - .addModule(buildCustomSerializerModule()) .annotationIntrospector(new ReflectionAnnotationIntrospector()) .build(); ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); } - protected SimpleModule buildCustomSerializerModule() { - SimpleModule module = new SimpleModule(); - // TODO: module.addSerializer(EmbeddedDataSpecification.class, new EmbeddedDataSpecificationSerializer()); - return module; - } - protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); module.addSerializer(Enum.class, new EnumSerializer()); return module; } - @Override + /** + * Serializes a given instance of AssetAdministrationShellEnvironment to + * string + * + * @param aasEnvironment the AssetAdministrationShellEnvironment to + * serialize + * @return the string representation of the environment + * @throws SerializationException if serialization fails + */ public String write(Environment aasEnvironment) throws SerializationException { try { - // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore - // return mapper.writeValueAsString(ModelTypeProcessor.postprocess(mapper.valueToTree(aasEnvironment))); - return mapper.writeValueAsString(mapper.valueToTree(aasEnvironment)); + return mapper.writeValueAsString(aasEnvironment); } catch (JsonProcessingException ex) { throw new SerializationException("error serializing AssetAdministrationShellEnvironment", ex); } } - @Override - public String writeReferable(Referable referable) throws SerializationException { - try { - return mapper.writeValueAsString(mapper.valueToTree(referable)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); - } - } - - @Override - public String writeReferables(List referables) throws SerializationException { - if(referables.isEmpty()){ - return null; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.get(0).getClass())); - String json = objectWriter.writeValueAsString(referables); - - return mapper.writeValueAsString(this.mapper.readTree(json)); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of Referables", ex); - } - } - - @Override - public String writeReference(Reference reference) throws SerializationException { - try { - return mapper.writeValueAsString(mapper.valueToTree(reference)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); - } - } - - @Override - public String writeReferences(List references) throws SerializationException { - if(references.isEmpty()){ - return null; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, Reference.class)); - String json = objectWriter.writeValueAsString(references); - - return mapper.writeValueAsString(this.mapper.readTree(json)); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of References", ex); - } - } - - @Override - public String writeSpecificAssetId(SpecificAssetId specificAssetId) throws SerializationException { - try { - return mapper.writeValueAsString(mapper.valueToTree(specificAssetId)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing SpecificAssetId", ex); - } + /** + * Serializes a given instance of Environment to an + * OutputStream using DEFAULT_CHARSET + * + * @param out the Outputstream to serialize to + * @param aasEnvironment the Environment to + * serialize + * @throws IOException if writing to the stream fails + * @throws SerializationException if serialization fails + */ + void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { + write(out, DEFAULT_CHARSET, aasEnvironment); } - @Override - public String writeSpecificAssetIds(List specificAssetIds) throws SerializationException { - if(specificAssetIds.isEmpty()){ - return null; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SpecificAssetId.class)); - String json = objectWriter.writeValueAsString(specificAssetIds); - - return mapper.writeValueAsString(this.mapper.readTree(json)); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of SpecificAssetIds", ex); + /** + * Serializes a given instance of Environment to an + * OutputStream using given charset + * + * @param out the Outputstream to serialize to + * @param charset the Charset to use for serialization + * @param aasEnvironment the Environment to + * serialize + * @throws IOException if writing to the stream fails + * @throws SerializationException if serialization fails + */ + void write(OutputStream out, Charset charset, Environment aasEnvironment) + throws IOException, SerializationException { + try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { + writer.write(write(aasEnvironment)); } } - @Override - public String writeSubmodelDescriptor(SubmodelDescriptor submodelDescriptor) throws SerializationException { - try { - return mapper.writeValueAsString(mapper.valueToTree(submodelDescriptor)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing SubmodelDescriptor", ex); + // Note that the AAS also defines a file class + /** + * Serializes a given instance of Environment to a + * java.io.File using DEFAULT_CHARSET + * + * @param file the java.io.File to serialize to + * @param charset the Charset to use for serialization + * @param aasEnvironment the Environment to + * serialize + * @throws FileNotFoundException if the fail does not exist + * @throws IOException if writing to the file fails + * @throws SerializationException if serialization fails + */ + void write(java.io.File file, Charset charset, Environment aasEnvironment) + throws FileNotFoundException, IOException, SerializationException { + try (OutputStream out = new FileOutputStream(file)) { + write(out, charset, aasEnvironment); } } - @Override - public String writeSubmodelDescriptors(List submodelDescriptors) throws SerializationException { - if(submodelDescriptors.isEmpty()){ - return null; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SubmodelDescriptor.class)); - String json = objectWriter.writeValueAsString(submodelDescriptors); - - return mapper.writeValueAsString(this.mapper.readTree(json)); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of SubmodelDescriptors", ex); - } + /** + * Serializes a given instance of Environment to a + * java.io.File using given charset + * + * @param file the java.io.File to serialize to + * @param aasEnvironment the Environment to + * serialize + * @throws FileNotFoundException if the fail does not exist + * @throws IOException if writing to the file fails + * @throws SerializationException if serialization fails + */ + void write(java.io.File file, Environment aasEnvironment) + throws FileNotFoundException, IOException, SerializationException { + write(file, DEFAULT_CHARSET, aasEnvironment); } - @Override - public String writeAssetAdministrationShellDescriptor(AssetAdministrationShellDescriptor assetAdministrationShellDescriptor) throws SerializationException { + /** + * Serializes a given instance of a Referable to string + * + * @param referable the referable to serialize + * @return the string representation of the referable + * @throws SerializationException if serialization fails + */ + public String write(Referable referable) throws SerializationException { try { - return mapper.writeValueAsString(mapper.valueToTree(assetAdministrationShellDescriptor)); + return mapper.writeValueAsString(referable); } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing AssetAdministrationShellDescriptor", ex); + throw new SerializationException("error serializing Referable", ex); } } - @Override - public String writeAssetAdministrationShellDescriptors(List assetAdministrationShellDescriptors) throws SerializationException { - if(assetAdministrationShellDescriptors.isEmpty()){ + /** + * + * @param referables the referables to serialize + * @return the string representation of the list of referables + * @throws SerializationException if serialization fails + */ + public String write(Collection referables) throws SerializationException { + if (referables == null) { return null; - } + } else if (referables.isEmpty()) { + return mapper.createArrayNode().toString(); + } try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, AssetAdministrationShellDescriptor.class)); - String json = objectWriter.writeValueAsString(assetAdministrationShellDescriptors); - - return mapper.writeValueAsString(this.mapper.readTree(json)); - + return mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.iterator().next().getClass())) + .writeValueAsString(referables); } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of AssetAdministrationShellDescriptors", ex); + throw new SerializationException("error serializing list of Referables", ex); } } - - - -// @Override -// public String write(Object aas_element) throws SerializationException { -// try { -// // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore -// //return mapper.writeValueAsString(ModelTypeProcessor.postprocess(this.mapper.readTree(json))); -// return mapper.writeValueAsString(mapper.valueToTree(aas_element)); -// -// } catch (JsonProcessingException ex) { -// throw new SerializationException("error serializing an aas-element", ex); -// } -// } - -// @Override -// public String writeList(List aas_elements, Class outputClass) throws SerializationException { -// if(aas_elements.isEmpty()){ -// return null; -// } -// -// try { -// ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, outputClass)); -// String json = objectWriter.writeValueAsString(aas_elements); -// -// return mapper.writeValueAsString(this.mapper.readTree(json)); -// -// } catch (JsonProcessingException ex) { -// throw new SerializationException("error serializing list of AAS elements", ex); -// } -// } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java index 692601fde..1e88c6d7f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,28 +16,18 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonInclude; -import java.util.List; - import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; public interface AssetInformationMixin { - @JsonProperty("thumbnail") - public void setDefaultThumbnail(File value); - - @JsonProperty("thumbnail") - public File getDefaultThumbnail(); - - @JsonProperty("billOfMaterial") - public List getBillOfMaterials(); - - @JsonProperty("billOfMaterial") - public void setBillOfMaterials(List billOfMaterials); - @JsonInclude(JsonInclude.Include.ALWAYS) public AssetKind getAssetKind(); + + @JsonProperty("globalAssetId") + public String getGlobalAssetID(); + + @JsonProperty("globalAssetId") + public void setGlobalAssetID(String globalAssetID); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java index 919c02f51..f5aadcd1b 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,23 +16,14 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; -// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import java.util.List; public interface ConceptDescriptionMixin { @JsonProperty("isCaseOf") - public List getIsCaseOfs(); + public List getIsCaseOf(); @JsonProperty("isCaseOf") - public void setIsCaseOfs(List isCaseOfs); -// -// @JsonProperty("embeddedDataSpecifications") -// public List getEmbeddedDataSpecifications(); -// -// @JsonProperty("embeddedDataSpecifications") -// @JsonDeserialize(using = DataSpecificationDeserializer.class) - - // TODO public void setEmbeddedDataSpecifications(List embeddedDataSpecifications); + public void setIsCaseOfs(List isCaseOf); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java index 67576b8cd..88ec3908d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,32 +17,30 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - -// TODO import io.adminshell.aas.v3.model.LevelType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; -public interface DataSpecificationIEC61360Mixin { +public interface DataSpecificationIec61360Mixin { @JsonProperty("levelType") public List getLevelTypes(); - // TODO - // @JsonProperty("levelType") - // public void setLevelTypes(List levelTypes); + @JsonProperty("levelType") + public void setLevelTypes(List levelTypes); @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("preferredName") - public List getPreferredName(); + public List getPreferredName(); @JsonProperty("preferredName") - public void setPreferredName(List preferredName); + public void setPreferredName(List preferredName); - @JsonProperty("shortName") - public List getShortName(); + @JsonProperty("unitId") + public Reference getUnitID(); - @JsonProperty("shortName") - public void setShortName(List shortName); + public @JsonProperty("unitId") + void setUnitID(Reference unitID); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java index e32fd4385..c6d9a89ef 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,16 +18,15 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; public interface EntityMixin { @JsonInclude(JsonInclude.Include.ALWAYS) public EntityType getEntityType(); - @JsonProperty("specificAssetIds") - public SpecificAssetId getExternalAssetId(); + @JsonProperty("globalAssetId") + public String getGlobalAssetID(); - @JsonProperty("specificAssetIds") - public void setExternalAssetId(SpecificAssetId externalAssetId); + @JsonProperty("globalAssetId") + public void setGlobalAssetID(String globalAssetID); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java index 70c41f799..91b903b08 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,5 +20,5 @@ public interface FileMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public String getMimeType(); + public String getContentType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java index b39b6a735..d97c658e3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,9 +23,9 @@ public interface HasExtensionsMixin { - @JsonProperty("extensions") + @JsonProperty("extension") public List getExtensions(); - @JsonProperty("extensions") + @JsonProperty("extension") public void setExtensions(List extensions); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java index 554ce2b7c..cacb010eb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,16 +16,22 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; - -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface MultiLanguagePropertyMixin { @JsonProperty("value") - public List getValue(); + public List getValue(); @JsonProperty("value") - public void setValue(LangString value); + public void setValue(LangStringTextType value); + + @JsonProperty("valueId") + public Reference getValueID(); + + @JsonProperty("valueId") + public void setValueID(Reference valueID); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java index 18da0db82..6cdd8c2a3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,9 +16,17 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface QualifierMixin { @JsonInclude(JsonInclude.Include.ALWAYS) public String getType(); + + @JsonProperty("valueId") + public Reference getValueID(); + + @JsonProperty("valueId") + void setValueID(Reference valueID); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java index c98dd784a..d93eb2c17 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,31 +15,23 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import java.util.List; -import java.util.Set; public interface ReferableMixin { - @JsonProperty("idShort") - public String getIdShort(); - - @JsonProperty("idShort") - public void setIdShort(String idShort); - @JsonProperty("description") - public List getDescription(); + public List getDescription(); @JsonProperty("description") - public void setDescription(List description); + public void setDescription(List description); @JsonProperty("displayName") - public List getDisplayName(); + public List getDisplayName(); @JsonProperty("displayName") - public void setDisplayName(List displayName); + public void setDisplayName(List displayNames); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java index 68ad53ec7..5ca0161db 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +18,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.Collection; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; public interface SubmodelElementListMixin { diff --git a/dataformat-json/src/main/resources/aas.json b/dataformat-json/src/main/resources/aas.json index 3d0b2a302..496811106 100644 --- a/dataformat-json/src/main/resources/aas.json +++ b/dataformat-json/src/main/resources/aas.json @@ -7,7 +7,7 @@ "$ref": "#/definitions/Environment" } ], - "$id": "https://admin-shell.io/aas/3/0/RC02", + "$id": "https://admin-shell.io/aas/3/0", "definitions": { "AasSubmodelElements": { "type": "string", @@ -31,6 +31,24 @@ "SubmodelElementList" ] }, + "AbstractLangString": { + "type": "object", + "properties": { + "language": { + "type": "string", + "pattern": "^(([a-zA-Z]{2,3}(-[a-zA-Z]{3}(-[a-zA-Z]{3}){2})?|[a-zA-Z]{4}|[a-zA-Z]{5,8})(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-(([a-zA-Z0-9]){5,8}|[0-9]([a-zA-Z0-9]){3}))*(-[0-9A-WY-Za-wy-z](-([a-zA-Z0-9]){2,8})+)*(-[xX](-([a-zA-Z0-9]){1,8})+)?|[xX](-([a-zA-Z0-9]){1,8})+|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" + }, + "text": { + "type": "string", + "minLength": 1, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + } + }, + "required": [ + "language", + "text" + ] + }, "AdministrativeInformation": { "allOf": [ { @@ -40,11 +58,42 @@ "properties": { "version": { "type": "string", - "minLength": 1 + "allOf": [ + { + "minLength": 1, + "maxLength": 4 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^(0|[1-9][0-9]*)$" + } + ] }, "revision": { "type": "string", - "minLength": 1 + "allOf": [ + { + "minLength": 1, + "maxLength": 4 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^(0|[1-9][0-9]*)$" + } + ] + }, + "creator": { + "$ref": "#/definitions/Reference" + }, + "templateId": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" } } } @@ -53,16 +102,19 @@ "AnnotatedRelationshipElement": { "allOf": [ { - "$ref": "#/definitions/RelationshipElement" + "$ref": "#/definitions/RelationshipElement_abstract" }, { "properties": { "annotations": { "type": "array", "items": { - "$ref": "#/definitions/DataElement" + "$ref": "#/definitions/DataElement_choice" }, "minItems": 1 + }, + "modelType": { + "const": "AnnotatedRelationshipElement" } } } @@ -90,6 +142,9 @@ "$ref": "#/definitions/Reference" }, "minItems": 1 + }, + "modelType": { + "const": "AssetAdministrationShell" } }, "required": [ @@ -105,7 +160,10 @@ "$ref": "#/definitions/AssetKind" }, "globalAssetId": { - "$ref": "#/definitions/Reference" + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "specificAssetIds": { "type": "array", @@ -114,6 +172,12 @@ }, "minItems": 1 }, + "assetType": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, "defaultThumbnail": { "$ref": "#/definitions/Resource" } @@ -126,6 +190,7 @@ "type": "string", "enum": [ "Instance", + "NotApplicable", "Type" ] }, @@ -147,22 +212,27 @@ }, "messageTopic": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 255, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "messageBroker": { "$ref": "#/definitions/Reference" }, "lastUpdate": { "type": "string", - "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" + "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)(Z|\\+00:00|-00:00)$" }, "minInterval": { "type": "string", - "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" + "pattern": "^-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S))))$" }, "maxInterval": { "type": "string", - "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" + "pattern": "^-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S))))$" + }, + "modelType": { + "const": "BasicEventElement" } }, "required": [ @@ -186,8 +256,21 @@ }, "contentType": { "type": "string", - "minLength": 1, - "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \t]*;[ \t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\t !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([\t !-~]|[\\x80-\\xff]))*\"))*$" + "allOf": [ + { + "minLength": 1, + "maxLength": 100 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\u0080-\u00ff])|\\\\([\\t !-~]|[\u0080-\u00ff]))*\"))*$" + } + ] + }, + "modelType": { + "const": "Blob" } }, "required": [ @@ -197,7 +280,18 @@ ] }, "Capability": { - "$ref": "#/definitions/SubmodelElement" + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "modelType": { + "const": "Capability" + } + } + } + ] }, "ConceptDescription": { "allOf": [ @@ -215,6 +309,9 @@ "$ref": "#/definitions/Reference" }, "minItems": 1 + }, + "modelType": { + "const": "ConceptDescription" } } } @@ -223,6 +320,28 @@ "DataElement": { "$ref": "#/definitions/SubmodelElement" }, + "DataElement_choice": { + "oneOf": [ + { + "$ref": "#/definitions/Blob" + }, + { + "$ref": "#/definitions/File" + }, + { + "$ref": "#/definitions/MultiLanguageProperty" + }, + { + "$ref": "#/definitions/Property" + }, + { + "$ref": "#/definitions/Range" + }, + { + "$ref": "#/definitions/ReferenceElement" + } + ] + }, "DataSpecificationContent": { "type": "object", "properties": { @@ -234,7 +353,14 @@ "modelType" ] }, - "DataSpecificationIEC61360": { + "DataSpecificationContent_choice": { + "oneOf": [ + { + "$ref": "#/definitions/DataSpecificationIec61360" + } + ] + }, + "DataSpecificationIec61360": { "allOf": [ { "$ref": "#/definitions/DataSpecificationContent" @@ -244,129 +370,68 @@ "preferredName": { "type": "array", "items": { - "$ref": "#/definitions/LangString" + "$ref": "#/definitions/LangStringPreferredNameTypeIec61360" }, "minItems": 1 }, "shortName": { "type": "array", "items": { - "$ref": "#/definitions/LangString" + "$ref": "#/definitions/LangStringShortNameTypeIec61360" }, "minItems": 1 }, "unit": { "type": "string", - "minLength": 1 + "minLength": 1, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "unitId": { "$ref": "#/definitions/Reference" }, "sourceOfDefinition": { "type": "string", - "minLength": 1 + "minLength": 1, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "symbol": { "type": "string", - "minLength": 1 + "minLength": 1, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "dataType": { - "$ref": "#/definitions/DataTypeIEC61360" + "$ref": "#/definitions/DataTypeIec61360" }, "definition": { "type": "array", "items": { - "$ref": "#/definitions/LangString" + "$ref": "#/definitions/LangStringDefinitionTypeIec61360" }, "minItems": 1 }, "valueFormat": { "type": "string", - "minLength": 1 + "minLength": 1, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "valueList": { "$ref": "#/definitions/ValueList" }, "value": { - "type": "string" + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "levelType": { "$ref": "#/definitions/LevelType" - } - }, - "required": [ - "preferredName" - ] - } - ] - }, - "DataSpecificationPhysicalUnit": { - "allOf": [ - { - "$ref": "#/definitions/DataSpecificationContent" - }, - { - "properties": { - "unitName": { - "type": "string", - "minLength": 1 - }, - "unitSymbol": { - "type": "string", - "minLength": 1 - }, - "definition": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - }, - "minItems": 1 - }, - "siNotation": { - "type": "string", - "minLength": 1 - }, - "siName": { - "type": "string", - "minLength": 1 - }, - "dinNotation": { - "type": "string", - "minLength": 1 - }, - "eceName": { - "type": "string", - "minLength": 1 - }, - "eceCode": { - "type": "string", - "minLength": 1 - }, - "nistName": { - "type": "string", - "minLength": 1 - }, - "sourceOfDefinition": { - "type": "string", - "minLength": 1 - }, - "conversionFactor": { - "type": "string", - "minLength": 1 - }, - "registrationAuthorityId": { - "type": "string", - "minLength": 1 }, - "supplier": { - "type": "string", - "minLength": 1 + "modelType": { + "const": "DataSpecificationIec61360" } }, "required": [ - "unitName", - "unitSymbol", - "definition" + "preferredName" ] } ] @@ -380,8 +445,6 @@ "xs:byte", "xs:date", "xs:dateTime", - "xs:dateTimeStamp", - "xs:dayTimeDuration", "xs:decimal", "xs:double", "xs:duration", @@ -405,11 +468,10 @@ "xs:unsignedByte", "xs:unsignedInt", "xs:unsignedLong", - "xs:unsignedShort", - "xs:yearMonthDuration" + "xs:unsignedShort" ] }, - "DataTypeIEC61360": { + "DataTypeIec61360": { "type": "string", "enum": [ "BLOB", @@ -447,7 +509,7 @@ "$ref": "#/definitions/Reference" }, "dataSpecificationContent": { - "$ref": "#/definitions/DataSpecificationContent" + "$ref": "#/definitions/DataSpecificationContent_choice" } }, "required": [ @@ -465,7 +527,7 @@ "statements": { "type": "array", "items": { - "$ref": "#/definitions/SubmodelElement" + "$ref": "#/definitions/SubmodelElement_choice" }, "minItems": 1 }, @@ -473,10 +535,20 @@ "$ref": "#/definitions/EntityType" }, "globalAssetId": { - "$ref": "#/definitions/Reference" + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + "specificAssetIds": { + "type": "array", + "items": { + "$ref": "#/definitions/SpecificAssetId" + }, + "minItems": 1 }, - "specificAssetId": { - "$ref": "#/definitions/SpecificAssetId" + "modelType": { + "const": "Entity" } }, "required": [ @@ -538,18 +610,20 @@ }, "topic": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 255, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "subjectId": { "$ref": "#/definitions/Reference" }, "timeStamp": { "type": "string", - "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" + "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)(Z|\\+00:00|-00:00)$" }, "payload": { "type": "string", - "minLength": 1 + "contentEncoding": "base64" } }, "required": [ @@ -567,7 +641,9 @@ "properties": { "name": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 128, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "valueType": { "$ref": "#/definitions/DataTypeDefXsd" @@ -576,7 +652,11 @@ "type": "string" }, "refersTo": { - "$ref": "#/definitions/Reference" + "type": "array", + "items": { + "$ref": "#/definitions/Reference" + }, + "minItems": 1 } }, "required": [ @@ -594,13 +674,36 @@ "properties": { "value": { "type": "string", - "minLength": 1, - "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" + "allOf": [ + { + "minLength": 1, + "maxLength": 2000 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" + } + ] }, "contentType": { "type": "string", - "minLength": 1, - "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \t]*;[ \t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\t !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([\t !-~]|[\\x80-\\xff]))*\"))*$" + "allOf": [ + { + "minLength": 1, + "maxLength": 100 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\u0080-\u00ff])|\\\\([\\t !-~]|[\u0080-\u00ff]))*\"))*$" + } + ] + }, + "modelType": { + "const": "File" } }, "required": [ @@ -637,7 +740,7 @@ "type": "object", "properties": { "kind": { - "$ref": "#/definitions/ModelingKind" + "$ref": "#/definitions/ModellingKind" } } }, @@ -668,7 +771,9 @@ }, "id": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" } }, "required": [ @@ -685,7 +790,9 @@ }, "value": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" } }, "required": [ @@ -722,29 +829,97 @@ "SubmodelElementList" ] }, - "LangString": { + "LangStringDefinitionTypeIec61360": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 1023 + } + } + } + ] + }, + "LangStringNameType": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 128 + } + } + } + ] + }, + "LangStringPreferredNameTypeIec61360": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 255 + } + } + } + ] + }, + "LangStringShortNameTypeIec61360": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 18 + } + } + } + ] + }, + "LangStringTextType": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 1023 + } + } + } + ] + }, + "LevelType": { "type": "object", "properties": { - "language": { - "type": "string", - "pattern": "^(([a-zA-Z]{2,3}(-[a-zA-Z]{3}(-[a-zA-Z]{3}){2})?|[a-zA-Z]{4}|[a-zA-Z]{5,8})(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-(([a-zA-Z0-9]){5,8}|[0-9]([a-zA-Z0-9]){3}))*(-[0-9A-WY-Za-wy-z](-([a-zA-Z0-9]){2,8})+)*(-[xX](-([a-zA-Z0-9]){1,8})+)?|[xX](-([a-zA-Z0-9]){1,8})+|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" + "min": { + "type": "boolean" }, - "text": { - "type": "string" + "nom": { + "type": "boolean" + }, + "typ": { + "type": "boolean" + }, + "max": { + "type": "boolean" } }, "required": [ - "language", - "text" - ] - }, - "LevelType": { - "type": "string", - "enum": [ - "Max", - "Min", - "Nom", - "Typ" + "min", + "nom", + "typ", + "max" ] }, "ModelType": { @@ -756,8 +931,7 @@ "Blob", "Capability", "ConceptDescription", - "DataSpecificationIEC61360", - "DataSpecificationPhysicalUnit", + "DataSpecificationIec61360", "Entity", "File", "MultiLanguageProperty", @@ -771,7 +945,7 @@ "SubmodelElementList" ] }, - "ModelingKind": { + "ModellingKind": { "type": "string", "enum": [ "Instance", @@ -788,12 +962,15 @@ "value": { "type": "array", "items": { - "$ref": "#/definitions/LangString" + "$ref": "#/definitions/LangStringTextType" }, "minItems": 1 }, "valueId": { "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "MultiLanguageProperty" } } } @@ -826,6 +1003,9 @@ "$ref": "#/definitions/OperationVariable" }, "minItems": 1 + }, + "modelType": { + "const": "Operation" } } } @@ -835,7 +1015,7 @@ "type": "object", "properties": { "value": { - "$ref": "#/definitions/SubmodelElement" + "$ref": "#/definitions/SubmodelElement_choice" } }, "required": [ @@ -857,6 +1037,9 @@ }, "valueId": { "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" } }, "required": [ @@ -895,7 +1078,9 @@ }, "type": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 128, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "valueType": { "$ref": "#/definitions/DataTypeDefXsd" @@ -937,6 +1122,9 @@ }, "max": { "type": "string" + }, + "modelType": { + "const": "Range" } }, "required": [ @@ -954,31 +1142,39 @@ "properties": { "category": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 128, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "idShort": { "type": "string", - "maxLength": 128, - "pattern": "^[a-zA-Z][a-zA-Z0-9_]+$" + "allOf": [ + { + "minLength": 1, + "maxLength": 128 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$" + } + ] }, "displayName": { "type": "array", "items": { - "$ref": "#/definitions/LangString" + "$ref": "#/definitions/LangStringNameType" }, "minItems": 1 }, "description": { "type": "array", "items": { - "$ref": "#/definitions/LangString" + "$ref": "#/definitions/LangStringTextType" }, "minItems": 1 }, - "checksum": { - "type": "string", - "minLength": 1 - }, "modelType": { "$ref": "#/definitions/ModelType" } @@ -1020,6 +1216,9 @@ "properties": { "value": { "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "ReferenceElement" } } } @@ -1028,11 +1227,25 @@ "ReferenceTypes": { "type": "string", "enum": [ - "GlobalReference", + "ExternalReference", "ModelReference" ] }, "RelationshipElement": { + "allOf": [ + { + "$ref": "#/definitions/RelationshipElement_abstract" + }, + { + "properties": { + "modelType": { + "const": "RelationshipElement" + } + } + } + ] + }, + "RelationshipElement_abstract": { "allOf": [ { "$ref": "#/definitions/SubmodelElement" @@ -1053,18 +1266,48 @@ } ] }, + "RelationshipElement_choice": { + "oneOf": [ + { + "$ref": "#/definitions/RelationshipElement" + }, + { + "$ref": "#/definitions/AnnotatedRelationshipElement" + } + ] + }, "Resource": { "type": "object", "properties": { "path": { "type": "string", - "minLength": 1, - "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" + "allOf": [ + { + "minLength": 1, + "maxLength": 2000 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" + } + ] }, "contentType": { "type": "string", - "minLength": 1, - "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \t]*;[ \t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\t !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([\t !-~]|[\\x80-\\xff]))*\"))*$" + "allOf": [ + { + "minLength": 1, + "maxLength": 100 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\u0080-\u00ff])|\\\\([\\t !-~]|[\u0080-\u00ff]))*\"))*$" + } + ] } }, "required": [ @@ -1080,11 +1323,15 @@ "properties": { "name": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 64, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "value": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "externalSubjectId": { "$ref": "#/definitions/Reference" @@ -1092,8 +1339,7 @@ }, "required": [ "name", - "value", - "externalSubjectId" + "value" ] } ] @@ -1127,9 +1373,12 @@ "submodelElements": { "type": "array", "items": { - "$ref": "#/definitions/SubmodelElement" + "$ref": "#/definitions/SubmodelElement_choice" }, "minItems": 1 + }, + "modelType": { + "const": "Submodel" } } } @@ -1140,9 +1389,6 @@ { "$ref": "#/definitions/Referable" }, - { - "$ref": "#/definitions/HasKind" - }, { "$ref": "#/definitions/HasSemantics" }, @@ -1164,9 +1410,12 @@ "value": { "type": "array", "items": { - "$ref": "#/definitions/SubmodelElement" + "$ref": "#/definitions/SubmodelElement_choice" }, "minItems": 1 + }, + "modelType": { + "const": "SubmodelElementCollection" } } } @@ -1182,13 +1431,6 @@ "orderRelevant": { "type": "boolean" }, - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/SubmodelElement" - }, - "minItems": 1 - }, "semanticIdListElement": { "$ref": "#/definitions/Reference" }, @@ -1197,6 +1439,16 @@ }, "valueTypeListElement": { "$ref": "#/definitions/DataTypeDefXsd" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/SubmodelElement_choice" + }, + "minItems": 1 + }, + "modelType": { + "const": "SubmodelElementList" } }, "required": [ @@ -1205,6 +1457,52 @@ } ] }, + "SubmodelElement_choice": { + "oneOf": [ + { + "$ref": "#/definitions/RelationshipElement" + }, + { + "$ref": "#/definitions/AnnotatedRelationshipElement" + }, + { + "$ref": "#/definitions/BasicEventElement" + }, + { + "$ref": "#/definitions/Blob" + }, + { + "$ref": "#/definitions/Capability" + }, + { + "$ref": "#/definitions/Entity" + }, + { + "$ref": "#/definitions/File" + }, + { + "$ref": "#/definitions/MultiLanguageProperty" + }, + { + "$ref": "#/definitions/Operation" + }, + { + "$ref": "#/definitions/Property" + }, + { + "$ref": "#/definitions/Range" + }, + { + "$ref": "#/definitions/ReferenceElement" + }, + { + "$ref": "#/definitions/SubmodelElementCollection" + }, + { + "$ref": "#/definitions/SubmodelElementList" + } + ] + }, "ValueList": { "type": "object", "properties": { @@ -1224,7 +1522,10 @@ "type": "object", "properties": { "value": { - "type": "string" + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "valueId": { "$ref": "#/definitions/Reference" diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index f42b06cfd..8f70a124a 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,48 +17,44 @@ import static org.junit.Assert.assertEquals; -import org.junit.Assert; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.junit.Assert; +import org.junit.Test; public class JsonDeserializerTest { - private static final Logger logger = LoggerFactory.getLogger(JsonDeserializerTest.class); - @Test public void testReadFromFile() throws Exception { - new JsonDeserializer().read(JsonSerializerTest.AASFULL_FILE); + new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); } @Test public void testSimpleExample() throws Exception { - Environment env = new JsonDeserializer().read(JsonSerializerTest.AASSIMPLE_FILE); - Assert.assertEquals(AASSimple.ENVIRONMENT, env); + Environment expected = Examples.EXAMPLE_SIMPLE.getModel(); + Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_SIMPLE.fileContentStream()); + Assert.assertEquals(expected, actual); } @Test public void testFullExample() throws Exception { - Environment env = new JsonDeserializer().read(JsonSerializerTest.AASFULL_FILE); - Assert.assertEquals(AASFull.ENVIRONMENT, env); + Environment expected = Examples.EXAMPLE_FULL.getModel(); + Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); + Assert.assertEquals(expected, actual); } @Test public void testCustomImplementationClass() throws Exception { - String json = new JsonSerializer().write(AASSimple.ENVIRONMENT); - Deserializer deserializer = new JsonDeserializer(); + String json = new JsonSerializer().write(AASSimple.createEnvironment()); + JsonDeserializer deserializer = new JsonDeserializer(); Environment environment = deserializer.read(json); checkImplementationClasses(environment, DefaultSubmodel.class, DefaultProperty.class); deserializer.useImplementation(Submodel.class, CustomSubmodel.class); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java index 4d32ad062..68ef1d473 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,119 +17,84 @@ import static org.junit.Assert.assertEquals; -import java.io.File; import java.io.IOException; -import java.nio.file.Files; -import java.util.Arrays; +import java.util.Collections; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; - import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; public class JsonReferableDeserializerTest { - private static final Logger logger = LoggerFactory.getLogger(JsonReferableDeserializerTest.class); - @Test public void testReadAAS() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/assetAdministrationShell.json"); - String expected = Files.readString(fileExpected.toPath()); - AssetAdministrationShell aas = new JsonDeserializer().readReferable(expected, AssetAdministrationShell.class); - Environment environment = AASFull.ENVIRONMENT; - AssetAdministrationShell aasExpected = environment.getAssetAdministrationShells().get(0); - - assertEquals(aasExpected, aas); + AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); + AssetAdministrationShell actual = new JsonDeserializer().readReferable(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); + assertEquals(expected, actual); } @Test public void testReadAASs() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/assetAdministrationShellList.json"); - String expected = Files.readString(fileExpected.toPath()); - List aas = new JsonDeserializer().readReferables(expected, AssetAdministrationShell.class); - Environment environment = AASFull.ENVIRONMENT; - List aasExpected = Arrays.asList(environment.getAssetAdministrationShells().get(0) - ,environment.getAssetAdministrationShells().get(1)) ; - - assertEquals(aasExpected, aas); + List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); + assertEquals(expected, actual); } @Test public void testReadSubmodel() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodel.json"); - String expected = Files.readString(fileExpected.toPath()); - Submodel submodel = new JsonDeserializer().readReferable(expected, Submodel.class); - Environment environment = AASFull.ENVIRONMENT; - Submodel submodelExpected = environment.getSubmodels().get(0); - - assertEquals(submodelExpected, submodel); + Submodel expected = Examples.SUBMODEL.getModel(); + Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); + assertEquals(expected, actual); } @Test public void testReadSubmodels() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelList.json"); - String expected = Files.readString(fileExpected.toPath()); - List submodels = new JsonDeserializer().readReferables(expected,Submodel.class); - Environment environment = AASFull.ENVIRONMENT; - List submodelsExpected = Arrays.asList(environment.getSubmodels().get(0),environment.getSubmodels().get(1)); - - assertEquals(submodelsExpected, submodels); + List expected = Examples.SUBMODEL_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElement() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelElement.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelElement submodelElement = new JsonDeserializer().readReferable(expected,SubmodelElement.class); - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElementExpected = environment.getSubmodels().get(0).getSubmodelElements().get(0); - - assertEquals(submodelElementExpected, submodelElement); + SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); + SubmodelElement actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElements() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/listOfSubmodelElements.json"); - String expected = Files.readString(fileExpected.toPath()); - List submodelElements = new JsonDeserializer().readReferables(expected,SubmodelElement.class); - Environment environment = AASFull.ENVIRONMENT; - List submodelElementsExpected = Arrays.asList( - environment.getSubmodels().get(0).getSubmodelElements().get(0), - environment.getSubmodels().get(0).getSubmodelElements().get(1)); ; - - assertEquals(submodelElementsExpected, submodelElements); + List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables( + Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElementList() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelElementList.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelElementList submodelElementList = new JsonDeserializer().readReferable(expected, SubmodelElementList.class); - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElementListExpected = environment.getSubmodels().get(6).getSubmodelElements().get(5); ; - - assertEquals(submodelElementListExpected, submodelElementList); + SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); + SubmodelElementList actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElementCollection() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelElementCollection.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelElementCollection submodelElementCollection = new JsonDeserializer().readReferable(expected, SubmodelElementCollection.class); - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElementCollectionExpected = environment.getSubmodels().get(6).getSubmodelElements().get(6); ; - - assertEquals(submodelElementCollectionExpected, submodelElementCollection); + SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); + SubmodelElementCollection actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); + assertEquals(expected, actual); } + @Test + public void testReadEmptyReferableList() throws DeserializationException { + List emptyList = Collections.emptyList(); + List deserialized = new JsonDeserializer().readReferables("[]", Referable.class); + assertEquals(emptyList, deserialized); + } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java index 43fcec6f6..7df276487 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,125 +15,92 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.File; import java.io.IOException; -import java.nio.file.Files; -import java.sql.Ref; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.model.*; +import java.util.Collection; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.json.JSONException; +import org.junit.Ignore; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; - -import static org.junit.Assert.assertTrue; public class JsonReferableSerializerTest { - private static final Logger logger = LoggerFactory.getLogger(JsonReferableSerializerTest.class); - @Test public void testSerializeAAS() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - AssetAdministrationShell assetAdministrationShell = environment.getAssetAdministrationShells().get(0); - compare("src/test/resources/assetAdministrationShell.json",assetAdministrationShell); + compare(Examples.ASSET_ADMINISTRATION_SHELL); } @Test - public void testSerializeAASs() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - compare("src/test/resources/assetAdministrationShellList.json", - environment.getAssetAdministrationShells().get(0), environment.getAssetAdministrationShells().get(1)); + public void testSerializeWithAssetInformation() throws SerializationException, JSONException, IOException { + compare(Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION); } @Test - public void testSerializeSubmodel() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - Submodel submodel = environment.getSubmodels().get(0); - compare("src/test/resources/submodel.json",submodel); + public void testSerializeAASs() throws IOException, SerializationException, JSONException { + compare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); } @Test - public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - compare("src/test/resources/submodelList.json", environment.getSubmodels().get(0), environment.getSubmodels().get(1)); + @Ignore("Add test after DataSpecficationPhysicalUnit is supported again") + public void testSerializeConceptDescriptionWithPhysicalUnit() throws IOException, SerializationException, JSONException { + compare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); } @Test - public void testSerializeSubmodelAsReferable() throws SerializationException { - JsonSerializer serializer = new JsonSerializer(); - - List submodels = new ArrayList<>(); - submodels.add(AASFull.ENVIRONMENT.getSubmodels().get(0)); - submodels.add(AASFull.ENVIRONMENT.getSubmodels().get(1)); - submodels.add(AASFull.ENVIRONMENT.getSubmodels().get(2)); - - String serializedReferenceArray = serializer.writeReferables(submodels); + public void testSerializeSubmodel() throws IOException, SerializationException, JSONException { + compare(Examples.SUBMODEL); + } - assertTrue(serializedReferenceArray.contains("\"http://acplt.org/Submodels/Assets/TestAsset/Identification\"")); + @Test + public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { + compare(Examples.SUBMODEL_ELEMENT_LIST_OF); } @Test public void testSerializeSubmodelElement() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElement = environment.getSubmodels().get(0).getSubmodelElements().get(0); - compare("src/test/resources/submodelElement.json",submodelElement); + compare(Examples.SUBMODEL_ELEMENT); } @Test public void testSerializeSubmodelElements() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElement0 = environment.getSubmodels().get(0).getSubmodelElements().get(0); - SubmodelElement submodelElement1 = environment.getSubmodels().get(0).getSubmodelElements().get(1); - compare("src/test/resources/listOfSubmodelElements.json",submodelElement0,submodelElement1); + compare(Examples.SUBMODEL_ELEMENT_LIST_OF); } @Test public void testSerializeSubmodelElementCollection() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - SubmodelElementCollection submodelElementCollection = (SubmodelElementCollection) environment.getSubmodels().get(6).getSubmodelElements().get(6); - compare("src/test/resources/submodelElementCollection.json",submodelElementCollection); + compare(Examples.SUBMODEL_ELEMENT_COLLECTION); } @Test public void testSerializeSubmodelElementList() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - SubmodelElementList submodelElementList = (SubmodelElementList) environment.getSubmodels().get(6).getSubmodelElements().get(5); - compare("src/test/resources/submodelElementList.json",submodelElementList); + compare(Examples.SUBMODEL_ELEMENT_LIST); } @Test public void testSerializeSubmodelElementListEmpty() throws SerializationException, JSONException, IOException { - compare("src/test/resources/submodelElementListEmpty.json", - new DefaultSubmodelElementList.Builder() - .idShort("submodelElementList") - .orderRelevant(true) - .build()); + compare(Examples.SUBMODEL_ELEMENT_LIST_EMPTY); } - private void compare(String filePathForExpected, Referable... referable) throws IOException, SerializationException, JSONException { - File fileExpected = new File(filePathForExpected); - String expected = Files.readString(fileExpected.toPath()); - String actual; - if(referable.length>1){ - actual = new JsonSerializer().writeReferables(List.of(referable)); - } else { - actual = new JsonSerializer().writeReferable(Arrays.stream(referable).findFirst().get()); + @SuppressWarnings("unchecked") + private void compare(ExampleData exampleData) throws IOException, SerializationException, JSONException { + String expected = exampleData.fileContent(); + String actual = null; + if (Environment.class.isAssignableFrom(exampleData.getModel().getClass())) { + actual = new JsonSerializer().write((Environment) exampleData.getModel()); + } else if (Referable.class.isAssignableFrom(exampleData.getModel().getClass())) { + actual = new JsonSerializer().write((Referable) exampleData.getModel()); + } else if (Collection.class.isAssignableFrom(exampleData.getModel().getClass()) + && ((Collection) exampleData.getModel()).stream().allMatch(x -> x != null && Referable.class.isAssignableFrom(x.getClass()))) { + actual = new JsonSerializer().write((Collection) exampleData.getModel()); } - logger.info(actual); - JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); - } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 40f49d167..1ea73393e 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +20,16 @@ import java.io.File; import java.io.IOException; -import java.nio.file.Files; +import java.util.Collections; +import java.util.List; import java.util.Set; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.json.JSONException; import org.junit.Rule; import org.junit.Test; @@ -37,13 +41,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; - public class JsonSerializerTest { - public static final java.io.File AASSIMPLE_FILE = new java.io.File("src/test/resources/jsonExample.json"); - public static final java.io.File AASFULL_FILE = new java.io.File("src/test/resources/test_demo_full_example.json"); private static final Logger logger = LoggerFactory.getLogger(JsonSerializerTest.class); @@ -58,28 +56,35 @@ public void testSerializeNull() throws JsonProcessingException, IOException, Ser @Test public void testWriteToFile() throws JsonProcessingException, IOException, SerializationException { File file = tempFolder.newFile("output.json"); - new JsonSerializer().write(file, AASSimple.ENVIRONMENT); + new JsonSerializer().write(file, AASSimple.createEnvironment()); assertTrue(file.exists()); } @Test public void testSerializeEmpty() throws JsonProcessingException, IOException, SerializationException, JSONException { - validateAndCompare(new java.io.File("src/test/resources/empty_aas.json"), new DefaultEnvironment.Builder().build()); + validateAndCompare(Examples.ENVIRONMENT_EMPTY); } @Test public void testSerializeSimpleExample() throws SerializationException, JSONException, IOException { - validateAndCompare(AASSIMPLE_FILE, AASSimple.ENVIRONMENT); + validateAndCompare(Examples.EXAMPLE_SIMPLE); } @Test public void testSerializeFullExample() throws SerializationException, JSONException, IOException { - validateAndCompare(AASFULL_FILE, AASFull.ENVIRONMENT); + validateAndCompare(Examples.EXAMPLE_FULL); } - private void validateAndCompare(File expectedFile, Environment environment) throws IOException, SerializationException, JSONException { - String expected = Files.readString(expectedFile.toPath()); - String actual = new JsonSerializer().write(environment); + @Test + public void testSerializeEmptyReferableList() throws SerializationException { + List emptyList = Collections.emptyList(); + String serialized = new JsonSerializer().write(emptyList); + assertEquals("[]", serialized); + } + + private void validateAndCompare(ExampleData exampleData) throws IOException, SerializationException, JSONException { + String expected = exampleData.fileContent(); + String actual = new JsonSerializer().write(exampleData.getModel()); logger.info(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); assertTrue(errors.isEmpty()); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java index f9878057f..ed0e9b08e 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +15,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.IOException; @@ -30,6 +28,7 @@ import junitparams.JUnitParamsRunner; import junitparams.Parameters; +import static org.junit.Assert.assertFalse; @RunWith(JUnitParamsRunner.class) public class JsonValidationTest { @@ -43,28 +42,27 @@ public static void prepareValidator() throws IOException { @Test @Parameters({ - "src/test/resources/empty_aas.json", - "src/test/resources/jsonExample.json", + "src/test/resources/Environment-Empty.json", + "src/test/resources/Example-Simple.json", "src/test/resources/MotorAAS.json", - "src/test/resources/MotorAAS_reduced.json", - "src/test/resources/test_demo_full_example.json" + "src/test/resources/MotorAAS-Reduced.json", + "src/test/resources/Example-Full.json" }) public void validateValidJson(String file) throws IOException { - String serializedEnvironment = new String(Files.readAllBytes(Paths.get(file))); - Set errors = validator.validateSchema(serializedEnvironment); - System.out.println("Validating: " + file); - assertTrue(errors.isEmpty()); + assertTrue(validate(file).isEmpty()); } @Test - @Parameters({"src/test/resources/invalidJsonExample.json"}) + @Parameters({"src/test/resources/Environment-Invalid.json"}) public void validateInvalidJson(String file) throws IOException { - String serializedEnvironment = new String(Files.readAllBytes(Paths.get(file))); - Set errors = validator.validateSchema(serializedEnvironment); + assertFalse(validate(file).isEmpty()); + } + + private Set validate(String file) throws IOException { + String json = new String(Files.readAllBytes(Paths.get(file))); + Set result = validator.validateSchema(json); System.out.println("Validating: " + file); - for (String s : errors) { - System.out.println(s); - } - assertEquals(2, errors.size()); + result.forEach(System.out::println); + return result; } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java index 4b677e6ca..a020dd4a9 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +27,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins.ReferenceMixin; import org.junit.Before; import org.junit.Test; diff --git a/dataformat-json/src/test/resources/AssetAdministrationShell.json b/dataformat-json/src/test/resources/AssetAdministrationShell.json index dca5615c6..aa9b84207 100644 --- a/dataformat-json/src/test/resources/AssetAdministrationShell.json +++ b/dataformat-json/src/test/resources/AssetAdministrationShell.json @@ -1,73 +1,64 @@ -{ - "idShort": "TestAssetAdministrationShell", - "description": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ], - "modelType": "AssetAdministrationShell", - "id": "https://acplt.org/Test_AssetAdministrationShell", - "administration": - { - "version": "0.9", - "revision": "0" - }, - "derivedFrom": - { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/TestAssetAdministrationShell2" - } - ], - "type": "GlobalReference" - }, - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId": - { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset" - } - ], - "type": "GlobalReference" - } - }, - "submodels": [ - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" - } - ], - "type": "GlobalReference" - } - ] -} \ No newline at end of file +{ + "idShort": "TestAssetAdministrationShell", + "description": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ], + "modelType": "AssetAdministrationShell", + "id": "https://acplt.org/Test_AssetAdministrationShell", + "administration": + { + "version": "0", + "revision": "9" + }, + "derivedFrom": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/TestAssetAdministrationShell2" + } + ], + "type": "ExternalReference" + }, + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId":"https://acplt.org/Test_Asset" + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + } + ], + "type": "ExternalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + } + ], + "type": "ExternalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" + } + ], + "type": "ExternalReference" + } + ] +} diff --git a/dataformat-json/src/test/resources/MotorAAS.json b/dataformat-json/src/test/resources/MotorAAS.json index f1207e299..b0b828a79 100644 --- a/dataformat-json/src/test/resources/MotorAAS.json +++ b/dataformat-json/src/test/resources/MotorAAS.json @@ -6,15 +6,7 @@ "id": "http://customer.com/aas/9175_7013_7091_9168", "assetInformation": { "assetKind": "Instance", - "globalAssetId": { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "http://customer.com/assets/KHBVZJSQKIY" - } - ], - "type": "GlobalReference" - }, + "globalAssetId": "http://customer.com/assets/KHBVZJSQKIY", "specificAssetIds": [ { "name": "EquipmentID", @@ -26,7 +18,7 @@ "value": "http://customer.com/Systems/ERP/012" } ], - "type": "GlobalReference" + "type": "ExternalReference" } }, { @@ -39,13 +31,12 @@ "value": "http://customer.com/Systems/IoT/1" } ], - "type": "GlobalReference" + "type": "ExternalReference" } } ], "thumbnail": { "modelType": "File", - "kind": "Instance", "idShort": "thumbnail", "mimeType": "image/png", "path": "https://github.com/admin-shell/io/blob/master/verwaltungsschale-detail-part1.png" @@ -59,7 +50,7 @@ "value": "http.//i40.customer.com/type/1/1/7A7104BDAB57E184" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, { "keys": [ @@ -68,7 +59,7 @@ "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, { "keys": [ @@ -77,7 +68,7 @@ "value": "http://i40.customer.com/type/1/1/1A7B62B529F19152" } ], - "type": "GlobalReference" + "type": "ExternalReference" } ] } @@ -92,7 +83,7 @@ "value": "0173-1#01-AFZ615#016" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "kind": "Instance", "idShort": "TechnicalData", @@ -100,7 +91,6 @@ "submodelElements": [ { "modelType": "Property", - "kind": "Instance", "semanticId": { "keys": [ { @@ -108,7 +98,7 @@ "value": "0173-1#02-BAA120#008" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "idShort": "MaxRotationSpeed", "category": "PARAMETER", @@ -125,7 +115,6 @@ "submodelElements": [ { "modelType": "SubmodelElementCollection", - "kind": "Instance", "semanticId": { "keys": [ { @@ -133,13 +122,12 @@ "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "idShort": "OperatingManual", "value": [ { "modelType": "Property", - "kind": "Instance", "semanticId": { "keys": [ { @@ -147,15 +135,14 @@ "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "idShort": "Title", "value": "OperatingManual", - "valueType": "langString" + "valueType": "xs:string" }, { "modelType": "File", - "kind": "Instance", "semanticId": { "keys": [ { @@ -163,11 +150,11 @@ "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "idShort": "DigitalFile_PDF", "contentType": "application/pdf", - "value": "/aasx/OperatingManual.pdf" + "value": "file:///aasx/OperatingManual.pdf" } ], "ordered": false, @@ -183,7 +170,6 @@ "submodelElements": [ { "modelType": "Property", - "kind": "Instance", "semanticId": { "keys": [ { @@ -191,7 +177,7 @@ "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "idShort": "RotationSpeed", "category": "Variable", @@ -215,10 +201,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", + "modelType": "DataSpecificationIec61360", "preferredName": [ { "language": "EN", @@ -229,7 +215,7 @@ "text": "Titel" } ], - "shortNames": [ + "shortName": [ { "language": "EN", "text": "Title" @@ -239,9 +225,7 @@ "text": "Titel" } ], - "unit": "", - "sourceOfDefinition": "", - "dataType": "StringTranslatable", + "dataType": "STRING_TRANSLATABLE", "definition": [ { "language": "DE", @@ -265,10 +249,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", + "modelType": "DataSpecificationIec61360", "preferredName": [ { "language": "EN", @@ -279,7 +263,7 @@ "text": "DigitaleDatei" } ], - "shortNames": [ + "shortName": [ { "language": "EN", "text": "DigitalFile" @@ -289,9 +273,7 @@ "text": "DigitaleDatei" } ], - "unit": "", - "sourceOfDefinition": "", - "dataType": "String", + "dataType": "STRING", "definition": [ { "language": "DE", @@ -320,10 +302,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", + "modelType": "DataSpecificationIec61360", "preferredName": [ { "language": "de", @@ -334,7 +316,6 @@ "text": "Max.rotationspeed" } ], - "shortNames": [], "unit": "1/min", "unitId": { "keys": [ @@ -343,10 +324,9 @@ "value": "0173-1#05-AAA650#002" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, - "sourceOfDefinition": "", - "dataType": "RealMeasure", + "dataType": "REAL_MEASURE", "definition": [ { "language": "de", @@ -375,10 +355,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", + "modelType": "DataSpecificationIec61360", "preferredName": [ { "language": "DE", @@ -389,14 +369,14 @@ "text": "Actualrotationspeed" } ], - "shortNames": [ + "shortName": [ { "language": "DE", "text": "AktuelleDrehzahl" }, { "language": "EN", - "text": "ActualRotationSpeed" + "text": "ActRotationSpeed" } ], "unit": "1/min", @@ -407,10 +387,9 @@ "value": "0173-1#05-AAA650#002" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, - "sourceOfDefinition": "", - "dataType": "RealMeasure", + "dataType": "REAL_MEASURE", "definition": [ { "language": "DE", @@ -438,12 +417,17 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", - "preferredName": [], - "shortNames": [ + "modelType": "DataSpecificationIec61360", + "preferredName": [ + { + "language": "DE", + "text": "Dokument" + } + ], + "shortName": [ { "language": "EN", "text": "Document" @@ -453,9 +437,8 @@ "text": "Dokument" } ], - "unit": "", "sourceOfDefinition": "[ISO15519-1:2010]", - "dataType": "String", + "dataType": "STRING", "definition": [ { "language": "DE", diff --git a/dataformat-json/src/test/resources/Submodel.json b/dataformat-json/src/test/resources/Submodel.json index 79a85f8cc..c3751c085 100644 --- a/dataformat-json/src/test/resources/Submodel.json +++ b/dataformat-json/src/test/resources/Submodel.json @@ -1,124 +1,144 @@ - -{ - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", - "idShort": "Identification", - "submodelElements": [ - { - "modelType": "Property", - "category": "VARIABLE", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ACPLT", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ACPLT" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "value": "100", - "valueType": "xs:int", - "kind": "ConceptQualifier" - }, - { - "type": "http://acplt.org/Qualifier/ExampleQualifier2", - "value": "50", - "valueType": "xs:int", - "kind": "ConceptQualifier" - } - ], - "idShort": "ManufacturerName", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - }, - { - "modelType": "Property", - "category": "VARIABLE", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "GlobalReference" - }, - "value": "978-8234-234-342", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "978-8234-234-342" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "idShort": "InstanceId", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - } - ], - "description": [ - { - "language": "en-us", - "text": "An example asset identification submodel for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" - } - ] -} \ No newline at end of file + +{ + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" + } + ], + "type": "ExternalReference" + }, + "administration": + { + "revision": "9", + "version": "0" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", + "idShort": "Identification", + "submodelElements": [ + { + "modelType": "Property", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "ExternalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "ExternalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ], + "displayName": [ + { + "language": "en-us", + "text": "Manufacturer Name" + } + ] + }, + { + "modelType": "Property", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "ExternalReference" + }, + "value": "978-8234-234-342", + "supplementalSemanticIds": [ + { + "keys": [ + { + "type": "GlobalReference", + "value": "something_random_e14ad770" + } + ], + "type": "ExternalReference" + }, + { + "keys": [{ + "type": "GlobalReference", + "value": "something_random_bd061acd" + }], + "type": "ExternalReference" + } + + ], + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "978-8234-234-342" + } + ], + "type": "ExternalReference" + }, + "valueType": "xs:string", + "category": "VARIABLE", + "idShort": "InstanceId", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example asset identification submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" + } + ] +} diff --git a/dataformat-json/src/test/resources/SubmodelElement.json b/dataformat-json/src/test/resources/SubmodelElement.json index aa25cb3d2..fb11778ca 100644 --- a/dataformat-json/src/test/resources/SubmodelElement.json +++ b/dataformat-json/src/test/resources/SubmodelElement.json @@ -1,53 +1,55 @@ - -{ - "modelType": "Property", - "kind": "Instance", - "category": "VARIABLE", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ACPLT", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ACPLT" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "value": "100", - "valueType": "xs:int", - "kind": "ConceptQualifier" - }, - { - "type": "http://acplt.org/Qualifier/ExampleQualifier2", - "value": "50", - "valueType": "xs:int", - "kind": "ConceptQualifier" - } - ], - "idShort": "ManufacturerName", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] -} \ No newline at end of file + +{ + "modelType": "Property", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "ExternalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "ExternalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ], + "displayName": [ + { + "language": "en-us", + "text": "Manufacturer Name" + } + ] +} diff --git a/dataformat-json/src/test/resources/SubmodelElementCollection.json b/dataformat-json/src/test/resources/SubmodelElementCollection.json index 981979de9..f0366f0f9 100644 --- a/dataformat-json/src/test/resources/SubmodelElementCollection.json +++ b/dataformat-json/src/test/resources/SubmodelElementCollection.json @@ -1,86 +1,82 @@ -{ - "idShort": "ExampleSubmodelElementCollection", - "category": "PARAMETER", - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollection object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollection Element" - } - ], - "modelType": "SubmodelElementCollection", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" - } - ], - "type": "GlobalReference" - }, - "kind": "Template", - "value": [ { - "modelType" : "Blob", - "contentType" : "application/pdf", - "kind" : "Template", - "semanticId" : { - "keys" : [ { - "type" : "GlobalReference", - "value" : "http://acplt.org/Blobs/ExampleBlob" - } ], - "type" : "GlobalReference" - }, - "category" : "PARAMETER", - "description" : [ { - "language" : "en-us", - "text" : "Example Blob object" - }, { - "language" : "de", - "text" : "Beispiel Blob Element" - } ], - "idShort" : "ExampleBlob" - }, { - "modelType" : "File", - "contentType" : "application/pdf", - "kind" : "Template", - "semanticId" : { - "keys" : [ { - "type" : "GlobalReference", - "value" : "http://acplt.org/Files/ExampleFile" - } ], - "type" : "GlobalReference" - }, - "category" : "PARAMETER", - "description" : [ { - "language" : "en-us", - "text" : "Example File object" - }, { - "language" : "de", - "text" : "Beispiel File Element" - } ], - "idShort" : "ExampleFile" - }, { - "modelType" : "ReferenceElement", - "kind" : "Template", - "semanticId" : { - "keys" : [ { - "type" : "GlobalReference", - "value" : "http://acplt.org/ReferenceElements/ExampleReferenceElement" - } ], - "type" : "GlobalReference" - }, - "category" : "PARAMETER", - "description" : [ { - "language" : "en-us", - "text" : "Example Reference Element object" - }, { - "language" : "de", - "text" : "Beispiel Reference Element Element" - } ], - "idShort" : "ExampleReferenceElement" - } ] -} \ No newline at end of file +{ + "idShort": "ExampleSubmodelElementCollection", + "category": "PARAMETER", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollection object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollection Element" + } + ], + "modelType": "SubmodelElementCollection", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" + } + ], + "type": "ExternalReference" + }, + "value": [ { + "modelType" : "Blob", + "contentType" : "application/pdf", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "http://acplt.org/Blobs/ExampleBlob" + } ], + "type": "ExternalReference" + }, + "category" : "PARAMETER", + "description" : [ { + "language" : "en-us", + "text" : "Example Blob object" + }, { + "language" : "de", + "text" : "Beispiel Blob Element" + } ], + "idShort" : "ExampleBlob" + }, { + "modelType" : "File", + "contentType" : "application/pdf", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "http://acplt.org/Files/ExampleFile" + } ], + "type": "ExternalReference" + }, + "category" : "PARAMETER", + "description" : [ { + "language" : "en-us", + "text" : "Example File object" + }, { + "language" : "de", + "text" : "Beispiel File Element" + } ], + "idShort" : "ExampleFile" + }, { + "modelType" : "ReferenceElement", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } ], + "type": "ExternalReference" + }, + "category" : "PARAMETER", + "description" : [ { + "language" : "en-us", + "text" : "Example Reference Element object" + }, { + "language" : "de", + "text" : "Beispiel Reference Element Element" + } ], + "idShort" : "ExampleReferenceElement" + } ] +} diff --git a/dataformat-json/src/test/resources/SubmodelElementList.json b/dataformat-json/src/test/resources/SubmodelElementList.json index 7456c61c1..fc5dd9c06 100644 --- a/dataformat-json/src/test/resources/SubmodelElementList.json +++ b/dataformat-json/src/test/resources/SubmodelElementList.json @@ -1,141 +1,136 @@ -{ - "idShort": "ExampleSubmodelElementListOrdered", - "category": "PARAMETER", - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementListOrdered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementListOrdered Element" - } - ], - "modelType": "SubmodelElementList", - "orderRelevant": true, - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" - } - ], - "type": "GlobalReference" - }, - "kind": "Template", - "typeValueListElement": "SubmodelElement", - "value": [ - { - "idShort": "ExampleProperty", - "category": "CONSTANT", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ], - "modelType": "Property", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "kind": "Template", - "valueType": "xs:string" - }, - { - "idShort": "ExampleMultiLanguageProperty", - "category": "CONSTANT", - "description": [ - { - "language": "en-us", - "text": "Example MultiLanguageProperty object" - }, - { - "language": "de", - "text": "Beispiel MultiLanguageProperty Element" - } - ], - "modelType": "MultiLanguageProperty", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" - } - ], - "type": "GlobalReference" - }, - "kind": "Template" - }, - { - "idShort": "ExampleRange", - "category": "PARAMETER", - "description": - [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ], - "modelType": "Range", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "GlobalReference" - }, - "kind": "Template", - "valueType": "xs:int", - "max": "100" - }, - { - "idShort": "ExampleRange2", - "category": "PARAMETER", - "description": - [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ], - "modelType": "Range", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "GlobalReference" - }, - "kind": "Template", - "valueType": "xs:int", - "min": "0" - } - ] -} \ No newline at end of file +{ + "idShort": "ExampleSubmodelElementListOrdered", + "category": "PARAMETER", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementListOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementListOrdered Element" + } + ], + "modelType": "SubmodelElementList", + "orderRelevant": true, + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" + } + ], + "type": "ExternalReference" + }, + "typeValueListElement": "SubmodelElement", + "value": [ + { + "idShort": "ExampleProperty", + "category": "CONSTANT", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ], + "modelType": "Property", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "ExternalReference" + }, + "valueType": "xs:string" + }, + { + "idShort": "ExampleMultiLanguageProperty", + "category": "CONSTANT", + "description": [ + { + "language": "en-us", + "text": "Example MultiLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MultiLanguageProperty Element" + } + ], + "modelType": "MultiLanguageProperty", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "ExternalReference" + } + }, + { + "idShort": "ExampleRange", + "category": "PARAMETER", + "description": + [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ], + "modelType": "Range", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "ExternalReference" + }, + "valueType": "xs:int", + "max": "100" + }, + { + "idShort": "ExampleRange2", + "category": "PARAMETER", + "description": + [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ], + "modelType": "Range", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "ExternalReference" + }, + "valueType": "xs:int", + "min": "0" + } + ] +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java index cdbafe570..42ec3687b 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,37 +15,54 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; +import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.Map; +import java.util.stream.Collectors; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -public class XmlDeserializer implements Deserializer { +public class XmlDeserializer { + protected final XmlFactory xmlFactory; protected XmlMapper mapper; protected SimpleAbstractTypeResolver typeResolver; - protected static Map, com.fasterxml.jackson.databind.JsonDeserializer> customDeserializers = Map.of( + @SuppressWarnings("rawtypes") + protected static Map, JsonDeserializer> customDeserializers = Map.of( SubmodelElement.class, new SubmodelElementDeserializer()); + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + + public XmlDeserializer() { + this(new XmlFactory()); + } + + public XmlDeserializer(XmlFactory xmlFactory) { + this.xmlFactory = xmlFactory; initTypeResolver(); buildMapper(); } protected void buildMapper() { - mapper = XmlMapper.builder().enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) + mapper = XmlMapper.builder(xmlFactory) + .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .serializationInclusion(JsonInclude.Include.NON_NULL) .annotationIntrospector(new XmlDataformatAnnotationIntrospector()) @@ -63,7 +79,8 @@ protected SimpleModule buildCustomDeserializerModule() { return module; } - private void initTypeResolver() { + @SuppressWarnings("unchecked") + private void initTypeResolver() { typeResolver = new SimpleAbstractTypeResolver(); ReflectionHelper.DEFAULT_IMPLEMENTATIONS .stream() @@ -83,7 +100,15 @@ protected SimpleModule buildImplementationModule() { return module; } - @Override + /** + * Deserializes a given string into an instance of + * AssetAdministrationShellEnvironment + * + * @param value a string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ public Environment read(String value) throws DeserializationException { try { return mapper.readValue(value, Environment.class); @@ -92,7 +117,82 @@ public Environment read(String value) throws DeserializationException { } } - @Override + /** + * Deserializes a given InputStream into an instance of + * AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * + * @param src an InputStream containing the string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + public Environment read(InputStream src) throws DeserializationException { + return read(src, DEFAULT_CHARSET); + } + + + /** + * Deserializes a given InputStream into an instance of + * AssetAdministrationShellEnvironment using a given charset + * + * @param src An InputStream containing the string representation of the + * AssetAdministrationShellEnvironment + * @param charset the charset to use for deserialization + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + public Environment read(InputStream src, Charset charset) throws DeserializationException { + return read(new BufferedReader( + new InputStreamReader(src, charset)) + .lines() + .collect(Collectors.joining(System.lineSeparator()))); + } + + /** + * Deserializes a given File into an instance of + * AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * + * @param file A java.io.File containing the string representation of the + * AssetAdministrationShellEnvironment + * @param charset the charset to use for deserialization + * @return an instance of AssetAdministrationShellEnvironment + * @throws FileNotFoundException if file is not present + * @throws DeserializationException if deserialization fails + */ + public Environment read(java.io.File file, Charset charset) + throws FileNotFoundException, DeserializationException { + return read(new FileInputStream(file), charset); + } + + /** + * Deserializes a given File into an instance of + * AssetAdministrationShellEnvironment using a given charset + * + * @param file a java.io.File containing the string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws FileNotFoundException if the file is not present + * @throws DeserializationException if deserialization fails + */ + public Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { + return read(file, DEFAULT_CHARSET); + } + + /** + * Enables usage of custom implementation to be used for deserialization + * instead of default implementation, e.g. defining a custom implementation + * of the Submodel interface {@code class + * CustomSubmodel implements Submodel {}} and calling + * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will + * result in all instances of Submodel will be deserialized as + * CustomSubmodel. Subsequent class with the same aasInterface parameter + * will override the effects of all previous calls. + * + * @param the type of the interface to replace + * @param aasInterface the class of the interface to replace + * @param implementation the class implementing the interface that should be + * used for deserialization. + */ public void useImplementation(Class aasInterface, Class implementation) { typeResolver.addMapping(aasInterface, implementation); buildMapper(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java index 419f9632a..e7b28aafa 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,19 +15,18 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; +import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.Map; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.AssetAdministrationShellEnvironmentSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.OperationVariableSerializer; -// TODO import io.adminshell.aas.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; -// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; import com.fasterxml.jackson.annotation.JsonInclude; @@ -37,25 +35,34 @@ import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -public class XmlSerializer implements Serializer { +public class XmlSerializer { + protected final XmlFactory xmlFactory; protected XmlMapper mapper; protected Map namespacePrefixes; + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + public XmlSerializer() { this(null); } public XmlSerializer(Map namespacePrefixes) { + this(new XmlFactory(), namespacePrefixes); + } + + public XmlSerializer(XmlFactory xmlFactory, Map namespacePrefixes) { + this.xmlFactory = xmlFactory; this.namespacePrefixes = namespacePrefixes; buildMapper(); } protected void buildMapper() { - mapper = XmlMapper.builder() + mapper = XmlMapper.builder(xmlFactory) .enable(SerializationFeature.INDENT_OUTPUT) .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .serializationInclusion(JsonInclude.Include.NON_NULL) @@ -70,7 +77,6 @@ protected void buildMapper() { protected SimpleModule buildCustomSerializerModule() { SimpleModule module = new SimpleModule(); - // TODO: module.addSerializer(EmbeddedDataSpecification.class, new EmbeddedDataSpecificationSerializer()); AssetAdministrationShellEnvironmentSerializer aasEnvSerializer; if (namespacePrefixes != null) { aasEnvSerializer = new AssetAdministrationShellEnvironmentSerializer(namespacePrefixes); @@ -78,11 +84,7 @@ protected SimpleModule buildCustomSerializerModule() { aasEnvSerializer = new AssetAdministrationShellEnvironmentSerializer(); } module.addSerializer(Environment.class, aasEnvSerializer); -// module.addSerializer(Key.class, new KeySerializer()); -// module.addSerializer(Reference.class, new ReferenceSerializer()); - module.addSerializer(LangString.class, new LangStringSerializer()); -// module.addSerializer(new LangStringsSerializer()); -module.addSerializer(OperationVariable.class, new OperationVariableSerializer()); + module.addSerializer(OperationVariable.class, new OperationVariableSerializer()); return module; } @@ -92,7 +94,15 @@ protected SimpleModule buildEnumModule() { return module; } - @Override + /** + * Serializes a given instance of AssetAdministrationShellEnvironment to + * string + * + * @param aasEnvironment the AssetAdministrationShellEnvironment to + * serialize + * @return the string representation of the environment + * @throws SerializationException if serialization fails + */ public String write(Environment aasEnvironment) throws SerializationException { try { ObjectWriter writer = mapper.writer(); @@ -101,4 +111,73 @@ public String write(Environment aasEnvironment) throws SerializationException { throw new SerializationException("serialization failed", ex); } } + + + /** + * Serializes a given instance of Environment to an + * OutputStream using DEFAULT_CHARSET + * + * @param out the Outputstream to serialize to + * @param aasEnvironment the Environment to + * serialize + * @throws IOException if writing to the stream fails + * @throws SerializationException if serialization fails + */ + void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { + write(out, DEFAULT_CHARSET, aasEnvironment); + } + + /** + * Serializes a given instance of Environment to an + * OutputStream using given charset + * + * @param out the Outputstream to serialize to + * @param charset the Charset to use for serialization + * @param aasEnvironment the Environment to + * serialize + * @throws IOException if writing to the stream fails + * @throws SerializationException if serialization fails + */ + void write(OutputStream out, Charset charset, Environment aasEnvironment) + throws IOException, SerializationException { + try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { + writer.write(write(aasEnvironment)); + } + } + + // Note that the AAS also defines a file class + /** + * Serializes a given instance of Environment to a + * java.io.File using DEFAULT_CHARSET + * + * @param file the java.io.File to serialize to + * @param charset the Charset to use for serialization + * @param aasEnvironment the Environment to + * serialize + * @throws FileNotFoundException if the fail does not exist + * @throws IOException if writing to the file fails + * @throws SerializationException if serialization fails + */ + void write(java.io.File file, Charset charset, Environment aasEnvironment) + throws FileNotFoundException, IOException, SerializationException { + try (OutputStream out = new FileOutputStream(file)) { + write(out, charset, aasEnvironment); + } + } + + /** + * Serializes a given instance of Environment to a + * java.io.File using given charset + * + * @param file the java.io.File to serialize to + * @param aasEnvironment the Environment to + * serialize + * @throws FileNotFoundException if the fail does not exist + * @throws IOException if writing to the file fails + * @throws SerializationException if serialization fails + */ + void write(java.io.File file, Environment aasEnvironment) + throws FileNotFoundException, IOException, SerializationException { + write(file, DEFAULT_CHARSET, aasEnvironment); + } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java index 45caad7c9..1deec93b2 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,29 +15,24 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +import java.io.IOException; + +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DataSpecificationManager; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIEC61360; +public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer { -import java.io.IOException; -import java.util.Collections; -import java.util.List; - -// TODO fix the EmbeddedDataSpecification issue -public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer> { + private static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationIec61360"; @Override - public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public DataSpecificationIec61360 deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); if (node == null) { return null; @@ -47,23 +41,14 @@ public List deserialize(JsonParser parser, Deserializa return createEmbeddedDataSpecificationsFromContent(parser, node); } - private JsonNode getReferenceNode(JsonParser parser, JsonNode node) throws JsonMappingException { - if (!node.has(DataSpecificationManager.PROP_DATA_SPECIFICATION)) { - throw new JsonMappingException(parser, String.format("data specification must contain node '%s'", DataSpecificationManager.PROP_DATA_SPECIFICATION)); - } - JsonNode nodeDataSpecification = node.get(DataSpecificationManager.PROP_DATA_SPECIFICATION); - return nodeDataSpecification; - } - private List createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { - JsonNode nodeContent = node.get(DataSpecificationManager.PROP_DATA_SPECIFICATION_CONTENT); - JsonNode specificationNode = nodeContent.get("dataSpecificationIEC61360"); - DataSpecificationContent content = createDefaultDataSpecificationIEC61360FromNode(parser, specificationNode); - return Collections.singletonList(content); + private DataSpecificationIec61360 createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { + JsonNode nodeContent = node.get(PROP_DATA_SPECIFICATION_CONTENT); + return createDefaultDataSpecificationIec61360FromNode(parser, nodeContent); } - private DataSpecificationContent createDefaultDataSpecificationIEC61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { - return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIEC61360.class); + private DataSpecificationIec61360 createDefaultDataSpecificationIec61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { + return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIec61360.class); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java index 42f255af0..94c505b12 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2022 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,12 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +import java.io.IOException; +import java.util.Collections; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -23,22 +29,10 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.io.IOException; -import java.util.Collections; -import java.util.List; public class OperationVariableDeserializer extends JsonDeserializer> { - - public OperationVariableDeserializer() { - } - - @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); @@ -60,7 +54,7 @@ public List deserialize(JsonParser parser, DeserializationCon private List createOperationVariablesFromArrayNode(JsonParser parser, ObjectNode node) throws IOException { ArrayNode content = (ArrayNode) node.get("operationVariable"); - return (List) DeserializationHelper.createInstancesFromArrayNode(parser, content, OperationVariable.class); + return DeserializationHelper.createInstancesFromArrayNode(parser, content, OperationVariable.class); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java index ce2d633ee..a1930c8ea 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java @@ -25,7 +25,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2022 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,10 +42,11 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; import java.io.IOException; -import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -54,20 +55,12 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; - public class QualifierDeserializer extends JsonDeserializer> { - - public QualifierDeserializer() { - } - - @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); - List qualifiers = new ArrayList<>(); if (!node.has("qualifier")) { return Collections.emptyList(); @@ -82,10 +75,9 @@ public List deserialize(JsonParser parser, DeserializationContext ctx } - @SuppressWarnings("unchecked") private List createConstraintsFromArrayNode(JsonParser parser, ObjectNode node) throws IOException { ArrayNode content = (ArrayNode) node.get("qualifier"); - return (List) DeserializationHelper.createInstancesFromArrayNode(parser, content, Qualifier.class); + return DeserializationHelper.createInstancesFromArrayNode(parser, content, Qualifier.class); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java index baac7da10..1fed0147e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +20,8 @@ import java.util.Collections; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.TreeNode; @@ -29,13 +30,12 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - public class ReferencesDeserializer extends JsonDeserializer> { @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { TreeNode treeNode = DeserializationHelper.getRootTreeNode(parser); + treeNode = treeNode.get("reference"); if (treeNode.isArray()) { return createReferencesFromArray(parser, (ArrayNode) treeNode); } else { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java index 6a591795d..df65da5af 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +25,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; public class SubmodelElementDeserializer extends JsonDeserializer { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java index 4eae88d22..cad350fb0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +21,8 @@ import java.util.Iterator; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.TreeNode; @@ -33,8 +34,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - public class SubmodelElementsDeserializer extends JsonDeserializer> { private SubmodelElementDeserializer deserializer = new SubmodelElementDeserializer(); @@ -57,8 +56,7 @@ public List deserialize(JsonParser parser, DeserializationConte } private List createSubmodelElements(JsonParser parser, DeserializationContext ctxt, TreeNode treeNode) throws IOException, JsonProcessingException { -// JsonNode nodeSubmodelElement = getSubmodelElementsNode(treeNode); - if (treeNode.isArray()) { + if (treeNode.isArray()) { return getSubmodelElementsFromArrayNode(parser, ctxt, (ArrayNode) treeNode); } else { return getSubmodelElementsFromObjectNode(parser, ctxt, (JsonNode) treeNode); @@ -91,12 +89,6 @@ private List getSubmodelElementsFromObjectNode(JsonParser parse return submodelElements; } - private JsonNode getSubmodelElementsNode(TreeNode temp) { - ObjectNode objNode = (ObjectNode) temp; - JsonNode nodeSubmodelElement = objNode.get("submodelElement"); // TODO: most likely the node will have the name of a SME subclass, e.g. "property" and not "submodelElement" - return nodeSubmodelElement; - } - private List getSubmodelElementsFromArrayNode(JsonParser parser, DeserializationContext ctxt, ArrayNode arrayNode) throws IOException, JsonProcessingException { List elements = new ArrayList<>(); for (int i = 0; i < arrayNode.size(); i++) { @@ -109,8 +101,7 @@ private List getSubmodelElementsFromArrayNode(JsonParser parser private SubmodelElement getSubmodelElementFromJsonNode(JsonParser parser, DeserializationContext ctxt, JsonNode nodeSubmodelElement) throws IOException, JsonProcessingException { JsonParser parserReference = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeSubmodelElement); - SubmodelElement elem = deserializer.deserialize(parserReference, ctxt); - return elem; + return deserializer.deserialize(parserReference, ctxt); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java new file mode 100644 index 000000000..05eded296 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal; + +import java.util.HashMap; +import java.util.Map; + + +public class AasXmlNamespaceContext { + + public static final String AAS_PREFERRED_PREFIX = "aas"; + public static final String AAS_URI = "https://admin-shell.io/aas/3/0"; + + public static final String XSI_PREFERRED_PREFIX = "xsi"; + public static final String XSI_URI = "http://www.w3.org/2001/XMLSchema-instance"; + + public static final Map PREFERRED_PREFIX_CONTEXT = new HashMap<>(); + + static { + PREFERRED_PREFIX_CONTEXT.put(AAS_PREFERRED_PREFIX, AAS_URI); + PREFERRED_PREFIX_CONTEXT.put(XSI_PREFERRED_PREFIX, XSI_URI); + } + + private AasXmlNamespaceContext() { + } +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java new file mode 100644 index 000000000..dc4dbda68 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal; + +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Collectors; + +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultCapability; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEventPayload; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; + +public class SubmodelElementManager { + + public static Map, String> CLASS_TO_NAME = new HashMap<>(); + public static Map> NAME_TO_CLASS = new HashMap<>(); + + static { + CLASS_TO_NAME.put(DefaultAnnotatedRelationshipElement.class, "annotatedRelationshipElement"); + CLASS_TO_NAME.put(DefaultRelationshipElement.class, "relationshipElement"); + CLASS_TO_NAME.put(DefaultReferenceElement.class, "referenceElement"); + CLASS_TO_NAME.put(DefaultProperty.class, "property"); + CLASS_TO_NAME.put(DefaultFile.class, "file"); + CLASS_TO_NAME.put(DefaultBlob.class, "blob"); + CLASS_TO_NAME.put(DefaultRange.class, "range"); + CLASS_TO_NAME.put(DefaultMultiLanguageProperty.class, "multiLanguageProperty"); + CLASS_TO_NAME.put(DefaultCapability.class, "capability"); + CLASS_TO_NAME.put(DefaultEntity.class, "entity"); + CLASS_TO_NAME.put(DefaultBasicEventElement.class, "basicEventElement"); + CLASS_TO_NAME.put(DefaultEventPayload.class, "eventPayload"); + CLASS_TO_NAME.put(DefaultOperation.class, "operation"); + CLASS_TO_NAME.put(DefaultOperationVariable.class, "operationVariable"); + CLASS_TO_NAME.put(DefaultLangStringTextType.class, "langStringTextType"); + CLASS_TO_NAME.put(DefaultLangStringNameType.class, "langStringNameType"); + CLASS_TO_NAME.put(DefaultLangStringDefinitionTypeIec61360.class, "langStringDefinitionTypeIec61360"); + CLASS_TO_NAME.put(DefaultLangStringPreferredNameTypeIec61360.class, "langStringPreferredNameTypeIec61360"); + CLASS_TO_NAME.put(DefaultLangStringShortNameTypeIec61360.class, "langStringShortNameTypeIec61360"); + CLASS_TO_NAME.put(DefaultSubmodelElementCollection.class, "submodelElementCollection"); + CLASS_TO_NAME.put(DefaultSubmodelElementList.class, "submodelElementList"); + NAME_TO_CLASS = CLASS_TO_NAME.entrySet().stream().collect(Collectors.toMap(x -> x.getValue(), x -> x.getKey())); + } + + public static String getXmlName(Class type) { + return CLASS_TO_NAME.get(type); + } + + public static Class getClassByXmlName(String xmlName) { + return NAME_TO_CLASS.get(xmlName); + } + + private SubmodelElementManager() { + } +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java new file mode 100644 index 000000000..0b886d776 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal; + +import java.util.Collection; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.cfg.MapperConfig; +import com.fasterxml.jackson.databind.introspect.Annotated; +import com.fasterxml.jackson.databind.introspect.AnnotatedClass; +import com.fasterxml.jackson.databind.introspect.AnnotatedMethod; +import com.fasterxml.jackson.dataformat.xml.JacksonXmlAnnotationIntrospector; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; + +/** + * This class helps to dynamically decide how to de-/serialize classes and + * properties defined in the AAS model library. It will automatically add a default namespace + * to property names and set a default property order for contained elements. + * + * Will also add @JsonInclude(JsonInclude.Include.NON_EMPTY) to all getter methods returning any type of + * Collection<?> defined in the AAS model + */ +public class XmlDataformatAnnotationIntrospector extends JacksonXmlAnnotationIntrospector { + private static final long serialVersionUID = 1L; + + private static final String GETTER_PREFIX = "get"; + protected String myDefaultNamespace = ""; + + public XmlDataformatAnnotationIntrospector() { + super(); + myDefaultNamespace = AasXmlNamespaceContext.AAS_URI; + } + + @Override + public String findNamespace(MapperConfig config, Annotated ann) { + String ns = super.findNamespace(null, ann); + if (ns == null) { + return myDefaultNamespace; + } else { + return ns; + } + } + + @Override + public String[] findSerializationPropertyOrder(AnnotatedClass ac) { + String[] order = super.findSerializationPropertyOrder(ac); + if (order == null) { + order = new String[] { + "extensions", "idShort", "displayName", "category", "description", "administration", "identification", "kind", "semanticId", + "qualifiers", "embeddedDataSpecification", "dataSpecifications", "isCaseOf", "security", "derivedFrom", "submodels", "assetInformation", "views", "externalSubjectId", "key", "allowDuplicates", "ordered", "valueId", "value", + "max", "min", "type", "valueType", "mimeType", "first", "second", "annotations", "revision", "version", "defaultThumbnail", "globalAssetId", "externalAssetId", "entityType", "statements", "assetKind", "billOfMaterials", + "specificAssetIds", "observed", "inoutputVariables", "inputVariables", "outputVariables", "submodelElements", "containedElements" + }; + } + return order; + } + + @Override + public JsonInclude.Value findPropertyInclusion(Annotated a) { + JsonInclude.Value result = super.findPropertyInclusion(a); + if (result != JsonInclude.Value.empty()) { + return result; + } + if (AnnotatedMethod.class.isAssignableFrom(a.getClass())) { + AnnotatedMethod method = (AnnotatedMethod) a; + if (method.getParameterCount() == 0 + && method.getName().startsWith(GETTER_PREFIX) + && Collection.class.isAssignableFrom(method.getRawReturnType()) + && ReflectionHelper.isModelInterfaceOrDefaultImplementation(method.getDeclaringClass())) { + return result.withValueInclusion(JsonInclude.Include.NON_EMPTY); + } + } + return result; + } +} \ No newline at end of file diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java index 686afa6da..1e2728ed4 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,20 +17,19 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - @JsonPropertyOrder({ "hasExtension", "category", "idShort", "displayNames", "description", "checksum", "administration", "id", "dataSpecifications", "embeddedDataSpecifications", "derivedFrom", "assetInformation", "submodels"}) public interface AssetAdministrationShellMixin { - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "id") //TODO move into IdentifiableMixin - public String getId(); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "id") + public String getID(); @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodels") diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java index d4b2af09f..1ab503390 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,40 +18,27 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; - @JsonPropertyOrder({ "assetKind", "globalAssetId", "specificAssetIds", "defaultThumbnail"}) public interface AssetInformationMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetIds") - public List getSpecificAssetIds(); + public List getSpecificAssetIds(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetIds") - public void setSpecificAssetIds(List specificAssetIds); + public void setSpecificAssetIds(List specificAssetIds); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") - public Reference getGlobalAssetId(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") - public void setGlobalAssetId(Reference globalAssetId); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodelRef") - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "billOfMaterials") - public List getBillOfMaterials(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodelRef") - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "billOfMaterials") - public void setBillOfMaterials(List billOfMaterials); + public String getGlobalAssetID(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "defaultThumbnail") public File getDefaultThumbnail(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java index 22b084d81..1081f1130 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,26 +17,24 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - @JsonPropertyOrder({"hasExtension", "category", "idShort", "displayName", "description", "checksum", "administration", "id", "embeddedDataSpecification", "isCaseOf"}) public interface ConceptDescriptionMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "reference") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "isCaseOf") - // @JsonDeserialize(using = ReferencesDeserializer.class) public List getIsCaseOf(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "reference") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "isCaseOf") - // @JsonDeserialize(using = ReferencesDeserializer.class) public void setIsCaseOf(List isCaseOf); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java index 7698c1926..eefb98b28 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,45 +15,60 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDefinitionTypeIec61360Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsPreferredNameTypeIec61360Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsShortNameTypeIec61360Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsDefinitionTypeIec61360Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsPreferredNameTypeIec61360Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsShortNameTypeIec61360Serializer; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ValueList; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - -import java.util.List; @JsonPropertyOrder({"preferredName", "shortName", "unit", "unitId", "sourceOfDefinition", "symbol", "dataType", "definition", "valueFormat", "valueList", "value", "valueId", "levelType"}) -//@JacksonXmlRootElement(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationIec61360") -public interface DataSpecificationIEC61360Mixin { +public interface DataSpecificationIec61360Mixin { + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") + @JsonSerialize(using = LangStringsDefinitionTypeIec61360Serializer.class) + public List getDefinition(); - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") - public List getDefinition(); - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") - public void setDefinition(List definition); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") + @JsonDeserialize(using = LangStringsDefinitionTypeIec61360Deserializer.class) + public void setDefinition(List definition); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "levelType") public LevelType getLevelType(); - // TODO -// @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "levelType") - // public void setLevelTypes(List levelTypes); -// @JsonInclude(JsonInclude.Include.ALWAYS) - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") - public List getPreferredName(); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") + @JsonSerialize(using = LangStringsPreferredNameTypeIec61360Serializer.class) + public List getPreferredName(); - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") - public void setPreferredName(List preferredName); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") + @JsonDeserialize(using = LangStringsPreferredNameTypeIec61360Deserializer.class) + public void setPreferredName(List preferredName); - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") - public List getShortName(); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") + @JsonSerialize(using = LangStringsShortNameTypeIec61360Serializer.class) + public List getShortName(); - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") - public void setShortName(List shortName); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") + @JsonDeserialize(using = LangStringsShortNameTypeIec61360Deserializer.class) + public void setShortName(List shortName); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "sourceOfDefinition") public String getSourceOfDefinition(); @@ -66,7 +80,7 @@ public interface DataSpecificationIEC61360Mixin { public String getUnit(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "unitId") - public Reference getUnitId(); + public Reference getUnitID(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueFormat") public String getValueFormat(); @@ -77,11 +91,16 @@ public interface DataSpecificationIEC61360Mixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueList") public ValueList getValueList(); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueList") + public void setValueList(ValueList valueList); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") public Reference getValueId(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataType") @JsonSerialize(using = EnumSerializer.class) - public DataTypeIEC61360 getDataType(); + public DataTypeIec61360 getDataType(); + + } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java index 3b5bfe6fe..8832434c2 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java @@ -1,36 +1,46 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - -@JsonPropertyOrder({"dataSpecification", "dataSpecificationContent"}) -public interface EmbeddedDataSpecificationMixin { - - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecification") - public Reference getDataSpecification(); - - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") - @JsonSerialize(using = EmbeddedDataSpecificationSerializer.class) - public DataSpecificationIEC61360 getDataSpecificationContent(); - -} +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.EmbeddedDataSpecificationsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +@JsonPropertyOrder({"dataSpecification", "dataSpecificationContent"}) +public interface EmbeddedDataSpecificationMixin { + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecification") + public Reference getDataSpecification(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecification") + public void setDataSpecification(Reference dataSpecification); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") + @JsonSerialize(using = EmbeddedDataSpecificationSerializer.class) + public DataSpecificationContent getDataSpecificationContent(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") + @JsonDeserialize(using = EmbeddedDataSpecificationsDeserializer.class) + public void setDataSpecificationContent(DataSpecificationContent dataSpecificationIEC61360); + +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java index fbe80a98b..461fb73c5 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,25 +17,23 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - public interface EntityMixin { - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") - public SpecificAssetId getExternalAssetId(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "statements") -// @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "statements") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_NULL) @JsonSerialize(using = SubmodelElementsSerializer.class) @JsonDeserialize(using = SubmodelElementsDeserializer.class) public List getStatements(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") + void setGlobalAssetID(String globalAssetID); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java index 2d474410e..9ccd1bfc1 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +17,8 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.*; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java index ee1c5d64a..7e801c9e1 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +15,13 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import java.util.List; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; public interface HasDataSpecificationMixin { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java index 7f89ab25d..f4489b4f7 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +20,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Extension; public interface HasExtensionsMixin { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java index 70eee5159..34e5864a5 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; @JsonPropertyOrder({"type", "value"}) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java index 2c9242316..da43b241a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,16 +17,21 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; public interface MultiLanguagePropertyMixin { - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") -// @JsonSerialize(using = LangStringsSerializer.class) - @JsonDeserialize(using = LangStringsDeserializer.class) - public List getValue(); + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "langStringTextType") + @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) + public List getValue(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") + void setValueID(Reference valueID); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java index 5b93072b3..cb5002f92 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,36 +17,21 @@ import java.util.List; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.OperationVariableDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + public interface OperationMixin { - //@JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "inputVariables") - //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") public List getInputVariables(); - //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") @JsonDeserialize(using = OperationVariableDeserializer.class) public void setInputVariables(List inputVariables); - - // @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "inoutputVariables") - // TODO: conflicting with getter above @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") - //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "inoutputVariables") - public List getInoutputVariables(); - @JsonDeserialize(using = OperationVariableDeserializer.class) public void setInoutputVariables(List inoutputVariables); - - //@JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "outputVariables") - // TODO: conflicting with getter above @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") - //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "outputVariables") - public List getOutputVariables(); - @JsonDeserialize(using = OperationVariableDeserializer.class) public void setOutputVariables(List outputVariables); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java index 191ab7379..91af44668 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +19,9 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java index 3d5ef989c..0028e520d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,18 +17,17 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.QualifierDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; + import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.QualifierDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; - public interface QualifiableMixin { @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "qualifiers") @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "qualifier") - // TODO @JsonSerialize(using = ConstraintsSerializer.class) @JsonDeserialize(using = QualifierDeserializer.class) public List getQualifiers(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java index f3ad9cb5d..6d9a72164 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +16,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + @JsonPropertyOrder({ "semanticId", "supplementalSemanticIds", // --> HasSemantics "kind", "type", "valueType", "value", "valueId" @@ -36,7 +37,7 @@ public interface QualifierMixin { void setType(String type); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueType") - void setType(DataTypeDefXsd valueType); + void setType(DataTypeDefXsd valueType); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") void setValue(String value); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java index 88ef3306c..552eb1d3e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,42 +17,37 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsNameTypeDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsNameTypeSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsTextTypeSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - @JsonPropertyOrder({"hasExtensions", "category", "idShort", "displayName", "description", "checksum"}) public interface ReferableMixin { - -// @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") -// public String getCategory(); -// -// @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") -// public void setCategory(String category); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") - @JsonSerialize(using = LangStringsSerializer.class) - public List getDescription(); + @JsonSerialize(using = LangStringsTextTypeSerializer.class) + public List getDescription(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") - @JsonDeserialize(using = LangStringsDeserializer.class) - public void setDescription(List descriptions); + @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) + public void setDescription(List descriptions); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") -// @JsonSerialize(using = LangStringsSerializer.class) - @JsonDeserialize(using = LangStringsDeserializer.class) - public List getDisplayName(); + @JsonDeserialize(using = LangStringsNameTypeDeserializer.class) + public List getDisplayName(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") - public void setDisplayName(List displayNames); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") + @JsonSerialize(using = LangStringsNameTypeSerializer.class) + public void setDisplayName(List displayNames); -// @JsonInclude(JsonInclude.Include.ALWAYS) public String getIdShort(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java index 9347321b0..41d8dce6c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +22,8 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.KeysDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java index 4f5025748..ef49d195c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +16,11 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; @JsonPropertyOrder({"path", "contentType"}) public interface ResourceMixin { @@ -28,5 +29,5 @@ public interface ResourceMixin { public String getPath(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "contentType") - public DataTypeDefXsd getContentType(); + public DataTypeDefXsd getContentType(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java index 3d9ee0220..511735600 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,15 +15,15 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - @JsonPropertyOrder({"hasSemantics", "name", "value", "externalSubjectId"}) -public interface SpecificAssetIdMixin { - +public interface SpecificAssetIDMixin { + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "name") public String getName(); @@ -32,5 +31,5 @@ public interface SpecificAssetIdMixin { public String getValue(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "externalSubjectId") - public Reference getExternalSubjectId(); + public Reference getExternalSubjectID(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java index a7d285c1f..102e1f4d8 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +21,8 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java index 4610a971f..4992fb50f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +17,14 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; + @JsonPropertyOrder({ - "hasExtensions", "category", "idShort", "displayNames", "description", "checksum", // --> Referable + "hasExtensions", "category", "idShort", "displayName", "description", "checksum", // --> Referable "kind", // --> HasKind - "semanticId", "supplementalSemanticIds", // --> HasSemantics + "semanticId", "supplementalSemanticIds", "reference", // --> HasSemantics "qualifier", // --> Qualifiable "dataSpecifications", "embeddedDataSpecifications", // --> HasDataSpecifications + "orderRelevant", "semanticIdListElement", "typeValueListElement", "valueTypeListElement", // --> SME-List "valueType", "value", "valueId" // --> Property , "statements", "entityType", "globalAssetId", "specificAssetId" // --> Entity , "first", "second", "annotations" // --> (Annotated)RelationsShipElement diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java index c62d7a497..bcb0845e9 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,14 +22,12 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -@JsonPropertyOrder({ "hasExtension", "category", "idShort", "displayNames", "description", "checksum", "administration", - "id", "kind", "semanticId", "supplementalSemanticIds", "qualifier", "dataSpecifications", - "embeddedDataSpecifications", "submodelElements"}) +@JsonPropertyOrder({ "hasExtension", "category", "idShort", "displayNames", "description", "checksum", "administration", "id", "kind", "semanticId", "supplementalSemanticIds", "qualifier", "dataSpecifications", "embeddedDataSpecifications", "submodelElements"}) public interface SubmodelMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodelElements") @JsonSerialize(using = SubmodelElementsSerializer.class) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java index 7a0550db6..d13a78bbb 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +15,15 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.ValueReferencePairsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; -import java.util.List; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; public interface ValueListMixin { @@ -30,4 +31,9 @@ public interface ValueListMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueReferencePair") List getValueReferencePairs(); + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueReferencePairs") + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueReferencePair") + @JsonDeserialize(using = ValueReferencePairsDeserializer.class) + public void setValueReferencePairs(List valueReferencePair); + } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java index a8a3544d7..52fc57b22 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,16 +15,16 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonPropertyOrder({"value", "valueId"}) +@JsonPropertyOrder({ "value", "valueID" }) public interface ValueReferencePairMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") - public Reference getValueId(); + public Reference getValueID(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") public String getValue(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java index cd4e5d2e1..8f2e2c085 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java @@ -24,7 +24,7 @@ import javax.xml.namespace.QName; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.AbstractLangString; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java index 1cdf8e20e..6ba166590 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,7 +20,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.AbstractLangString; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java index e1b1ac179..08a2ca10e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,22 +24,22 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; - public class AssetAdministrationShellEnvironmentSerializer extends JsonSerializer { private static final String[] SCHEMA_LOCATION = {"xsi:schemaLocation", - "https://admin-shell.io/aas/3/0/RC02 AAS.xsd http://www.admin-shell.io/IEC61360/3/0 IEC61360.xsd http://www.admin-shell.io/aas/abac/3/0 AAS_ABAC.xsd"}; + "https://admin-shell.io/aas/3/0 AAS.xsd" }; private static final QName AASENV_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "environment"); private static final QName AASLIST_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "assetAdministrationShells"); @@ -49,8 +48,6 @@ public class AssetAdministrationShellEnvironmentSerializer extends JsonSerialize private static final QName CONCEPTDICTIONARY_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "conceptDescription"); private static final QName SUBMODELLIST_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "submodels"); private static final QName SUBMODEL_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "submodel"); - private static final QName ASSETLIST_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "assets"); - private static final QName ASSET_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "asset"); private Map namespacePrefixes; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java index 0f387ca6e..800e7e233 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +23,7 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; public class DataElementsSerializer extends JsonSerializer> { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java index aa99ff032..1208a07d6 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,17 +15,15 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +import java.io.IOException; + + import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; /** @@ -34,27 +31,22 @@ * of a reference. Uses DataSpecificationManager to resolve java type to * reference. */ -// TODO: solve EmbeddedDataSpecifiction issue -public class EmbeddedDataSpecificationSerializer extends JsonSerializer { - - private static final Logger logger = LoggerFactory.getLogger(EmbeddedDataSpecificationSerializer.class); +public class EmbeddedDataSpecificationSerializer extends JsonSerializer { @Override - public void serialize(DataSpecificationIEC61360 data, JsonGenerator generator, SerializerProvider provider) + public void serialize(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider) throws IOException { if (data == null) { return; } -// generator.writeFieldName(PROP_DATA_SPECIFICATION_CONTENT); generator.writeStartObject(); - // TODO: Add field name according to template type generator.writeObjectField("dataSpecificationIec61360", data); generator.writeEndObject(); } @Override - public void serializeWithType(DataSpecificationIEC61360 data, JsonGenerator generator, SerializerProvider provider, + public void serializeWithType(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider, TypeSerializer typedSerializer) throws IOException, JsonProcessingException { serialize(data, generator, provider); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java index 306dcccec..5ca546993 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,22 +15,19 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +import java.io.IOException; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; + import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; - -import java.io.IOException; public class OperationVariableSerializer extends JsonSerializer { - - private SubmodelElementSerializer ser = new SubmodelElementSerializer(); - @Override public void serialize(OperationVariable operationVariable, JsonGenerator gen, SerializerProvider serializers) throws IOException { - ToXmlGenerator xgen = (ToXmlGenerator) gen; xgen.writeStartObject(); xgen.writeFieldName("operationVariable"); @@ -45,17 +41,4 @@ public void serialize(OperationVariable operationVariable, JsonGenerator gen, Se xgen.writeEndObject(); } - - private void serializeOperationVariable(ToXmlGenerator xgen, OperationVariable operationVariable) throws IOException { - - - xgen.writeStartObject(); -// xgen.writeFieldName("language"); -// xgen.writeString(langString.getLanguage()); -// -// xgen.writeFieldName("text"); -// xgen.writeString(langString.getText()); - - xgen.writeEndObject(); - } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java index df63759c8..39c94f386 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,16 +18,16 @@ import java.io.IOException; import java.lang.reflect.Field; +import javax.xml.namespace.QName; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import javax.xml.namespace.QName; - public class SubmodelElementSerializer extends JsonSerializer { @Override @@ -47,7 +46,6 @@ public void serialize(SubmodelElement value, JsonGenerator gen, SerializerProvid return ; } } catch (NoSuchFieldException | IllegalAccessException e) { - // TODO: report exception throw new IOException(e); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java index 2b77c753d..6b119a711 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +23,8 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.*; public class SubmodelElementsSerializer extends JsonSerializer> { diff --git a/dataformat-xml/src/main/resources/AAS.xsd b/dataformat-xml/src/main/resources/AAS.xsd index f61f1bf08..8f8569e73 100644 --- a/dataformat-xml/src/main/resources/AAS.xsd +++ b/dataformat-xml/src/main/resources/AAS.xsd @@ -1,591 +1,1346 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java index 3b1fce30d..784f3f888 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,28 +15,50 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; +import java.io.FileNotFoundException; +import java.util.List; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.Operation; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.junit.Assert; import org.junit.Test; -import java.io.FileNotFoundException; -import java.util.List; - public class XMLDeserializerTest { + @Test + public void deserializeAASSimple() throws FileNotFoundException, DeserializationException { + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); + + Assert.assertEquals(AASSimple.createEnvironment(), env); + } + @Test - public void deserializeAASSimple() throws Exception { + public void deserializeAASSimpleAAS() throws Exception { Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); - Assert.assertEquals(AASSimple.ENVIRONMENT, env); - } + + Assert.assertEquals(AASSimple.createEnvironment().getAssetAdministrationShells(), env.getAssetAdministrationShells()); + } + + @Test + public void deserializeAASSimpleSubmodel() throws Exception { + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); + + Assert.assertEquals(AASSimple.createEnvironment().getSubmodels(), env.getSubmodels()); + } + + @Test + public void deserializeAASSimpleConceptDescription() throws Exception { + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); + + Assert.assertEquals(AASSimple.createEnvironment().getConceptDescriptions(), env.getConceptDescriptions()); + } @Test public void deserializeAnnotedRelationshipElement() throws Exception { @@ -57,7 +78,7 @@ public void deserializeQualifier() throws Exception { @Test public void deserializeOperation() throws Exception { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE_WITH_OPERATION); + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE_WITH_OPERATIONS); Assert.assertNotNull(env); OperationVariable inputVariable = ((Operation) env.getSubmodels().get(0).getSubmodelElements().get(0)).getInputVariables().get(0); @@ -73,6 +94,26 @@ public void deserializeOperation() throws Exception { @Test public void deserializeAASFull() throws FileNotFoundException, DeserializationException { Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); - Assert.assertEquals(AASFull.ENVIRONMENT, env); + Assert.assertEquals(AASFull.createEnvironment(), env); } + + @Test + public void deserializeAASFullAAS() throws FileNotFoundException, DeserializationException { + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); + Assert.assertEquals(AASFull.createEnvironment().getAssetAdministrationShells(), env.getAssetAdministrationShells()); + } + + @Test + public void deserializeAASFullSubmodel() throws FileNotFoundException, DeserializationException { + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); + + Assert.assertEquals(AASFull.createEnvironment().getSubmodels(), env.getSubmodels()); + } + + @Test + public void deserializeAASFullConceptDescription() throws FileNotFoundException, DeserializationException { + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); + + Assert.assertEquals(AASFull.createEnvironment().getConceptDescriptions(), env.getConceptDescriptions()); + } } diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java index 69cc64dd7..6ca6b6c65 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; + import static org.junit.Assert.assertTrue; import java.io.File; @@ -27,24 +28,32 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; import org.hamcrest.MatcherAssert; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.w3c.dom.Node; import org.xml.sax.SAXException; import org.xmlunit.diff.DefaultNodeMatcher; import org.xmlunit.diff.ElementSelectors; import org.xmlunit.matchers.CompareMatcher; +import org.xmlunit.util.Predicate; -import com.fasterxml.jackson.core.JsonProcessingException; public class XmlSerializerTest { public static final java.io.File AASFULL_FILE = new java.io.File("src/test/resources/test_demo_full_example.xml"); @@ -52,7 +61,7 @@ public class XmlSerializerTest { public static final java.io.File AASSIMPLE_FILE_WITH_TEST_NAMESPACE = new java.io.File("src/test/resources/xmlExampleWithModifiedPrefix.xml"); public static final java.io.File AASFULL_FILE_WITH_ANNOTATED_RELATIONSHIP = new java.io.File("src/test/resources/annotated_relationship_example.xml"); public static final java.io.File AASFULL_FILE_WITH_QUALIFIERS = new java.io.File("src/test/resources/qualifier_example.xml"); - public static final java.io.File AASFULL_FILE_WITH_OPERATION = new java.io.File("src/test/resources/operation_example.xml"); + public static final java.io.File AASFULL_FILE_WITH_OPERATIONS = new java.io.File("src/test/resources/operation_example.xml"); private static final Logger logger = LoggerFactory.getLogger(XmlSerializerTest.class); @@ -60,14 +69,14 @@ public class XmlSerializerTest { public TemporaryFolder tempFolder = new TemporaryFolder(); @Test - public void testWriteToFile() throws JsonProcessingException, IOException, SerializationException { + public void testWriteToFile() throws IOException, SerializationException { File file = tempFolder.newFile("output.xml"); - new XmlSerializer().write(file, AASSimple.ENVIRONMENT); + new XmlSerializer().write(file, AASSimple.createEnvironment()); assertTrue(file.exists()); } @Test - public void testSerializeMinimal() throws IOException, SerializationException, SAXException { + public void testSerializeMinimal() throws SerializationException, SAXException { File file = new File("src/test/resources/minimum.xml"); Environment environment = new DefaultEnvironment.Builder() .assetAdministrationShells(new DefaultAssetAdministrationShell.Builder() @@ -81,21 +90,21 @@ public void testSerializeMinimal() throws IOException, SerializationException, S } @Test - public void testSerializeSimpleWithTestNamespacePrefix() throws IOException, SerializationException, SAXException { + public void testSerializeSimpleWithTestNamespacePrefix() throws SerializationException, SAXException { Map nsPrefixes = new HashMap<>(AasXmlNamespaceContext.PREFERRED_PREFIX_CONTEXT); nsPrefixes.put("test", nsPrefixes.get("aas")); nsPrefixes.remove("aas"); - validateXmlSerializer(AASSIMPLE_FILE_WITH_TEST_NAMESPACE, AASSimple.ENVIRONMENT, new XmlSerializer(nsPrefixes)); + validateXmlSerializer(AASSIMPLE_FILE_WITH_TEST_NAMESPACE, AASSimple.createEnvironment(), new XmlSerializer(nsPrefixes)); } @Test - public void testSerializeSimple() throws IOException, SerializationException, SAXException { - validateXmlSerializer(AASSIMPLE_FILE, AASSimple.ENVIRONMENT); + public void testSerializeSimple() throws SerializationException, SAXException { + validateXmlSerializer(AASSIMPLE_FILE, AASSimple.createEnvironment()); } @Test - public void testSerializeFull() throws IOException, SerializationException, SAXException { - validateXmlSerializer(AASFULL_FILE, AASFull.ENVIRONMENT); + public void testSerializeFull() throws SerializationException, SAXException { + validateXmlSerializer(AASFULL_FILE, AASFull.createEnvironment()); } @Test @@ -127,6 +136,14 @@ public void testMinimalOperationAgainstXsdSchema() throws SerializationException assertTrue(errors.isEmpty()); } + @Test + public void testGYear() throws SerializationException, SAXException { + Submodel submodel = new DefaultSubmodel.Builder().id("yearTestSm").submodelElements(new DefaultProperty.Builder().idShort("yearTestProp").valueType(DataTypeDefXsd.GYEAR).build()).build(); + String xml = new XmlSerializer().write(new DefaultEnvironment.Builder().submodels(submodel).build()); + Set errors = validateAgainstXsdSchema(xml); + assertTrue(errors.isEmpty()); + } + @Test public void testDocumentationSubmodelAgainstXsdSchema() throws SerializationException, SAXException { @@ -139,7 +156,7 @@ public void testDocumentationSubmodelAgainstXsdSchema() throws SerializationExce @Test public void testIsCaseOfAgainstXsdSchema() throws SerializationException, SAXException { - ConceptDescription object = AASFull.ENVIRONMENT.getConceptDescriptions().get(0); + ConceptDescription object = AASFull.createEnvironment().getConceptDescriptions().get(0); String xml = new XmlSerializer().write(new DefaultEnvironment.Builder().conceptDescriptions(object).build()); Set errors = validateAgainstXsdSchema( xml ); assertTrue(errors.isEmpty()); @@ -147,12 +164,12 @@ public void testIsCaseOfAgainstXsdSchema() throws SerializationException, SAXExc - private Set validateAgainstXsdSchema(String xml) throws SerializationException, SAXException { + private Set validateAgainstXsdSchema(String xml) throws SAXException { return new XmlSchemaValidator().validateSchema(xml); } private void validateXmlSerializer(File expectedFile, Environment environment) - throws IOException, SerializationException, SAXException { + throws SerializationException, SAXException { validateXmlSerializer(expectedFile, environment, new XmlSerializer()); } @@ -160,12 +177,61 @@ private void validateXmlSerializer(File expectedFile, Environment environment, X throws SerializationException, SAXException { String actual = xmlSerializer.write(environment); Set errors = validateAgainstXsdSchema(actual); - logger.info(actual); + logger.debug(actual); logErrors(expectedFile.getName(), errors); assertTrue(errors.isEmpty()); - CompareMatcher xmlTestMatcher = CompareMatcher.isSimilarTo(expectedFile).normalizeWhitespace().ignoreComments() - .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndAllAttributes)); - MatcherAssert.assertThat(actual, xmlTestMatcher); + CompareMatcher xmlTestMatcher = CompareMatcher + .isSimilarTo(expectedFile) + .normalizeWhitespace() + .ignoreComments() + .withNodeFilter((Predicate) node -> { + return ignoreDefaults(node); + }) // ignore default fields + .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndAllAttributes) + ); + MatcherAssert.assertThat(removeDefaults(actual), xmlTestMatcher); + } + + private String removeDefaults(String aasXml) { + aasXml = aasXml.replace("Instance", ""); + aasXml = aasXml.replace("Instance", ""); + aasXml = aasXml.replace("VARIABLE", ""); + aasXml = aasXml.replace("VARIABLE", ""); + aasXml = aasXml.replace("PROPERTY", ""); // TODO: only for ConceptDescriptions + aasXml = aasXml.replace("PROPERTY", ""); // TODO: only for ConceptDescriptions + aasXml = aasXml.replace("ConceptQualifier", ""); + aasXml = aasXml.replace("ConceptQualifier", ""); + aasXml = aasXml.replace("true", ""); + aasXml = aasXml.replace("true", ""); + return aasXml; + } + + private boolean ignoreDefaults(Node node) { + if (node.getLocalName() != null + && node.getLocalName().equals("kind") + && node.getFirstChild().getNodeValue().equals("Instance")) { + return false; + } + + if (node.getLocalName() != null + && node.getLocalName().equals("category") + && node.getFirstChild().getNodeValue().equals("VARIABLE")) { + return false; + } + + if (node.getLocalName() != null + && node.getLocalName().equals("category") + && node.getFirstChild().getNodeValue().equals("PROPERTY")) { // TODO: only for ConceptDescriptions + return false; + } + + if (node.getLocalName() != null + && node.getLocalName().equals("orderRelevant") + && node.getFirstChild().getNodeValue().equals("true")) { + return false; + } + + return true; } private void logErrors(String validatedFileName, Set errors) { diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java index 8cff59e30..eff9fa49c 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +46,7 @@ public static void prepareValidator() throws SAXException { } @Test - @Parameters({"src/test/resources/minimum.xml", "src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml"}) + @Parameters({ "src/test/resources/minimum.xml", "src/test/resources/Example_AAS_ServoDCMotor - Simplified.xml", "src/test/resources/test_demo_full_example.xml" }) // import from admin-shell.io -> is actually V3 // -> fix name, as soon as it is fixed externally public void validateValidXml(String file) throws IOException { @@ -57,7 +56,7 @@ public void validateValidXml(String file) throws IOException { } @Test - @Parameters({"src/test/resources/invalidXmlExample.xml", "src/test/resources/ServoDCMotor_invalid_V2.0.xml"}) + @Parameters({ "src/test/resources/invalidXmlExample.xml", "src/test/resources/ServoDCMotor_invalid.xml" }) public void validateInvalidXml(String file) throws IOException { Set errors = validateXmlFile(file); logErrors(file, errors); diff --git a/dataformat-xml/src/test/resources/annotated_relationship_example.xml b/dataformat-xml/src/test/resources/annotated_relationship_example.xml index d2fee638f..3573866cb 100644 --- a/dataformat-xml/src/test/resources/annotated_relationship_example.xml +++ b/dataformat-xml/src/test/resources/annotated_relationship_example.xml @@ -1,11 +1,11 @@ - + TestSubmodel - 0.9 - 0 + 0 + 9 https://acplt.org/Test_Submodel Instance @@ -14,7 +14,7 @@ Parameter ExampleAnnotatedRelationshipElement - GlobalReference + ExternalReference GlobalReference @@ -60,7 +60,6 @@ Parameter ExampleProperty3 - Instance xs:string some example annotation diff --git a/dataformat-xml/src/test/resources/invalidXmlExample.xml b/dataformat-xml/src/test/resources/invalidXmlExample.xml index 799effff7..b7b77781f 100644 --- a/dataformat-xml/src/test/resources/invalidXmlExample.xml +++ b/dataformat-xml/src/test/resources/invalidXmlExample.xml @@ -1,5 +1,5 @@ - diff --git a/dataformat-xml/src/test/resources/minimum.xml b/dataformat-xml/src/test/resources/minimum.xml index 705afc014..12445b81e 100644 --- a/dataformat-xml/src/test/resources/minimum.xml +++ b/dataformat-xml/src/test/resources/minimum.xml @@ -1,5 +1,7 @@ - + https://acplt.org/Test_AssetAdministrationShell @@ -8,5 +10,4 @@ - - + \ No newline at end of file diff --git a/dataformat-xml/src/test/resources/operation_example.xml b/dataformat-xml/src/test/resources/operation_example.xml index 62b9d979c..bbc5798bb 100644 --- a/dataformat-xml/src/test/resources/operation_example.xml +++ b/dataformat-xml/src/test/resources/operation_example.xml @@ -1,28 +1,28 @@ - + TestSubmodel - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_Submodel Instance - GlobalReference + ExternalReference GlobalReference @@ -35,18 +35,17 @@ Parameter ExampleOperation - + en-us Example Operation object - - + + de Beispiel Operation Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -61,7 +60,7 @@ Constant ExampleProperty1 - GlobalReference + ExternalReference GlobalReference @@ -72,7 +71,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -89,7 +88,7 @@ Variable ExampleProperty2 - GlobalReference + ExternalReference GlobalReference @@ -100,7 +99,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -119,7 +118,7 @@ Constant ExampleProperty2 - GlobalReference + ExternalReference GlobalReference @@ -130,7 +129,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -149,7 +148,7 @@ Constant ExampleProperty3 - GlobalReference + ExternalReference GlobalReference @@ -160,7 +159,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference diff --git a/dataformat-xml/src/test/resources/qualifier_example.xml b/dataformat-xml/src/test/resources/qualifier_example.xml index c7f7131dd..93b4cc661 100644 --- a/dataformat-xml/src/test/resources/qualifier_example.xml +++ b/dataformat-xml/src/test/resources/qualifier_example.xml @@ -1,5 +1,5 @@ - + TestSubmodel @@ -13,7 +13,7 @@ ManufacturerName - GlobalReference + ExternalReference GlobalReference @@ -36,7 +36,7 @@ xs:string http://acplt.org/ValueId/ACPLT - GlobalReference + ExternalReference GlobalReference diff --git a/dataformat-xml/src/test/resources/test_demo_full_example.xml b/dataformat-xml/src/test/resources/test_demo_full_example.xml index 3a2ce75a1..26fbaefe4 100644 --- a/dataformat-xml/src/test/resources/test_demo_full_example.xml +++ b/dataformat-xml/src/test/resources/test_demo_full_example.xml @@ -1,15 +1,27 @@ - + TestAssetAdministrationShell + + + en-us + An Example Asset Administration Shell for the test application + + + de + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_AssetAdministrationShell - GlobalReference + ExternalReference AssetAdministrationShell @@ -19,19 +31,11 @@ Instance - - GlobalReference - - - AssetAdministrationShell - https://acplt.org/Test_Asset - - - + https://acplt.org/Test_Asset - GlobalReference + ExternalReference Submodel @@ -40,7 +44,7 @@ - GlobalReference + ExternalReference Submodel @@ -49,7 +53,7 @@ - GlobalReference + ExternalReference Submodel @@ -64,19 +68,11 @@ https://acplt.org/Test_AssetAdministrationShell_Mandatory Instance - - GlobalReference - - - AssetAdministrationShell - https://acplt.org/Test_Asset_Mandatory - - - + https://acplt.org/Test_Asset_Mandatory - GlobalReference + ExternalReference Submodel @@ -85,7 +81,7 @@ - GlobalReference + ExternalReference Submodel @@ -100,39 +96,33 @@ https://acplt.org/Test_AssetAdministrationShell2_Mandatory Instance - - GlobalReference - - - AssetAdministrationShell - https://acplt.org/Test_Asset_Mandatory - - - + https://acplt.org/Test_Asset_Mandatory TestAssetAdministrationShell + + + en-us + An Example Asset Administration Shell for the test application + + + de + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_AssetAdministrationShell_Missing Instance - - GlobalReference - - - AssetAdministrationShell - https://acplt.org/Test_Asset_Missing - - - + https://acplt.org/Test_Asset_Missing - GlobalReference + ExternalReference Submodel @@ -147,23 +137,23 @@ Identification - + en-us An example asset identification submodel for the test application - - + + de Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 http://acplt.org/Submodels/Assets/TestAsset/Identification Instance - GlobalReference + ExternalReference Submodel @@ -174,18 +164,24 @@ ManufacturerName + + + en-us + Manufacturer Name + + - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - GlobalReference + ExternalReference GlobalReference @@ -208,7 +204,7 @@ xs:string http://acplt.org/ValueId/ACPLT - GlobalReference + ExternalReference GlobalReference @@ -218,19 +214,20 @@ + VARIABLE InstanceId - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - GlobalReference + ExternalReference GlobalReference @@ -238,10 +235,30 @@ + + + ExternalReference + + + GlobalReference + something_random_e14ad770 + + + + + ExternalReference + + + GlobalReference + something_random_bd061acd + + + + xs:string 978-8234-234-342 - GlobalReference + ExternalReference GlobalReference @@ -255,22 +272,22 @@ BillOfMaterial - + en-us An example bill of material submodel for the test application - - + + de Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - + - 0.9 + 0 http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial Instance - GlobalReference + ExternalReference Submodel @@ -282,17 +299,17 @@ ExampleEntity - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - GlobalReference + ExternalReference GlobalReference @@ -302,21 +319,21 @@ - Constant + CONSTANT ExampleProperty2 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -326,8 +343,8 @@ xs:string http://acplt.org/ValueId/ExampleValue2 - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ValueId/ExampleValue2 @@ -336,21 +353,21 @@ - Constant + CONSTANT ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -360,8 +377,8 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ValueId/ExampleValueId @@ -375,17 +392,17 @@ ExampleEntity2 - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - GlobalReference + ExternalReference GlobalReference @@ -394,38 +411,30 @@ SelfManagedEntity - - GlobalReference - - - AssetAdministrationShell - https://acplt.org/Test_Asset2 - - - + https://acplt.org/Test_Asset2 TestSubmodel - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_Submodel Instance - GlobalReference + ExternalReference GlobalReference @@ -435,20 +444,20 @@ - Parameter + PARAMETER ExampleRelationshipElement - + en-us Example RelationshipElement object - - + + de Beispiel RelationshipElement Element - + - GlobalReference + ExternalReference GlobalReference @@ -464,8 +473,8 @@ https://acplt.org/Test_Submodel - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -492,20 +501,20 @@ - Parameter + PARAMETER ExampleAnnotatedRelationshipElement - + en-us Example AnnotatedRelationshipElement object - - + + de Beispiel AnnotatedRelationshipElement Element - + - GlobalReference + ExternalReference GlobalReference @@ -521,8 +530,8 @@ https://acplt.org/Test_Submodel - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -549,30 +558,28 @@ - Parameter + PARAMETER ExampleProperty3 - Instance xs:string some example annotation - Parameter + PARAMETER ExampleOperation - Template - + en-us Example Operation object - - + + de Beispiel Operation Element - + - GlobalReference + ExternalReference GlobalReference @@ -584,20 +591,20 @@ - Constant + CONSTANT ExampleProperty1 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference + ExternalReference GlobalReference @@ -608,7 +615,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -624,20 +631,20 @@ - Constant + CONSTANT ExampleProperty2 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference + ExternalReference GlobalReference @@ -648,7 +655,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -664,20 +671,20 @@ - Constant + CONSTANT ExampleProperty3 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference + ExternalReference GlobalReference @@ -688,7 +695,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -702,935 +709,60 @@ - Parameter + PARAMETER ExampleCapability - + en-us Example Capability object - - + + de Beispiel Capability Element - + - GlobalReference + ExternalReference GlobalReference http://acplt.org/Capabilities/ExampleCapability -<<<<<<< HEAD - Parameter + PARAMETER ExampleBasicEvent - + en-us Example BasicEvent object - - + + de Beispiel BasicEvent Element - + - GlobalReference -======= - - - - - ExampleRelationshipElement - Parameter - - Example RelationshipElement object - Beispiel RelationshipElement Element - - - - http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - - https://acplt.org/Test_Submodel - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - ExampleEntity - ExampleProperty2 - - - - - - - ExampleAnnotatedRelationshipElement - Parameter - - Example AnnotatedRelationshipElement object - Beispiel AnnotatedRelationshipElement Element - - - - http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - - https://acplt.org/Test_Submodel - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - ExampleEntity - ExampleProperty2 - - - - - - ExampleProperty3 - Parameter - Instance - some example annotation - string - - - - - - - - ExampleOperation - Parameter - - Example Operation object - Beispiel Operation Element - - Template - - - http://acplt.org/Operations/ExampleOperation - - - - - - ExampleProperty3 - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/ValueId/ExampleValueId - - - http://acplt.org/ValueId/ExampleValueId - string - - - - - - - ExampleProperty1 - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/ValueId/ExampleValueId - - - http://acplt.org/ValueId/ExampleValueId - string - - - - - - - ExampleProperty2 - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/ValueId/ExampleValueId - - - http://acplt.org/ValueId/ExampleValueId - string - - - - - - - - ExampleCapability - Parameter - - Example Capability object - Beispiel Capability Element - - - - http://acplt.org/Capabilities/ExampleCapability - - - - - - - ExampleBasicEvent - Parameter - - Example BasicEvent object - Beispiel BasicEvent Element - - - - http://acplt.org/Events/ExampleBasicEvent - - - - - https://acplt.org/Test_Submodel - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - - - ExampleSubmodelCollectionOrdered - Parameter - - Example SubmodelElementCollectionOrdered object - Beispiel SubmodelElementCollectionOrdered Element - - - - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - true - - - - ExampleProperty - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/ValueId/ExampleValueId - - - http://acplt.org/ValueId/ExampleValueId - string - - - - - ExampleMultiLanguageProperty - Constant - - Example MultiLanguageProperty object - Beispiel MulitLanguageProperty Element - - - - http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - - http://acplt.org/ValueId/ExampleMultiLanguageValueId - - - - Example value of a MultiLanguageProperty element - Beispielswert für ein MulitLanguageProperty-Element - - - - - - ExampleRange - Parameter - - Example Range object - Beispiel Range Element - - - - http://acplt.org/Ranges/ExampleRange - - - 100 - 0 - int - - - - - - - - ExampleSubmodelCollectionUnordered - Parameter - - Example SubmodelElementCollectionUnordered object - Beispiel SubmodelElementCollectionUnordered Element - - - - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - false - false - - - - ExampleBlob - Parameter - - Example Blob object - Beispiel Blob Element - - - - http://acplt.org/Blobs/ExampleBlob - - - AQIDBAU= - application/pdf - - - - - ExampleFile - Parameter - - Example File object - Beispiel File Element - - - - http://acplt.org/Files/ExampleFile - - - /TestFile.pdf - application/pdf - - - - - ExampleReferenceElement - Parameter - - Example Reference Element object - Beispiel Reference Element Element - - - - http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - - https://acplt.org/Test_Submodel - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - - - - - - - Test_Submodel_Mandatory - https://acplt.org/Test_Submodel_Mandatory - Template - - - - ExampleRelationshipElement - - - https://acplt.org/Test_Submodel_Mandatory - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - https://acplt.org/Test_Submodel_Mandatory - ExampleSubmodelCollectionOrdered - ExampleMultiLanguageProperty - - - - - - - ExampleAnnotatedRelationshipElement - - - https://acplt.org/Test_Submodel_Mandatory - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - https://acplt.org/Test_Submodel_Mandatory - ExampleSubmodelCollectionOrdered - ExampleMultiLanguageProperty - - - - - - - - ExampleOperation - Template - - - - - ExampleCapability - - - - - ExampleBasicEvent - - - https://acplt.org/Test_Submodel_Mandatory - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - - - ExampleSubmodelCollectionOrdered - true - - - - ExampleProperty - string - - - - - ExampleMultiLanguageProperty - - - - - ExampleRange - int - - - - - - - - ExampleSubmodelCollectionUnordered - false - false - - - - ExampleBlob - application/pdf - - - - - ExampleFile - application/pdf - - - - - ExampleReferenceElement - - - - - - - - ExampleSubmodelCollectionUnordered2 - false - false - - - - - - - Test_Submodel2_Mandatory - https://acplt.org/Test_Submodel2_Mandatory - Instance - - - - TestSubmodel - - An example submodel for the test application - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - 0 - 0.9 - - https://acplt.org/Test_Submodel_Missing - Instance - ->>>>>>> update-to-rc02-smlist-tests + ExternalReference GlobalReference http://acplt.org/Events/ExampleBasicEvent -<<<<<<< HEAD - GlobalReference -======= - - - - - ExampleRelationshipElement - Parameter - - Example RelationshipElement object - Beispiel RelationshipElement Element - - - - http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - - https://acplt.org/Test_Submodel_Missing - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - https://acplt.org/Test_Submodel_Missing - ExampleSubmodelCollectionOrdered - ExampleMultiLanguageProperty - - - - - - - ExampleAnnotatedRelationshipElement - Parameter - - Example AnnotatedRelationshipElement object - Beispiel AnnotatedRelationshipElement Element - - - - http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - - https://acplt.org/Test_Submodel_Missing - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - https://acplt.org/Test_Submodel_Missing - ExampleSubmodelCollectionOrdered - ExampleMultiLanguageProperty - - - - - - ExampleProperty - Parameter - Instance - some example annotation - string - - - - - - - - ExampleOperation - Parameter - - Example Operation object - Beispiel Operation Element - - Template - - - http://acplt.org/Operations/ExampleOperation - - - - - - ExampleProperty3 - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/Qualifier/ExampleQualifier - string - - - exampleValue - string - - - - - - - ExampleProperty1 - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/Qualifier/ExampleQualifier - string - - - exampleValue - string - - - - - - - ExampleProperty2 - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/Qualifier/ExampleQualifier - string - - - exampleValue - string - - - - - - - - ExampleCapability - Parameter - - Example Capability object - Beispiel Capability Element - - - - http://acplt.org/Capabilities/ExampleCapability - - - - - - - ExampleBasicEvent - Parameter - - Example BasicEvent object - Beispiel BasicEvent Element - - - - http://acplt.org/Events/ExampleBasicEvent - - - - - https://acplt.org/Test_Submodel_Missing - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - - - ExampleSubmodelCollectionOrdered - Parameter - - Example SubmodelElementCollectionOrdered object - Beispiel SubmodelElementCollectionOrdered Element - - - - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - true - - - - ExampleProperty - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/Qualifier/ExampleQualifier - string - - - exampleValue - string - - - - - ExampleMultiLanguageProperty - Constant - - Example MultiLanguageProperty object - Beispiel MulitLanguageProperty Element - - - - http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - Example value of a MultiLanguageProperty element - Beispielswert für ein MulitLanguageProperty-Element - - - - - - ExampleRange - Parameter - - Example Range object - Beispiel Range Element - - - - http://acplt.org/Ranges/ExampleRange - - - 100 - 0 - int - - - - - - - - ExampleSubmodelCollectionUnordered - Parameter - - Example SubmodelElementCollectionUnordered object - Beispiel SubmodelElementCollectionUnordered Element - - - - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - false - false - - - - ExampleBlob - Parameter - - Example Blob object - Beispiel Blob Element - - - - http://acplt.org/Blobs/ExampleBlob - - - AQIDBAU= - application/pdf - - - - - ExampleFile - Parameter - - Example File object - Beispiel File Element - - - - http://acplt.org/Files/ExampleFile - - - /TestFile.pdf - application/pdf - - - - - ExampleReferenceElement - Parameter - - Example Reference Element object - Beispiel Reference Element Element - - - - http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - - https://acplt.org/Test_Submodel_Missing - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - - - - - - - TestSubmodel - - An example submodel for the test application - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - 0 - 0.9 - - https://acplt.org/Test_Submodel_Template - Template - ->>>>>>> update-to-rc02-smlist-tests + ModelReference Submodel https://acplt.org/Test_Submodel - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -1638,48 +770,50 @@ - Input - On + input + on - - Parameter - ExampleSubmodelCollectionOrdered + + PARAMETER + ExampleSubmodelElementListOrdered - + en-us - Example SubmodelElementCollectionOrdered object - - + Example ExampleSubmodelElementListOrdered object + + de - Beispiel SubmodelElementCollectionOrdered Element - + Beispiel ExampleSubmodelElementListOrdered Element + - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered + true + SubmodelElement - Constant + CONSTANT ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -1689,8 +823,8 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ValueId/ExampleValueId @@ -1699,21 +833,21 @@ - Constant + CONSTANT ExampleMultiLanguageProperty - + en-us Example MultiLanguageProperty object - - + + de Beispiel MultiLanguageProperty Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -1721,18 +855,18 @@ - + en-us Example value of a MultiLanguageProperty element - - + + de Beispielswert für ein MultiLanguageProperty-Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ValueId/ExampleMultiLanguageValueId @@ -1741,21 +875,21 @@ - Parameter + PARAMETER ExampleRange - + en-us Example Range object - - + + de Beispiel Range Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -1767,46 +901,46 @@ 100 - + - Parameter - ExampleSubmodelCollectionUnordered + PARAMETER + ExampleSubmodelElementCollection - + en-us - Example SubmodelElementCollectionUnordered object - - + Example SubmodelElementCollection object + + de - Beispiel SubmodelElementCollectionUnordered Element - + Beispiel SubmodelElementCollection Element + - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection - Parameter + PARAMETER ExampleBlob - + en-us Example Blob object - - + + de Beispiel Blob Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Blobs/ExampleBlob @@ -1817,21 +951,21 @@ application/pdf - Parameter + PARAMETER ExampleFile - + en-us Example File object - - + + de Beispiel File Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Files/ExampleFile @@ -1842,21 +976,21 @@ application/pdf - Parameter + PARAMETER ExampleReferenceElement - + en-us Example Reference Element object - - + + de Beispiel Reference Element Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -1864,15 +998,15 @@ - GlobalReference - + ExternalReference + Submodel https://acplt.org/Test_Submodel - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -1900,8 +1034,8 @@ https://acplt.org/Test_Submodel_Mandatory - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListUnordered Property @@ -1917,8 +1051,8 @@ https://acplt.org/Test_Submodel_Mandatory - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListUnordered MultiLanguageProperty @@ -1938,11 +1072,11 @@ SubmodelElementCollection - ExampleSubmodelCollectionOrdered + ExampleSubmodelElementCollection - Property - ExampleProperty + Blob + ExampleBlob @@ -1954,8 +1088,8 @@ https://acplt.org/Test_Submodel_Mandatory - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListUnordered MultiLanguageProperty @@ -1966,7 +1100,6 @@ ExampleOperation - Template ExampleCapability @@ -1974,15 +1107,15 @@ ExampleBasicEvent - GlobalReference + ModelReference Submodel https://acplt.org/Test_Submodel_Mandatory - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListUnordered Property @@ -1990,11 +1123,13 @@ - Output - Off + output + off - - ExampleSubmodelCollectionOrdered + + ExampleSubmodelElementListUnordered + false + SubmodelElement ExampleProperty @@ -2008,9 +1143,9 @@ xs:int - + - ExampleSubmodelCollectionUnordered + ExampleSubmodelElementCollection ExampleBlob @@ -2026,7 +1161,7 @@ - ExampleSubmodelCollectionUnordered2 + ExampleSubmodelElementCollection2 @@ -2036,25 +1171,25 @@ Instance - TestSubmodel + TestSubmodelMissing - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_Submodel_Missing Instance - GlobalReference + ExternalReference GlobalReference @@ -2064,20 +1199,20 @@ - Parameter + PARAMETER ExampleRelationshipElement - + en-us Example RelationshipElement object - - + + de Beispiel RelationshipElement Element - + - GlobalReference + ExternalReference GlobalReference @@ -2093,8 +1228,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -2110,8 +1245,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered MultiLanguageProperty @@ -2121,20 +1256,20 @@ - Parameter + PARAMETER ExampleAnnotatedRelationshipElement - + en-us Example AnnotatedRelationshipElement object - - + + de Beispiel AnnotatedRelationshipElement Element - + - GlobalReference + ExternalReference GlobalReference @@ -2150,8 +1285,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -2167,8 +1302,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered MultiLanguageProperty @@ -2178,30 +1313,28 @@ - Parameter + PARAMETER ExampleProperty - Instance xs:string some example annotation - Parameter + PARAMETER ExampleOperation - + en-us Example Operation object - - + + de Beispiel Operation Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -2213,20 +1346,20 @@ - Constant + CONSTANT ExampleProperty1 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference + ExternalReference GlobalReference @@ -2250,20 +1383,20 @@ - Constant + CONSTANT ExampleProperty2 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference + ExternalReference GlobalReference @@ -2287,20 +1420,20 @@ - Constant + CONSTANT ExampleProperty3 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference + ExternalReference GlobalReference @@ -2308,7 +1441,6 @@ -<<<<<<< HEAD http://acplt.org/Qualifier/ExampleQualifier @@ -2323,20 +1455,20 @@ - Parameter + PARAMETER ExampleCapability - + en-us Example Capability object - - + + de Beispiel Capability Element - + - GlobalReference + ExternalReference GlobalReference @@ -2346,20 +1478,20 @@ - Parameter + PARAMETER ExampleBasicEvent - + en-us Example BasicEvent object - - + + de Beispiel BasicEvent Element - + - GlobalReference + ExternalReference GlobalReference @@ -2368,15 +1500,15 @@ - GlobalReference + ExternalReference Submodel https://acplt.org/Test_Submodel_Missing - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -2384,48 +1516,50 @@ - Input - On + input + on - - Parameter - ExampleSubmodelCollectionOrdered + + PARAMETER + ExampleSubmodelElementListOrdered - + en-us - Example SubmodelElementCollectionOrdered object - - + Example SubmodelElementListOrdered object + + de - Beispiel SubmodelElementCollectionOrdered Element - + Beispiel SubmodelElementListOrdered Element + - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered + true + SubmodelElement - Constant + CONSTANT ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -2442,21 +1576,21 @@ exampleValue - Constant + CONSTANT ExampleMultiLanguageProperty - + en-us Example MultiLanguageProperty object - - + + de Beispiel MultiLanguageProperty Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -2464,32 +1598,32 @@ - + en-us Example value of a MultiLanguageProperty element - - + + de Beispielswert für ein MultiLanguageProperty-Element - + - Parameter + PARAMETER ExampleRange - + en-us Example Range object - - + + de Beispiel Range Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -2501,46 +1635,46 @@ 100 - + - Parameter - ExampleSubmodelCollectionUnordered + PARAMETER + ExampleSubmodelElementCollection - + en-us - Example SubmodelElementCollectionUnordered object - - + Example SubmodelElementCollection object + + de - Beispiel SubmodelElementCollectionUnordered Element - + Beispiel SubmodelElementCollection Element + - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection - Parameter + PARAMETER ExampleBlob - + en-us Example Blob object - - + + de Beispiel Blob Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Blobs/ExampleBlob @@ -2551,21 +1685,21 @@ application/pdf - Parameter + PARAMETER ExampleFile - + en-us Example File object - - + + de Beispiel File Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Files/ExampleFile @@ -2576,21 +1710,21 @@ application/pdf - Parameter + PARAMETER ExampleReferenceElement - + en-us Example Reference Element object - - + + de Beispiel Reference Element Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -2598,7 +1732,7 @@ - GlobalReference + ModelReference Submodel @@ -2606,11 +1740,11 @@ SubmodelElementCollection - ExampleSubmodelCollectionOrdered + ExampleSubmodelElementCollection - Property - ExampleProperty + File + ExampleFile @@ -2620,25 +1754,25 @@ - TestSubmodel + TestSubmodelTemplate - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_Submodel_Template Template - GlobalReference + ExternalReference GlobalReference @@ -2648,21 +1782,20 @@ - Parameter + PARAMETER ExampleRelationshipElement - + en-us Example RelationshipElement object - - + + de Beispiel RelationshipElement Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -2673,6 +1806,14 @@ ModelReference + + Submodel + https://acplt.org/Test_Submodel_Template + + + Operation + ExampleOperation + Property ExampleProperty @@ -2682,6 +1823,14 @@ ModelReference + + Submodel + https://acplt.org/Test_Submodel_Template + + + Operation + ExampleOperation + Property ExampleProperty @@ -2690,21 +1839,20 @@ - Parameter + PARAMETER ExampleAnnotatedRelationshipElement - + en-us Example AnnotatedRelationshipElement object - - + + de Beispiel AnnotatedRelationshipElement Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -2715,6 +1863,14 @@ ModelReference + + Submodel + https://acplt.org/Test_Submodel_Template + + + Operation + ExampleOperation + Property ExampleProperty @@ -2724,6 +1880,14 @@ ModelReference + + Submodel + https://acplt.org/Test_Submodel_Template + + + Operation + ExampleOperation + Property ExampleProperty @@ -2732,21 +1896,20 @@ - Parameter + PARAMETER ExampleOperation - + en-us Example Operation object - - + + de Beispiel Operation Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -2758,41 +1921,20 @@ - Constant + CONSTANT ExampleProperty -<<<<<<< HEAD -======= - - - ExampleProperty - - - - - - - ExampleSubmodelCollectionOrdered - Parameter - Example SubmodelElementCollectionOrdered object - Beispiel SubmodelElementCollectionOrdered Element - ->>>>>>> update-to-rc02-smlist-tests -======= - - + en-us Example Property object - - + + de Beispiel Property Element - + ->>>>>>> update-to-rc02-xml - Template - GlobalReference + ExternalReference GlobalReference @@ -2800,7 +1942,6 @@ -<<<<<<< HEAD xs:string @@ -2810,108 +1951,20 @@ - Constant + CONSTANT ExampleProperty -<<<<<<< HEAD -======= - true - - - - ExampleProperty - Constant - - Example Property object - Beispiel Property Element - - Template - - - http://acplt.org/Properties/ExampleProperty - - - string - - - - - ExampleMultiLanguageProperty - Constant - - Example MultiLanguageProperty object - Beispiel MulitLanguageProperty Element - - Template - - - http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - - - - ExampleRange - Parameter - - Example Range object - Beispiel Range Element - - Template - - - http://acplt.org/Ranges/ExampleRange - - - 100 - int - - - - - ExampleRange2 - Parameter - - Example Range object - Beispiel Range Element - - Template - - - http://acplt.org/Ranges/ExampleRange - - - 0 - int - - - - - - - - ExampleSubmodelCollectionUnordered - Parameter - Example SubmodelElementCollectionUnordered object - Beispiel SubmodelElementCollectionUnordered Element - ->>>>>>> update-to-rc02-smlist-tests -======= - - + en-us Example Property object - - + + de Beispiel Property Element - + ->>>>>>> update-to-rc02-xml - Template - GlobalReference + ExternalReference GlobalReference @@ -2928,21 +1981,20 @@ - Constant + CONSTANT ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -2957,21 +2009,20 @@ - Parameter + PARAMETER ExampleCapability - + en-us Example Capability object - - + + de Beispiel Capability Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -2981,21 +2032,20 @@ - Parameter + PARAMETER ExampleBasicEvent - + en-us Example BasicEvent object - - + + de Beispiel BasicEvent Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -3004,58 +2054,66 @@ - GlobalReference + ModelReference + + Submodel + https://acplt.org/Test_Submodel_Template + + + Operation + ExampleOperation + Property ExampleProperty - Output - Off + output + off - - Parameter - ExampleSubmodelCollectionOrdered + + PARAMETER + ExampleSubmodelElementListOrdered - + en-us - Example SubmodelElementCollectionOrdered object - - + Example SubmodelElementListOrdered object + + de - Beispiel SubmodelElementCollectionOrdered Element - + Beispiel SubmodelElementListOrdered Element + - Template - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered + true + SubmodelElement - Constant + CONSTANT ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -3065,22 +2123,21 @@ xs:string - Constant + CONSTANT ExampleMultiLanguageProperty - + en-us Example MultiLanguageProperty object - - + + de Beispiel MultiLanguageProperty Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -3089,22 +2146,21 @@ - Parameter + PARAMETER ExampleRange - + en-us Example Range object - - + + de Beispiel Range Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -3115,22 +2171,21 @@ 100 - Parameter + PARAMETER ExampleRange2 - + en-us Example Range object - - + + de Beispiel Range Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -3141,48 +2196,46 @@ 0 - + - Parameter - ExampleSubmodelCollectionUnordered + PARAMETER + ExampleSubmodelElementCollection - + en-us - Example SubmodelElementCollectionUnordered object - - + Example SubmodelElementCollection object + + de - Beispiel SubmodelElementCollectionUnordered Element - + Beispiel SubmodelElementCollection Element + - Template - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection - Parameter + PARAMETER ExampleBlob - + en-us Example Blob object - - + + de Beispiel Blob Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Blobs/ExampleBlob @@ -3192,22 +2245,21 @@ application/pdf - Parameter + PARAMETER ExampleFile - + en-us Example File object - - + + de Beispiel File Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Files/ExampleFile @@ -3217,22 +2269,21 @@ application/pdf - Parameter + PARAMETER ExampleReferenceElement - + en-us Example Reference Element object - - + + de Beispiel Reference Element Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -3243,25 +2294,24 @@ - Parameter - ExampleSubmodelCollectionUnordered2 + PARAMETER + ExampleSubmodelElementCollection2 - + en-us - Example SubmodelElementCollectionUnordered object - - + Example SubmodelElementCollection object + + de - Beispiel SubmodelElementCollectionUnordered Element - + Beispiel SubmodelElementCollection Element + - Template - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection @@ -3273,27 +2323,27 @@ TestConceptDescription - + en-us An example concept description for the test application - - + + de Ein Beispiel-ConceptDescription für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_ConceptDescription - GlobalReference + ExternalReference GlobalReference - http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription + http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription @@ -3304,67 +2354,68 @@ https://acplt.org/Test_ConceptDescription_Mandatory + PROPERTY TestConceptDescription1 - + en-us An example concept description for the test application - - + + de Ein Beispiel-ConceptDescription für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_ConceptDescription_Missing TestSpec_01 - 0.9 - 0 + 0 + 9 http://acplt.org/DataSpecifciations/Example/Identification - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + de Test Specification - - + + en-us TestSpecification - + - + de Test Spec - - + + en-us TestSpec - + SpaceUnit - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Units/SpaceUnit @@ -3375,14 +2426,14 @@ SU REAL_MEASURE - + de Dies ist eine Data Specification für Testzwecke - - + + en-us This is a DataSpecification for testing purposes - + string @@ -3390,7 +2441,7 @@ http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -3402,7 +2453,7 @@ http://acplt.org/ValueId/ExampleValueId2 - GlobalReference + ExternalReference GlobalReference @@ -3414,14 +2465,13 @@ TEST - Max - GlobalReference + ExternalReference GlobalReference diff --git a/dataformat-xml/src/test/resources/xmlExample.xml b/dataformat-xml/src/test/resources/xmlExample.xml index a09966209..5e37d5016 100644 --- a/dataformat-xml/src/test/resources/xmlExample.xml +++ b/dataformat-xml/src/test/resources/xmlExample.xml @@ -1,26 +1,20 @@ - + ExampleMotor http://customer.com/aas/9175_7013_7091_9168 Instance - - GlobalReference - - - AssetAdministrationShell - http://customer.com/assets/KHBVZJSQKIY - - - + http://customer.com/assets/KHBVZJSQKIY EquipmentID 538fd1b3-f99f-4a52-9c75-72e9fa921270 - GlobalReference + ExternalReference GlobalReference @@ -33,7 +27,7 @@ DeviceID QjYgPggjwkiHk4RrQiYSLg== - GlobalReference + ExternalReference GlobalReference @@ -50,7 +44,7 @@ - GlobalReference + ExternalReference Submodel @@ -59,7 +53,7 @@ - GlobalReference + ExternalReference Submodel @@ -68,7 +62,7 @@ - GlobalReference + ExternalReference Submodel @@ -83,9 +77,8 @@ TechnicalData http://i40.customer.com/type/1/1/7A7104BDAB57E184 - Instance - GlobalReference + ExternalReference GlobalReference @@ -95,11 +88,10 @@ - Parameter + PARAMETER MaxRotationSpeed - Instance - GlobalReference + ExternalReference ConceptDescription @@ -119,9 +111,8 @@ OperatingManual - Instance - GlobalReference + ExternalReference ConceptDescription @@ -132,9 +123,8 @@ Title - Instance - GlobalReference + ExternalReference ConceptDescription @@ -147,9 +137,8 @@ DigitalFile_PDF - Instance - GlobalReference + ExternalReference ConceptDescription @@ -170,11 +159,10 @@ Instance - Variable + VARIABLE RotationSpeed - Instance - GlobalReference + ExternalReference ConceptDescription @@ -195,44 +183,44 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + EN Title - - + + DE Titel - + - + EN Title - - + + DE Titel - + ExampleString ExampleString STRING_TRANSLATABLE - + EN SprachabhängigerTiteldesDokuments. - + @@ -245,44 +233,44 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + EN DigitalFile - - + + EN DigitalFile - + - + EN DigitalFile - - + + DE DigitaleDatei - + ExampleString ExampleString STRING - + EN A file representing the document version. In addition to the mandatory PDF file, other files can be specified. - + @@ -294,35 +282,35 @@ MaxRotationSpeed 2 - 2.1 + 1 0173-1#02-BAA120#008 - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + de max.Drehzahl - - + + en Max.rotationspeed - + 1/min - GlobalReference + ExternalReference GlobalReference @@ -333,14 +321,14 @@ ExampleString REAL_MEASURE - + de HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf - - + + EN Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated - + @@ -354,39 +342,39 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + DE AktuelleDrehzahl - - + + EN Actualrotationspeed - + - + DE AktuelleDrehzahl - - + + EN - ActualRotationSpeed - + ActRotationSpeed + 1/min - GlobalReference + ExternalReference GlobalReference @@ -397,14 +385,14 @@ ExampleString REAL_MEASURE - + DE Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird - - + + EN Actual rotationspeed with which the motor or feedingunit is operated - + @@ -417,40 +405,40 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + EN Document - + - + EN Document - - + + DE Dokument - + ExampleString [ISO15519-1:2010] STRING - + EN Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. - + diff --git a/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml b/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml index 2cb861291..2db066ec3 100644 --- a/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml +++ b/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml @@ -1,25 +1,20 @@ - + + ExampleMotor http://customer.com/aas/9175_7013_7091_9168 Instance - - GlobalReference - - - AssetAdministrationShell - http://customer.com/assets/KHBVZJSQKIY - - - + http://customer.com/assets/KHBVZJSQKIY EquipmentID 538fd1b3-f99f-4a52-9c75-72e9fa921270 - GlobalReference + ExternalReference GlobalReference @@ -32,7 +27,7 @@ DeviceID QjYgPggjwkiHk4RrQiYSLg== - GlobalReference + ExternalReference GlobalReference @@ -49,7 +44,7 @@ - GlobalReference + ExternalReference Submodel @@ -58,7 +53,7 @@ - GlobalReference + ExternalReference Submodel @@ -67,7 +62,7 @@ - GlobalReference + ExternalReference Submodel @@ -82,9 +77,8 @@ TechnicalData http://i40.customer.com/type/1/1/7A7104BDAB57E184 - Instance - GlobalReference + ExternalReference GlobalReference @@ -94,11 +88,10 @@ - Parameter + PARAMETER MaxRotationSpeed - Instance - GlobalReference + ExternalReference ConceptDescription @@ -118,9 +111,8 @@ OperatingManual - Instance - GlobalReference + ExternalReference ConceptDescription @@ -131,9 +123,8 @@ Title - Instance - GlobalReference + ExternalReference ConceptDescription @@ -146,9 +137,8 @@ DigitalFile_PDF - Instance - GlobalReference + ExternalReference ConceptDescription @@ -169,11 +159,10 @@ Instance - Variable + VARIABLE RotationSpeed - Instance - GlobalReference + ExternalReference ConceptDescription @@ -194,44 +183,44 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + EN Title - - + + DE Titel - + - + EN Title - - + + DE Titel - + ExampleString ExampleString STRING_TRANSLATABLE - + EN SprachabhängigerTiteldesDokuments. - + @@ -244,44 +233,44 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + EN DigitalFile - - + + EN DigitalFile - + - + EN DigitalFile - - + + DE DigitaleDatei - + ExampleString ExampleString STRING - + EN A file representing the document version. In addition to the mandatory PDF file, other files can be specified. - + @@ -293,35 +282,35 @@ MaxRotationSpeed 2 - 2.1 + 1 0173-1#02-BAA120#008 - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + de max.Drehzahl - - + + en Max.rotationspeed - + 1/min - GlobalReference + ExternalReference GlobalReference @@ -332,14 +321,14 @@ ExampleString REAL_MEASURE - + de HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf - - + + EN Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated - + @@ -353,39 +342,39 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + DE AktuelleDrehzahl - - + + EN Actualrotationspeed - + - + DE AktuelleDrehzahl - - + + EN - ActualRotationSpeed - + ActRotationSpeed + 1/min - GlobalReference + ExternalReference GlobalReference @@ -396,14 +385,14 @@ ExampleString REAL_MEASURE - + DE Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird - - + + EN Actual rotationspeed with which the motor or feedingunit is operated - + @@ -416,40 +405,40 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + EN Document - + - + EN Document - - + + DE Dokument - + ExampleString [ISO15519-1:2010] STRING - + EN Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. - + From f44bd1ace0fb60b6c900ebb63f21fe5da0bfe431 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 3 Jul 2023 14:46:40 +0200 Subject: [PATCH 12/59] Remove dataformat-rdf project --- dataformat-rdf/pom.xml | 45 - .../v3/dataformat/rdf/FallbackSerializer.java | 43 - .../v3/dataformat/rdf/IgnoreTypeMixIn.java | 23 - .../aas4j/v3/dataformat/rdf/JsonLDModule.java | 53 - .../v3/dataformat/rdf/JsonLDSerializer.java | 197 --- .../rdf/JsonLDSerializerModifier.java | 45 - .../dataformat/rdf/JsonLdEnumSerializer.java | 89 -- .../dataformat/rdf/LangStringSerializer.java | 54 - .../aas4j/v3/dataformat/rdf/Parser.java | 1171 ----------------- .../aas4j/v3/dataformat/rdf/Serializer.java | 309 ----- .../v3/dataformat/rdf/UriSerializer.java | 54 - .../rdf/custom/BigDecimalSerializer.java | 43 - .../rdf/custom/JsonLdEnumMixin.java | 24 - .../rdf/custom/LangStringMixin.java | 36 - .../rdf/custom/ReflectiveMixInResolver.java | 42 - .../XMLGregorianCalendarDeserializer.java | 50 - .../XMLGregorianCalendarSerializer.java | 48 - .../AdministrativeInformationMixin.java | 39 - .../AnnotatedRelationshipElementMixin.java | 34 - .../mixins/AssetAdministrationShellMixin.java | 48 - .../rdf/mixins/AssetInformationMixin.java | 61 - .../rdf/mixins/BasicEventElementMixin.java | 80 -- .../v3/dataformat/rdf/mixins/BlobMixin.java | 39 - .../rdf/mixins/CapabilityMixin.java | 28 - .../rdf/mixins/ConceptDescriptionMixin.java | 34 - .../rdf/mixins/DataElementMixin.java | 38 - .../mixins/DataSpecificationContentMixin.java | 34 - .../DataSpecificationIEC61360Mixin.java | 107 -- .../DataSpecificationPhysicalUnitMixin.java | 100 -- .../EmbeddedDataSpecificationMixin.java | 45 - .../v3/dataformat/rdf/mixins/EntityMixin.java | 55 - .../rdf/mixins/EnvironmentMixin.java | 48 - .../rdf/mixins/EventElementMixin.java | 34 - .../rdf/mixins/EventMessageMixin.java | 28 - .../dataformat/rdf/mixins/ExtensionMixin.java | 51 - .../v3/dataformat/rdf/mixins/FileMixin.java | 39 - .../dataformat/rdf/mixins/FormulaMixin.java | 34 - .../rdf/mixins/HasDataSpecificationMixin.java | 50 - .../rdf/mixins/HasExtensionsMixin.java | 34 - .../dataformat/rdf/mixins/HasKindMixin.java | 40 - .../rdf/mixins/HasSemanticsMixin.java | 50 - .../rdf/mixins/IdentifiableMixin.java | 48 - .../mixins/IdentifierKeyValuePairMixin.java | 45 - .../rdf/mixins/IdentifierMixin.java | 32 - .../v3/dataformat/rdf/mixins/KeyMixin.java | 40 - .../mixins/MultiLanguagePropertyMixin.java | 41 - .../rdf/mixins/ObjectAttributesMixin.java | 34 - .../dataformat/rdf/mixins/OperationMixin.java | 45 - .../rdf/mixins/OperationVariableMixin.java | 33 - .../rdf/mixins/PolicyDecisionPointMixin.java | 33 - .../mixins/PolicyEnforcementPointsMixin.java | 33 - .../mixins/PolicyInformationPointsMixin.java | 40 - .../dataformat/rdf/mixins/PropertyMixin.java | 45 - .../rdf/mixins/QualifiableMixin.java | 41 - .../dataformat/rdf/mixins/QualifierMixin.java | 51 - .../v3/dataformat/rdf/mixins/RangeMixin.java | 45 - .../dataformat/rdf/mixins/ReferableMixin.java | 59 - .../rdf/mixins/ReferenceElementMixin.java | 33 - .../dataformat/rdf/mixins/ReferenceMixin.java | 42 - .../rdf/mixins/RelationshipElementMixin.java | 44 - .../dataformat/rdf/mixins/ResourceMixin.java | 41 - .../rdf/mixins/SpecificAssetIdMixin.java | 48 - .../rdf/mixins/SubjectAttributesMixin.java | 34 - .../SubmodelElementCollectionMixin.java | 46 - .../rdf/mixins/SubmodelElementListMixin.java | 62 - .../rdf/mixins/SubmodelElementMixin.java | 41 - .../dataformat/rdf/mixins/SubmodelMixin.java | 34 - .../dataformat/rdf/mixins/ValueListMixin.java | 37 - .../rdf/mixins/ValueReferencePairMixin.java | 39 - .../v3/dataformat/rdf/mixins/ViewMixin.java | 34 - .../rdf/preprocessing/BasePreprocessor.java | 54 - .../rdf/preprocessing/JsonPreprocessor.java | 43 - .../preprocessing/TypeNamePreprocessor.java | 195 --- .../aas4j/v3/dataformat/rdf/ParserTest.java | 154 --- .../v3/dataformat/rdf/SerializerTest.java | 101 -- .../v3/dataformat/rdf/SerializerUtil.java | 46 - dataformat-rdf/src/test/resources/AASFull.ttl | 354 ----- .../resources/AAS_Reference_shortExample.nt | 16 - .../resources/AAS_Reference_shortExample.ttl | 27 - .../AssetAdministrationShell_Example.ttl | 56 - .../src/test/resources/Complete_Example.ttl | 347 ----- .../src/test/resources/Overall-Example.nt | 253 ---- .../src/test/resources/ReferenceExample.ttl | 18 - .../Submodel_SubmodelElement_Example.ttl | 137 -- .../Submodel_SubmodelElement_shortExample.nt | 25 - .../Submodel_SubmodelElement_shortExample.ttl | 42 - .../resources/example-from-serializer.jsonld | 88 -- 87 files changed, 6632 deletions(-) delete mode 100644 dataformat-rdf/pom.xml delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java delete mode 100644 dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java delete mode 100644 dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java delete mode 100644 dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java delete mode 100644 dataformat-rdf/src/test/resources/AASFull.ttl delete mode 100644 dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt delete mode 100644 dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl delete mode 100644 dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl delete mode 100644 dataformat-rdf/src/test/resources/Complete_Example.ttl delete mode 100644 dataformat-rdf/src/test/resources/Overall-Example.nt delete mode 100644 dataformat-rdf/src/test/resources/ReferenceExample.ttl delete mode 100644 dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl delete mode 100644 dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt delete mode 100644 dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl delete mode 100644 dataformat-rdf/src/test/resources/example-from-serializer.jsonld diff --git a/dataformat-rdf/pom.xml b/dataformat-rdf/pom.xml deleted file mode 100644 index 8d65df6de..000000000 --- a/dataformat-rdf/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - org.eclipse.digitaltwin.aas4j - dataformat-parent - ${revision} - - dataformat-rdf - Asset Administration Shell RDF-Serializer - - - - ${groupId} - dataformat-core - ${revision} - - - ${groupId} - dataformat-core - ${revision} - tests - test - - - org.apache.jena - jena-arq - ${jena.version} - - - org.slf4j - slf4j-simple - ${slf4j.version} - test - - - pl.pragmatists - JUnitParams - ${junit-params.version} - test - - - diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java deleted file mode 100644 index b787d56a2..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; - -import java.io.IOException; -import java.util.Map; - -public class FallbackSerializer extends StdSerializer> { - - - public FallbackSerializer() { - this(null); - } - - public FallbackSerializer(Class clazz) { - super(clazz); - } - - - @Override - public void serialize(Map value, JsonGenerator gen, SerializerProvider provider) throws IOException { - gen.writeString(value.toString()); - } - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java deleted file mode 100644 index 4e42f6851..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import com.fasterxml.jackson.annotation.JsonIgnoreType; - -@JsonIgnoreType -public class IgnoreTypeMixIn { -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java deleted file mode 100644 index 3e0b3699e..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import com.fasterxml.jackson.databind.module.SimpleModule; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.BigDecimalSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.XMLGregorianCalendarDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.XMLGregorianCalendarSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -import java.math.BigDecimal; -import java.net.URI; -import java.util.Map; - - -import javax.xml.datatype.XMLGregorianCalendar; - - -/** - * Jackson module which provides support for JSON-LD serialization - */ -public class JsonLDModule extends SimpleModule { - - - public JsonLDModule(Map idMap) { - super(); - - setSerializerModifier(new JsonLDSerializerModifier(idMap)); - - addSerializer(XMLGregorianCalendar.class, new XMLGregorianCalendarSerializer()); - addDeserializer(XMLGregorianCalendar.class, new XMLGregorianCalendarDeserializer()); - addSerializer(BigDecimal.class, new BigDecimalSerializer()); - - addSerializer(URI.class, new UriSerializer()); - addSerializer(LangString.class, new LangStringSerializer()); - } - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java deleted file mode 100644 index d59ef814d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.core.type.WritableTypeId; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.jsontype.TypeSerializer; -import com.fasterxml.jackson.databind.ser.BeanSerializer; -import com.fasterxml.jackson.databind.ser.std.BeanSerializerBase; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.math.BigInteger; -import java.util.*; -import java.util.stream.Stream; - - -public class JsonLDSerializer extends BeanSerializer { - - private final Logger logger = LoggerFactory.getLogger(JsonLDSerializer.class); - - private static int currentRecursionDepth = 0; - - static final Map contextItems = new HashMap<>(); - - private final Map idMap; - - JsonLDSerializer(BeanSerializerBase src, Map idMap) { - super(src); - this.idMap = Objects.requireNonNullElseGet(idMap, HashMap::new); - } - - - - @Override - public void serializeWithType(Object bean, JsonGenerator gen, SerializerProvider provider, TypeSerializer typeSer) throws IOException { - gen.setCurrentValue(bean); - - currentRecursionDepth++; - gen.writeStartObject(); - - if (currentRecursionDepth == 1) { - Map filteredContext = new HashMap<>(); - filterContextWrtBean(bean, filteredContext); - gen.writeObjectField("@context", filteredContext); - //gen.writeStringField("@context", "https://jira.iais.fraunhofer.de/stash/projects/ICTSL/repos/ids-infomodel-commons/raw/jsonld-context/3.0.0/context.jsonld"); // only add @context on top level - - } - - if(idMap.containsKey(bean)) - { - gen.writeStringField("@id", idMap.get(bean)); - } - else - { - String randomUri = "https://admin-shell.io/autogen/" + bean.getClass().getSimpleName() + "/" + UUID.randomUUID(); - idMap.put(bean, randomUri); - gen.writeStringField("@id", randomUri); - } - - WritableTypeId typeIdDef = _typeIdDef(typeSer, bean, JsonToken.START_OBJECT); - String resolvedTypeId = typeIdDef.id != null ? typeIdDef.id.toString() : typeSer.getTypeIdResolver().idFromValue(bean); - if (resolvedTypeId != null) { - gen.writeStringField(typeIdDef.asProperty, resolvedTypeId); - } - if (_propertyFilterId != null) { - serializeFieldsFiltered(bean, gen, provider); - } else { - serializeFields(bean, gen, provider); - } - gen.writeEndObject(); - currentRecursionDepth--; - } - - - private void filterContextWrtBean(Object bean, Map filteredContext) { - //Some default entries for AAS - filteredContext.put("aas", "https://admin-shell.io/aas/3/0/RC02/"); - //filteredContext.put("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/"); - //filteredContext.put("phys_unit", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/"); - - if(bean == null || bean.getClass().getName().equals("com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl") || bean.getClass().getName().equals("org.apache.jena.ext.xerces.jaxp.datatype.XMLGregorianCalendarImpl") || bean.getClass() == BigInteger.class) return; // XMLGregorianCalendarImpl causes infinite recursion - - //Check if RdfResource or TypedLiteral is used. They contain a field called "type" which can reference to any namespace - //Therefore it is vital to also check the value of the type field for prefixes that need to be included in the context - if(bean.getClass().getSimpleName().equals("LangString")) - { - //LangString is of type rdf:langString, so this must be present - filteredContext.put("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); - } - contextItems.forEach((p, u) -> { - JsonTypeName typeNameAnnotation = bean.getClass().getAnnotation(JsonTypeName.class); - if(typeNameAnnotation != null && typeNameAnnotation.value().contains(p)) { - filteredContext.put(p, u); - } - Stream.of(bean.getClass().getMethods()).forEach(m -> { - JsonProperty propertyAnnotation = m.getAnnotation(JsonProperty.class); - if(propertyAnnotation != null && propertyAnnotation.value().contains(p)) { - filteredContext.put(p, u); - } - }); - }); - Stream.of(bean.getClass().getMethods()).forEach(m -> { - // run though all properties and check annotations. These annotations should contain the prefixes - JsonProperty prop = m.getAnnotation(JsonProperty.class); - if(prop != null) - { - for(Map.Entry entry : contextItems.entrySet()) - { - if(prop.value().startsWith(entry.getKey())) - { - filteredContext.put(entry.getKey(), entry.getValue()); - break; - } - } - } - }); - // run through fields recursively - for(Field f : getAllFields(new HashSet<>(), bean.getClass())) { - - if(Collection.class.isAssignableFrom(f.getType())) - { - try { - if(f.getType().getName().startsWith("java.") && !f.getType().getName().startsWith("java.util")) continue; - boolean accessible = f.isAccessible(); - f.setAccessible(true); - Collection c = (Collection) f.get(bean); - if(c == null) { - continue; - } - for(Object o : c) - { - filterContextWrtBean(o, filteredContext); - } - f.setAccessible(accessible); - } - catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - - if (f.getType().isPrimitive() || f.getType().isEnum() || f.getType().isArray() - || f.getType().getName().contains("java.") - || f.getType().getName().contains("javax.")) continue; - - try { - boolean wasAccessible = f.isAccessible(); - f.setAccessible(true); - filterContextWrtBean(f.get(bean), filteredContext); - f.setAccessible(wasAccessible); - } catch (IllegalAccessException ignored) { - //logger.error("setting accessible failed"); //We can catch that here, as IllegalReflectiveAccess cannot occur on our own packages - } - - //f.trySetAccessible(wasAccessible); - - } - - } - - /** - * This function retrieves a set of all available fields of a class, including inherited fields - * @param fields Set to which discovered fields will be added. An empty HashSet should do the trick - * @param type The class for which fields should be discovered - * @return set of all available fields - */ - private static Set getAllFields(Set fields, Class type) { - fields.addAll(Arrays.asList(type.getDeclaredFields())); - - if (type.getSuperclass() != null) { - getAllFields(fields, type.getSuperclass()); - } - - return fields; - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java deleted file mode 100644 index d998ac5c9..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - - -import com.fasterxml.jackson.databind.BeanDescription; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializationConfig; -import com.fasterxml.jackson.databind.ser.BeanSerializerModifier; -import com.fasterxml.jackson.databind.ser.std.BeanSerializerBase; - -import java.util.Map; - - -public class JsonLDSerializerModifier extends BeanSerializerModifier { - - private final Map idMap; - - public JsonLDSerializerModifier(Map idMap) { - this.idMap = idMap; - } - - @Override - public JsonSerializer modifySerializer(SerializationConfig config, BeanDescription beanDesc, JsonSerializer serializer) { - if (serializer instanceof BeanSerializerBase) { - return new JsonLDSerializer((BeanSerializerBase) serializer, idMap); - } else { - return serializer; - } - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java deleted file mode 100644 index bbcf27772..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - -import java.io.IOException; - -public class JsonLdEnumSerializer extends JsonSerializer> { - - - @Override - public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { - //Generated Enum classes of the admin shell have @IRI annotations, which need to be used to provide proper RDF - if(value.getClass().isEnum() && value.getClass().getName().startsWith("org.eclipse.digitaltwin.aas4j.")) - { - //Try to get annotation value to get the IRI used in the ontology - if(value.getClass().getAnnotation(IRI.class) != null && value.getClass().getAnnotation(IRI.class).value().length > 0) - { - gen.writeStartObject(); - gen.writeStringField("@type", value.getClass().getAnnotation(IRI.class).value()[0]); - - //Try to extract exact IRI of the enum value, if present - try { - var annotation = value.getClass().getField(value.name()).getAnnotation(IRI.class); - if(annotation != null && annotation.value().length > 0) - { - gen.writeStringField("@id", annotation.value()[0]); - } - else - { - //Didn't find an @IRI annotation - fall back to using class annotation + field name - gen.writeStringField("@id", translate(value.getClass(), value.name())); - } - } - //Should be impossible - catch (NoSuchFieldException e) - { - //Didn't find an @IRI annotation - fall back to using class annotation + field name - gen.writeStringField("@id", translate(value.getClass(), value.name())); - } - gen.writeEndObject(); - } - else - { - gen.writeString(translate(value.getClass(), value.name())); - } - - - } else { - provider.findValueSerializer(Enum.class).serialize(value, gen, provider); - } - } - - - - public static String translate(Class enumClass, String input) { - String[] iriValues = enumClass.getAnnotation(IRI.class).value(); - String result = ""; - if(iriValues.length > 0) - { - result = iriValues[0]; - if(!result.endsWith("/")) - { - result += "/"; - } - } - result += input; - return result; - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java deleted file mode 100644 index 53a03bb85..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import java.io.IOException; - - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -public class LangStringSerializer extends StdSerializer { - - - public LangStringSerializer() { - this(null); - } - - public LangStringSerializer(Class clazz) { - super(clazz); - } - - - @Override - public void serialize(LangString value, JsonGenerator gen, SerializerProvider provider) throws IOException { - gen.writeStartObject(); - if(value.getLanguage() != null && !value.getLanguage().isEmpty()) - { - gen.writeStringField("@language", value.getLanguage()); - } - else - { - gen.writeStringField("@type", "rdf:langString"); - } - gen.writeStringField("@value", value.getText()); - gen.writeEndObject(); - } - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java deleted file mode 100644 index 80582d6b5..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java +++ /dev/null @@ -1,1171 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangString; -import org.apache.jena.datatypes.DatatypeFormatException; -import org.apache.jena.query.*; -import org.apache.jena.rdf.model.*; -import org.apache.jena.riot.Lang; -import org.apache.jena.riot.RDFDataMgr; -import org.apache.jena.riot.RDFLanguages; -import org.apache.jena.riot.RiotException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; -import javax.xml.datatype.Duration; -import javax.xml.datatype.XMLGregorianCalendar; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.lang.reflect.*; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.time.ZonedDateTime; -import java.time.format.DateTimeParseException; -import java.util.*; -import java.util.stream.Collectors; - - -/** - * Internal class to handle the parsing of JSON-LD into java objects - * @author maboeckmann - */ -class Parser { - - private final Logger logger = LoggerFactory.getLogger(Parser.class); - - private static final URI blankNodeIdPropertyUri = URI.create("https://admin-shell.io/aas/blankNodeId"); - - static Map knownNamespaces = new HashMap<>(); - - /** - * Main internal method for creating a java object from a given RDF graph and a URI of the object to handle - * @param inputModel Model on which queries are to be evaluated from which information can be retrieved - * @param objectUri URI of the object to be handled - * @param targetClass Variable containing the class which should be returned - * @param Class which should be returned - * @return Object of desired class, filled with the values extracted from inputModel - * @throws IOException thrown if the parsing fails - */ - private T handleObject(Model inputModel, String objectUri, Class targetClass) throws IOException { - try { - - //if(!targetClass.getSimpleName().endsWith("Impl")) //This would not work for "TypedLiteral", "RdfResource" and so on - //Check whether we are dealing with an instantiable class (i.e. no interface and no abstract class) - boolean currentObjectIsBlankNode = false; - if (targetClass.isInterface() || Modifier.isAbstract(targetClass.getModifiers())) { - //We don't know the desired class yet (current targetClass is not instantiable). This is only known for the root object - ArrayList> implementingClasses = getImplementingClasses(targetClass); - String queryString; - //Get a list of all "rdf:type" statements in our model - //In case of a blank node, the "object URI" will just be a string and no valid URI. In that case, we need a different query syntax - try { - new URL(objectUri); - } - catch (MalformedURLException e) - { - currentObjectIsBlankNode = true; - } - if(currentObjectIsBlankNode) - { - //Object is a blank node, so the subject URI cannot be used - queryString = "SELECT ?type { ?s <" + blankNodeIdPropertyUri + "> \"" + objectUri + "\" ; a ?type . }"; - } - else - { - //Not a blank node, so we can work with the subject URI - queryString = "SELECT ?type { BIND(<" + objectUri + "> AS ?s). ?s a ?type . }"; - } - Query query = QueryFactory.create(queryString); - QueryExecution queryExecution = QueryExecutionFactory.create(query, inputModel); - ResultSet resultSet = queryExecution.execSelect(); - - if (!resultSet.hasNext()) { - queryExecution.close(); - throw new IOException("Could not extract class of child object. ID: " + objectUri); - } - - //Class candidateClass = null; - - String fullName = "No triple present indicating type."; - while (resultSet.hasNext()) { - QuerySolution solution = resultSet.nextSolution(); - fullName = solution.get("type").toString(); - - //Expected URI is something like https://w3id.org/idsa/core/ClassName (and we want ClassName) - String className = fullName.substring(fullName.lastIndexOf('/') + 1); - - //Some namespaces use "#" instead of "/" - if (className.contains("#")) { - className = className.substring(className.lastIndexOf("#") + 1); - } - - for (Class currentClass : implementingClasses) { - //Is this class instantiable? - if (!currentClass.isInterface() && !Modifier.isAbstract(currentClass.getModifiers())) { - //candidateClass = currentClass; - if (currentClass.getSimpleName().equals(className) || currentClass.getSimpleName().equals(Serializer.implementingClassesNamePrefix + className + Serializer.implementingClassesNameSuffix)) { - targetClass = (Class) currentClass; - break; - } - } - } - } - queryExecution.close(); - //Did we find "the" class, i.e. instantiable and name matches? - if (targetClass.isInterface() || Modifier.isAbstract(targetClass.getModifiers())) { - //No, the current targetClass cannot be instantiated. Do we have a candidate class? - //if (candidateClass != null) { - throw new IOException("Did not find an instantiable class for " + objectUri + " matching expected class name (" + targetClass.getSimpleName() + "). Object has type: " + fullName); - //targetClass = (Class) candidateClass; - //} - } - } - - //Enums have no constructors - if(targetClass.isEnum()) - { - return handleEnum(targetClass, objectUri); - } - - //Get constructor (which is package private for our classes) and make it accessible - Constructor constructor = targetClass.getDeclaredConstructor(); - constructor.setAccessible(true); - - //Instantiate new object, which will be returned at the end - T returnObject = constructor.newInstance(); - - //Get methods - Method[] methods = returnObject.getClass().getDeclaredMethods(); - - //Store methods in map. Key is the name of the RDF property without ids prefix - Map methodMap = new HashMap<>(); - - //Get all relevant methods (setters, but not for label, comment or external properties) - Arrays.stream(methods).filter(method -> { - String name = method.getName(); - //Filter out irrelevant methods - return name.startsWith("set") && !name.equals("setProperty") && !name.equals("setComment") && !name.equals("setLabel"); // && !name.equals("setId"); - }).forEach(method -> { - //Remove "set" part - String reducedName = method.getName().substring(3); - - //Turn first character to lower case - char[] c = reducedName.toCharArray(); - c[0] = Character.toLowerCase(c[0]); - String finalName = new String(c); - methodMap.put(finalName, method); - - }); - - //There is no "setId" method in our CodeGen generated classes, so we get the field - /* TODO: No "id" field yet - Field idField = returnObject.getClass().getDeclaredField("id"); - - //Store whether or not it was accessible, so that we can undo making it accessible - boolean wasAccessible = idField.isAccessible(); - idField.setAccessible(true); - - //Set the ID of the object to be identical with the objectUri parameter - idField.set(returnObject, new URI(objectUri)); - idField.setAccessible(wasAccessible); - */ - - //Is this a trivial class with 0 fields? If so, the generated query would be "SELECT { }", which is illegal - if(methodMap.isEmpty()) - { - return returnObject; - } - - - //A list which stores all those parameter names which may occur only once (i.e. those occurring in the GROUP BY clause) - List groupByKeys = new ArrayList<>(); - - StringBuilder queryStringBuilder = new StringBuilder(); - - for(Map.Entry entry : knownNamespaces.entrySet()) - { - queryStringBuilder.append("PREFIX ").append(entry.getKey()); - if(!entry.getKey().endsWith(":")) - { - queryStringBuilder.append(":"); - } - queryStringBuilder.append(" <").append(entry.getValue()).append(">\n"); - } - queryStringBuilder.append("SELECT"); - methodMap.forEach((key1, value) -> { - //Is the return type some sort of List? - if (Collection.class.isAssignableFrom(value.getParameterTypes()[0])) { - boolean isTypedLiteral = false; - //Yes, it is assignable multiple times. Concatenate multiple values together using some delimiter - try { - //ArrayLists are generics. We need to extract the name of the generic parameter as string and interpret that - String typeName = extractTypeNameFromCollection(value.getGenericParameterTypes()[0]); - - if (typeName.endsWith("LangString")) - isTypedLiteral = true; - } catch (IOException e) { - e.printStackTrace(); - } - if (isTypedLiteral) { - queryStringBuilder.append(" (GROUP_CONCAT(CONCAT('\"',?").append(key1).append(",'\"@', lang(?").append(key1).append("));separator=\"||\") AS ?").append(key1).append("sLang) "); - } - queryStringBuilder.append(" (GROUP_CONCAT(?").append(key1).append(";separator=\"||\") AS ?").append(key1).append("s) "); - - //Additional case for blank nodes - queryStringBuilder.append(" (GROUP_CONCAT(?").append(key1).append("Blank;separator=\"||\") AS ?").append(key1).append("sBlank) "); - - - } else { - //No, it's not a list. No need to aggregate - queryStringBuilder.append(" ?").append(key1); - //We will have to GROUP BY this variable though... - groupByKeys.add(key1); - } - }); - //Start the "WHERE" part - Fuseki does not expect the "WHERE" keyword, but just an "{" - queryStringBuilder.append(" { "); - - //In case of blank nodes, we can't work with the subject URI - if(currentObjectIsBlankNode) - { - queryStringBuilder.append("?s <").append(blankNodeIdPropertyUri).append("> \"").append(objectUri).append("\" ;"); - } - else - { - queryStringBuilder.append(" <").append(objectUri).append(">"); - } - - //Make sure that the object is of the correct type - //This is particularly relevant in case of all fields being optional -- then one could simply parse a random object - queryStringBuilder.append(" a ").append(wrapIfUri(targetClass.getAnnotation(IRI.class).value()[0])).append(". "); - - for (Map.Entry entry : methodMap.entrySet()) { - //Is this a field which is annotated by NOT NULL? - //Attempt to find a field matching the setter method name - //E.g. for "setSomething", we search for a field with name "_something" (IDS way) and "something" - Field field = getFieldByName(targetClass, entry.getKey()); - - - //In AAS, every field is optional, as there are no validation annotations in the model - queryStringBuilder.append(" OPTIONAL {"); - - if(currentObjectIsBlankNode) - { - queryStringBuilder.append(" ?s "); - } - else { - queryStringBuilder.append(" <").append(objectUri).append("> "); //subject, as passed to the function - } - //For the field, get the JsonAlias annotation (present for all classes generated by the CodeGen tool) - //Find the annotation value containing a colon and interpret this as "prefix:predicate" - boolean foundAnnotation = false; - if(field.getAnnotation(IRI.class) != null) { - Optional currentAnnotation = Arrays.stream(field.getAnnotation(IRI.class).value()).map(this::wrapIfUri).filter(annotation -> annotation.contains(":")).findFirst(); - currentAnnotation.ifPresent(queryStringBuilder::append); - foundAnnotation = true; - } - if(!foundAnnotation) - { - logger.warn("Failed to retrieve JsonAlias for field " + field + ". Assuming aas:" + entry.getKey()); - queryStringBuilder.append("aas:").append(entry.getKey()); - } - //if(isBlank(?entry.getKey(), use value of artificial, use original value) - queryStringBuilder.append(" ?").append(entry.getKey()).append(" ."); //object - - //In case of the object being a blank node, we construct a second result variable with the blank node id - queryStringBuilder.append("OPTIONAL { ?").append(entry.getKey()).append(" <").append(blankNodeIdPropertyUri).append("> ?").append(entry.getKey()).append("Blank . } "); - - queryStringBuilder.append("} "); - } - - - queryStringBuilder.append(" } "); - - //Do we need to group? We do, if there is at least one property which can occur multiple times - //We added all those properties, which may only occur once, to the groupByKeys list - if (!groupByKeys.isEmpty()) { - queryStringBuilder.append("GROUP BY"); - for (String key : groupByKeys) { - queryStringBuilder.append(" ?").append(key); - } - } - - String queryString = queryStringBuilder.toString(); - - StringBuilder queryForOtherProperties = new StringBuilder(); - //Query for all unknown properties and their values - //Select properties and values only - - if(!targetClass.equals(LangString.class)) { //LangString has no additional properties map. Skip this step - - //CONSTRUCT { ?s ?p ?o } { ?s ?p ?o. FILTER(?p NOT IN (list of ids properties)) } - for (Map.Entry entry : knownNamespaces.entrySet()) { - queryForOtherProperties.append("PREFIX ").append(entry.getKey()); - if (!entry.getKey().endsWith(":")) { - queryForOtherProperties.append(":"); - } - queryForOtherProperties.append(" <").append(entry.getValue()).append(">\n"); - } - - - //Respect ALL properties and values - queryForOtherProperties.append(" SELECT ?p ?o { <").append(objectUri).append("> ?p ?o .\n"); - - //Exclude known properties - queryForOtherProperties.append("FILTER (?p NOT IN (rdf:type"); - - //Predicates usually look like: .append("ids:").append(entry.getKey()) - for (Map.Entry entry : methodMap.entrySet()) { - queryForOtherProperties.append(", "); - - Field field = getFieldByName(targetClass, entry.getKey()); - Optional currentAnnotation = Arrays.stream(field.getAnnotation(IRI.class).value()).filter(annotation -> annotation.contains(":")).filter(s -> s.length() > 1).findFirst(); - if (currentAnnotation.isPresent()) { - queryForOtherProperties.append(wrapIfUri(currentAnnotation.get())); - } else { - logger.warn("Failed to retrieve JsonAlias for field " + field + ". Assuming aas:" + entry.getKey()); - queryForOtherProperties.append("aas:").append(entry.getKey()); - } - } - - queryForOtherProperties.append(")). } "); - - - //Now that we searched for all "known properties", let's search for all unrecognized content and append it to a generic properties map - - Query externalPropertiesQuery = QueryFactory.create(queryForOtherProperties.toString()); - QueryExecution externalPropertiesQueryExecution = QueryExecutionFactory.create(externalPropertiesQuery, inputModel); - ResultSet externalPropertiesResultSet = externalPropertiesQueryExecution.execSelect(); - - // now as all declared instances and classes are treated, which are also represented in the respective java - // dependency, take care about the ones within foreign namespaces and add those to the 'properties' field - // note that not all models (e.g. AAS) have such methods. In case they do not exist, skip adding external properties - - try { - Method setProperty = returnObject.getClass().getDeclaredMethod("setProperty", String.class, Object.class); - Method getProperties = returnObject.getClass().getDeclaredMethod("getProperties"); - - while (externalPropertiesResultSet.hasNext()) { - QuerySolution externalPropertySolution = externalPropertiesResultSet.next(); - - HashMap currentProperties = (HashMap) getProperties.invoke(returnObject); - - //Avoid NullPointerException - if (currentProperties == null) { - currentProperties = new HashMap<>(); - } - - String propertyUri = externalPropertySolution.get("p").toString(); - - //Does this key already exist? If yes, we need to store the value as array to not override them - if (currentProperties.containsKey(propertyUri)) { - //If it is not an array list yet, turn it into one - if (!(currentProperties.get(propertyUri) instanceof ArrayList)) { - ArrayList newList = new ArrayList<>(); - newList.add(currentProperties.get(propertyUri)); - currentProperties.put(propertyUri, newList); - } - } - - //Literals and complex objects need to be handled differently - //Literals can be treated as flat values, whereas complex objects require recursive calls - if (externalPropertySolution.get("o").isLiteral()) { - Object o = handleForeignLiteral(externalPropertySolution.getLiteral("o")); - //If it is already an ArrayList, add new value to it - if (currentProperties.containsKey(propertyUri)) { - ArrayList currentPropertyArray = ((ArrayList) currentProperties.get(propertyUri)); - currentPropertyArray.add(o); - setProperty.invoke(returnObject, propertyUri, currentPropertyArray); - } - //Otherwise save as new plain value - else { - setProperty.invoke(returnObject, propertyUri, o); - } - } else { - //It is a complex object. Distinguish whether or not we need to store as array - HashMap subMap = handleForeignNode(externalPropertySolution.getResource("o"), new HashMap<>(), inputModel); - subMap.put("@id", externalPropertySolution.getResource("o").getURI()); - if (currentProperties.containsKey(propertyUri)) { - ArrayList currentPropertyArray = ((ArrayList) currentProperties.get(propertyUri)); - currentPropertyArray.add(subMap); - setProperty.invoke(returnObject, propertyUri, currentPropertyArray); - } else { - setProperty.invoke(returnObject, propertyUri, subMap); - } - } - } - externalPropertiesQueryExecution.close(); - } - catch (NoSuchMethodException ignored) - { - //Method does not exist, skip - } - } - - - - Query query; - try { - query = QueryFactory.create(queryString); - } - catch (QueryParseException e) - { - logger.error(queryString); - throw e; - } - - //Evaluate query - QueryExecution queryExecution = QueryExecutionFactory.create(query, inputModel); - ResultSet resultSet = queryExecution.execSelect(); - - - if (!resultSet.hasNext()) { - queryExecution.close(); - //no content... - return returnObject; - } - - //SPARQL binding present, iterate over result and construct return object - while (resultSet.hasNext()) { - QuerySolution querySolution = resultSet.next(); - - //Check if there are fields which have more values than allowed - if (resultSet.hasNext()) { - String value1 = "", value2 = "", parameterName = ""; - QuerySolution querySolution2 = resultSet.next(); - Iterator varNamesIt = querySolution2.varNames(); - while(varNamesIt.hasNext()) - { - String varName = varNamesIt.next(); - if(querySolution.contains(varName)) - { - if(!querySolution.get(varName).equals(querySolution2.get(varName))) - { - parameterName = varName; - value1 = querySolution.get(varName).toString(); - value2 = querySolution2.get(varName).toString(); - break; - } - } - } - if(!value1.isEmpty()) - { - throw new IOException(objectUri + " has multiple values for " + parameterName + ", which is not allowed. Values are: " + value1 + " and " + value2); - } - throw new IOException("Multiple bindings for SPARQL query which should only have one binding. Input contains multiple values for a field which may occur only once."); - } - - //No value occurs more often than allowed - for (Map.Entry entry : methodMap.entrySet()) { - - //What is this method setting? Get the expected parameter type and check whether it is some complex sub-object and whether this is a list - Class currentType = entry.getValue().getParameterTypes()[0]; - - String sparqlParameterName = entry.getKey(); - - if (Collection.class.isAssignableFrom(currentType)) { - sparqlParameterName += "s"; //plural form for the concatenated values - } - if(!querySolution.contains(sparqlParameterName)) - { - sparqlParameterName += "Blank"; //If not present, try to go with the option for blank nodes instead - //TODO: Note: This would not yield full results yet in case some of the values are encapsulated - // in blank nodes and some are not, for the same property - } - if (querySolution.contains(sparqlParameterName)) { - String currentSparqlBinding = querySolution.get(sparqlParameterName).toString(); - - boolean objectIsBlankNode = querySolution.get(sparqlParameterName).isResource() && querySolution.get(sparqlParameterName).asNode().isBlank(); - String blankNodeId = ""; - //If the object is a blank node, we will struggle to make follow-up queries starting at the blank node as subject - //For that case, we add some artificial identifiers here - if(objectIsBlankNode) { - blankNodeId = querySolution.get(sparqlParameterName).asNode().getBlankNodeId().toString(); - } - if (currentType.isEnum()) { - //Two possibilities: - //1: The URI of the enum value is given directly e.g. ?s ?p - //2: The URI of the enum value is encapsulated in a blank node, e.g. - // ?s ?p [ a demo:myEnum, demo:enumValue ] - if(objectIsBlankNode) - { - - Query innerEnumQuery = QueryFactory.create("SELECT ?type { ?s <" + blankNodeIdPropertyUri + "> + \"" + blankNodeId + "\" ; a ?type } "); - QueryExecution innerEnumQueryExecution = QueryExecutionFactory.create(innerEnumQuery, inputModel); - ResultSet innerEnumQueryExecutionResultSet = innerEnumQueryExecution.execSelect(); - - //Only throw this if there is no successful execution - IOException anyIOException = null; - boolean oneSuccessfulEnumFound = false; - while(innerEnumQueryExecutionResultSet.hasNext()) - { - try { - entry.getValue().invoke(returnObject, handleEnum(currentType, innerEnumQueryExecutionResultSet.next().get("type").toString())); - oneSuccessfulEnumFound = true; - break; //Stop after the first successful execution - } - catch (IOException e) //There might be errors, if multiple types are present, see example above - { - anyIOException = e; - } - } - //If nothing worked, but something failed (i.e. there exists a problematic element, but no proper element), we throw an exception - if(anyIOException != null && !oneSuccessfulEnumFound) - throw new IOException("Could not parse Enum. ", anyIOException); - innerEnumQueryExecution.close(); - } - else { - entry.getValue().invoke(returnObject, handleEnum(currentType, currentSparqlBinding)); - } - continue; - } - - - //There is a binding. If it is a complex sub-object, we need to recursively call this function - if (Collection.class.isAssignableFrom(currentType)) { - //We are working with ArrayLists. - //Here, we need to work with the GenericParameterTypes instead to find out what kind of ArrayList we are dealing with - String typeName = extractTypeNameFromCollection(entry.getValue().getGenericParameterTypes()[0]); - if (isArrayListTypePrimitive(entry.getValue().getGenericParameterTypes()[0])) { - if (typeName.endsWith("LangString")) { - try { - currentSparqlBinding = querySolution.get(sparqlParameterName + "Lang").toString(); - } catch (NullPointerException e) { - //logger.warn("Failed to retrieve localized/typed values of " + currentSparqlBinding + ". Make sure that namespaces used in this property are known and valid. Proceeding without localized values and interpreting as string."); - //logger.warn("Query was: " + queryString); - //logger.warn("Attempted to fetch: " + sparqlParameterName + "Lang"); - } - } - ArrayList list = new ArrayList<>(); - //Two pipes were used as delimiter above - //Introduce set to deduplicate - Set allElements = new HashSet<>(Arrays.asList(currentSparqlBinding.split("\\|\\|"))); - for (String s : allElements) { - Literal literal; - //querySolution.get(sparqlParameterName). - if (s.endsWith("@")) { - s = s.substring(2, s.length() - 3); - literal = ResourceFactory.createStringLiteral(s); - } else if (s.startsWith("\\")) { - //turn something like \"my Desc 1\"@en to "my Desc 1"@en - s = s.substring(1).replace("\\\"@", "\"@"); - literal = ResourceFactory.createLangLiteral(s.substring(1, s.lastIndexOf("@") - 1), s.substring(s.lastIndexOf("@") + 1)); - } else { - literal = ResourceFactory.createPlainLiteral(s); - } - - //Is the type of the ArrayList some built in Java primitive? - - if (builtInMap.containsKey(typeName)) { - //Yes, it is. We MUST NOT call Class.forName(name)! - list.add(handlePrimitive(builtInMap.get(typeName), literal, null)); - } else { - //Not a Java primitive, we may call Class.forName(name) - list.add(handlePrimitive(Class.forName(typeName), literal, s)); - } - } - entry.getValue().invoke(returnObject, list); - } else { - //List of complex sub-objects, such as a list of Resources in a ResourceCatalog - ArrayList list = new ArrayList<>(); - Set allElements = new HashSet<>(Arrays.asList(currentSparqlBinding.split("\\|\\|"))); - for (String s : allElements) { - if (Class.forName(typeName).isEnum()) { - list.add(handleEnum(Class.forName(typeName), s)); - } else { - list.add(handleObject(inputModel, s, Class.forName(typeName))); - } - } - entry.getValue().invoke(returnObject, list); - } - } - - //Not an ArrayList of objects expected, but rather one object - else { - //Our implementation of checking for primitives (i.e. also includes URLs, Strings, XMLGregorianCalendars, ...) - if (isPrimitive(currentType)) { - - Literal literal = null; - try { - literal = querySolution.getLiteral(sparqlParameterName); - } catch (Exception ignored) { - } - - entry.getValue().invoke(returnObject, handlePrimitive(currentType, literal, currentSparqlBinding)); - - } else { - //Not a primitive object, but a complex sub-object. Recursively call this function to handle it - if (objectIsBlankNode) { - entry.getValue().invoke(returnObject, handleObject(inputModel, blankNodeId, entry.getValue().getParameterTypes()[0])); - } else { - - entry.getValue().invoke(returnObject, handleObject(inputModel, currentSparqlBinding, entry.getValue().getParameterTypes()[0])); - } - } - } - } - - } - } - queryExecution.close(); - - return returnObject; - } catch (NoSuchMethodException | NullPointerException | IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchFieldException | URISyntaxException | DatatypeConfigurationException | ClassNotFoundException e) { - throw new IOException("Failed to instantiate desired class (" + targetClass.getName() + ")", e); - } - } - - /** - * This function wraps a URI with "<" ">", if needed, to avoid errors about "unknown namespace http(s):" - * @param input Input URI, possibly a prefixed value - * @return If this is a full URI, starting with http or https, the URI will be encapsulated in "<" ">" - */ - private String wrapIfUri(String input) - { - if(input.startsWith("http://") || input.startsWith("https://")) - { - return "<" + input + ">"; - } - else { - return input; - } - } - - private Object handleForeignLiteral(Literal literal) throws URISyntaxException { - if(literal.getLanguage() != null && !literal.getLanguage().equals("")) - { - return new DefaultLangString.Builder().text(literal.getValue().toString()).language(literal.getLanguage()).build(); - } - //If not, does it have some datatype URI? - //else if(literal.getDatatypeURI() != null && !literal.getDatatypeURI().equals("")) - //{ - // return new TypedLiteral(literal.getString(), new URI(literal.getDatatypeURI())); - //} - //If both is not true, add it as normal string - else - { - return literal.getString(); - } - } - - private HashMap handleForeignNode(RDFNode node, HashMap map, Model model) throws IOException, URISyntaxException { - //Make sure it is not a literal. If it were, we would not know the property name and could not add this to the map - //Literals must be handled "one recursion step above" - if(node.isLiteral()) - { - throw new IOException("Literal passed to handleForeignNode. Must be non-literal RDF node"); - } - - //Run SPARQL query retrieving all information (only one hop!) about this node - String queryString = "SELECT ?s ?p ?o { BIND(<" + node.asNode().getURI() + "> AS ?s) . ?s ?p ?o . } "; - Query query = QueryFactory.create(queryString); - QueryExecution queryExecution = QueryExecutionFactory.create(query, model); - ResultSet resultSet = queryExecution.execSelect(); - - - - //Handle outgoing properties of this foreign node - while(resultSet.hasNext()) - { - QuerySolution querySolution = resultSet.next(); - - String propertyUri = querySolution.get("p").toString(); - - if(map.containsKey(propertyUri)) { - //If it is not an array list yet, turn it into one - if (!(map.get(propertyUri) instanceof ArrayList)) { - ArrayList newList = new ArrayList<>(); - newList.add(map.get(propertyUri)); - map.put(propertyUri, newList); - } - } - - //Check the type of object we have. If it is a literal, just add it as "flat value" to the map - if(querySolution.get("o").isLiteral()) - { - //Handle some small literal. This function will turn this into a TypedLiteral if appropriate - Object o = handleForeignLiteral(querySolution.getLiteral("o")); - if(map.containsKey(propertyUri)) - { - map.put(querySolution.get("p").toString(), ((ArrayList)map.get(propertyUri)).add(o)); - } - else - { - map.put(querySolution.get("p").toString(), o); - } - } - - //If it is not a literal, we need to call this function recursively. Create new map for sub object - else - { - //logger.info("Calling handleForeignNode for " + querySolution.getResource("o").toString()); - if(querySolution.getResource("s").toString().equals(querySolution.getResource("o").toString())) - { - logger.warn("Found self-reference on " + querySolution.getResource("s").toString() + " via predicate " + querySolution.getResource("p").toString() + " ."); - continue; - } - HashMap subMap = handleForeignNode(querySolution.getResource("o"), new HashMap<>(), model); - subMap.put("@id", querySolution.getResource("o").getURI()); - if(map.containsKey(propertyUri)) - { - map.put(querySolution.get("p").toString(), ((ArrayList)map.get(propertyUri)).add(subMap)); - } - else { - map.put(querySolution.get("p").toString(), subMap); - } - } - } - queryExecution.close(); - return map; - } - - - /** - * Utility function, used to obtain the field corresponding to a setter function - * @param targetClass Class object in which we search for a field - * @param fieldName Guessed name of the field to search for - * @return Field object matching the name (possibly with leading underscore) - * @throws NoSuchFieldException thrown, if no such field exists - */ - private Field getFieldByName(Class targetClass, String fieldName) throws NoSuchFieldException { - try { - return targetClass.getDeclaredField("_" + fieldName); - } catch (NoSuchFieldException e) { - try { - return targetClass.getDeclaredField(fieldName); - } catch (NoSuchFieldException e2) { - try { - return targetClass.getDeclaredField("_" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1)); - } - catch (NoSuchFieldException e3) - { - throw new NoSuchFieldException("Failed to find field which is set by method " + fieldName); - } - } - } - } - - /** - * Internal function to create a single enum object from a given desired class and a URL - * @param enumClass The enum class - * @param url The URL of the enum value - * @param Enum class - * @return Value of enumClass matching the input URL - * @throws IOException thrown if no matching enum value could be found - */ - private T handleEnum(Class enumClass, String url) throws IOException { - if (!enumClass.isEnum()) { - throw new RuntimeException("Non-Enum class passed to handleEnum function."); - } - T[] constants = enumClass.getEnumConstants(); - if(url.contains("/")) - { - url = url.substring(url.lastIndexOf("/") + 1); - } - for (T constant : constants) { - //We artificially added some underscores in the AAS ontology. TODO: This might be a bit dangerous for other ontologies, which really contain underscores in enum names - if (url.equalsIgnoreCase(constant.toString()) || url.equalsIgnoreCase(constant.toString().replace("_", ""))) { - return constant; - } - } - throw new IOException("Failed to find matching enum value for " + url + " . Available enums are: " + Arrays.stream(constants).map(Object::toString).collect(Collectors.joining(", "))); - } - - /** - * Function for handling a rather primitive object, i.e. not a complex sub-object (e.g. URI, TypedLiteral, GregorianCalendar values, ...) - * @param currentType Input Class (or primitive) - * @param literal Value as literal (can be null in some cases) - * @param currentSparqlBinding Value as SPARQL Binding (can be null in some cases) - * @return Object of type currentType - * @throws URISyntaxException thrown, if currentType is URI, but the value cannot be parsed to a URI - * @throws DatatypeConfigurationException thrown, if currentType is XMLGregorianCalendar or Duration, but parsing fails - * @throws IOException thrown, if no matching "simple class" could be found - */ - private Object handlePrimitive(Class currentType, Literal literal, String currentSparqlBinding) throws URISyntaxException, DatatypeConfigurationException, IOException { - //Java way of checking for primitives, i.e. int, char, float, double, ... - if (currentType.isPrimitive()) { - if (literal == null) { - throw new IOException("Trying to handle Java primitive, but got no literal value"); - } - //If it is an actual primitive, there is no need to instantiate anything. Just give it to the function - switch (currentType.getSimpleName()) { - case "int": - return literal.getInt(); - case "boolean": - return literal.getBoolean(); - case "long": - return literal.getLong(); - case "short": - return literal.getShort(); - case "float": - return literal.getFloat(); - case "double": - return literal.getDouble(); - case "byte": - return literal.getByte(); - } - } - - //Check for the more complex literals - - //URI - if (URI.class.isAssignableFrom(currentType)) { - return new URI(currentSparqlBinding); - } - - //String - if (String.class.isAssignableFrom(currentType)) { - return currentSparqlBinding; - } - - //XMLGregorianCalendar - if (XMLGregorianCalendar.class.isAssignableFrom(currentType)) { - //Try parsing this as dateTimeStamp (most specific). If seconds / timezone is missing, DatatypeFormatException will be thrown - try { - return DatatypeFactory.newInstance().newXMLGregorianCalendar(GregorianCalendar.from(ZonedDateTime.parse(literal.getValue().toString()))); - } - catch (DatatypeFormatException | DateTimeParseException ignored) - { - //Not a valid dateTimeStamp. Try parsing just to Date - try { - Date date = new SimpleDateFormat().parse(literal.getValue().toString()); - GregorianCalendar calendar = new GregorianCalendar(); - calendar.setTime(date); - return DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar); - } - catch (ParseException | DateTimeParseException | DatatypeFormatException e2) - { - //Do NOT use literal.getValue(), as that can already cause yet another DatatypeFormatException - throw new IOException("Could not turn " + literal.getString() + " into " + literal.getDatatypeURI(), e2); - } - } - } - - //TypedLiteral - if (LangString.class.isAssignableFrom(currentType)) { - //Either a language tagged string OR literal with type. Only one allowed - if (!literal.getLanguage().equals("")) { - return new DefaultLangString.Builder().text(literal.getValue().toString()).language(literal.getLanguage()).build(); - } - return new DefaultLangString.Builder().text(currentSparqlBinding).language("en-us").build(); // TODO: find a better language tag - } - - //BigInteger - if (BigInteger.class.isAssignableFrom(currentType)) { - return new BigInteger(literal.getString()); - } - - //BigDecimal - if (BigDecimal.class.isAssignableFrom(currentType)) { - return new BigDecimal(literal.getString()); - } - - //byte[] - if (byte[].class.isAssignableFrom(currentType)) { - return currentSparqlBinding.getBytes(); - } - - //Duration - if (Duration.class.isAssignableFrom(currentType)) { - return DatatypeFactory.newInstance().newDuration(currentSparqlBinding); - } - - throw new IOException("Unrecognized primitive type: " + currentType.getName()); - } - - /** - * This list contains all primitive Java types - */ - private final Map> builtInMap = new HashMap<>(); - { - builtInMap.put("int", Integer.TYPE); - builtInMap.put("long", Long.TYPE); - builtInMap.put("double", Double.TYPE); - builtInMap.put("float", Float.TYPE); - builtInMap.put("bool", Boolean.TYPE); - builtInMap.put("char", Character.TYPE); - builtInMap.put("byte", Byte.TYPE); - builtInMap.put("void", Void.TYPE); - builtInMap.put("short", Short.TYPE); - } - - private boolean isArrayListTypePrimitive(Type t) throws IOException { - String typeName = extractTypeNameFromCollection(t); - - try { - //Do not try to call Class.forName(primitive) -- that would throw an exception - if (builtInMap.containsKey(typeName)) return true; - return isPrimitive(Class.forName(typeName)); - } catch (ClassNotFoundException e) { - throw new IOException("Unable to retrieve class from generic", e); - } - } - - private String extractTypeNameFromCollection(Type t) throws IOException { - String typeName = t.getTypeName(); - if (!typeName.startsWith("java.util.ArrayList<") && !typeName.startsWith("java.util.List<") && !typeName.startsWith("java.util.Collection<")) { - throw new IOException("Illegal argument encountered while interpreting type parameter"); - } - //"" or super instead of extends - if(typeName.contains("?")) - { - //last space is where we want to cut off (right after the "extends"), as well as removing the last closing braces - return typeName.substring(typeName.lastIndexOf(" ") + 1, typeName.length() - 1); - } - //No extends - else - { - return typeName.substring(typeName.indexOf("<") + 1, typeName.indexOf(">")); - } - } - - private boolean isPrimitive(Class input) throws IOException { - //Collections are not simple - if (Collection.class.isAssignableFrom(input)) { - throw new IOException("Encountered collection in isPrimitive. Use isArrayListTypePrimitive instead"); - } - - //check for: plain/typed literal, XMLGregorianCalendar, byte[], RdfResource - //covers int, long, short, float, double, boolean, byte - if (input.isPrimitive()) return true; - - return (URI.class.isAssignableFrom(input) || - String.class.isAssignableFrom(input) || - XMLGregorianCalendar.class.isAssignableFrom(input) || - LangString.class.isAssignableFrom(input) || - BigInteger.class.isAssignableFrom(input) || - BigDecimal.class.isAssignableFrom(input) || - byte[].class.isAssignableFrom(input) || - Duration.class.isAssignableFrom(input)); - } - - /** - * Entry point to this class. Takes an RDF Model and a desired target class (can be an interface) - * @param rdfModel RDF input to be parsed - * @param targetClass Desired target class (something as abstract as "Message.class" is allowed) - * @param Desired target class - * @return Object of desired target class, representing the values contained in input message - * @throws IOException if the parsing of the message fails - */ - T parseMessage(Model rdfModel, Class targetClass) throws IOException { - addArtificialBlankNodeLabels(rdfModel); - ArrayList> implementingClasses = getImplementingClasses(targetClass); - - // Query to retrieve all instances in the input graph that have a class assignment - // Assumption: if the class name (?type) is equal to the target class, this should be the - // instance we actually want to parse - String queryString = "SELECT ?id ?type { ?id a ?type . }"; - Query query = QueryFactory.create(queryString); - QueryExecution queryExecution = QueryExecutionFactory.create(query, rdfModel); - ResultSet resultSet = queryExecution.execSelect(); - - if (!resultSet.hasNext()) { - throw new IOException("Could not extract class from input message"); - } - - Map> returnCandidates = new HashMap<>(); - - while (resultSet.hasNext()) { - QuerySolution solution = resultSet.nextSolution(); - String fullName = solution.get("type").toString(); - String className = fullName.substring(fullName.lastIndexOf('/') + 1); - - //In case of hash-namespaces - if(className.contains("#")) { - className = className.substring(className.lastIndexOf("#")); - } - - //For legacy purposes... - if (className.startsWith("ids:") || className.startsWith("aas:")) { - className = className.substring(4); - } - - for (Class currentClass : implementingClasses) { - if (currentClass.getSimpleName().equals(Serializer.implementingClassesNamePrefix + className + Serializer.implementingClassesNameSuffix)) { - returnCandidates.put(solution.get("id").toString(), currentClass); - } - } - //if (returnCandidates.size() > 0) break; - } - queryExecution.close(); - - if (returnCandidates.size() == 0) { - throw new IOException("Could not transform input to an appropriate implementing class for " + targetClass.getName()); - } - - //At this point, we parsed the model and know to which implementing class we want to parse - //Check if there are several options available - if(returnCandidates.size() > 1) - { - String bestCandidateId = null; - Class bestCandidateClass = null; - long bestNumRelations = -1L; - for(Map.Entry> entry : returnCandidates.entrySet()) - { - String determineBestCandidateQueryString = "CONSTRUCT { ?s ?p ?o . ?o ?p2 ?o2 . ?o2 ?p3 ?o3 . ?o3 ?p4 ?o4 . ?o4 ?p5 ?o5 . }" + - " WHERE {" + - " BIND(<" + entry.getKey() + "> AS ?s). ?s ?p ?o ." + - " OPTIONAL {?o ?p2 ?o2 . OPTIONAL {?o2 ?p3 ?o3 . OPTIONAL {?o3 ?p4 ?o4 . OPTIONAL {?o4 ?p5 ?o5 . } } } } }"; - Query determineBestCandidateQuery = QueryFactory.create(determineBestCandidateQueryString); - QueryExecution determineBestCandidateQueryExecution = QueryExecutionFactory.create(determineBestCandidateQuery, rdfModel); - long graphSize = determineBestCandidateQueryExecution.execConstruct().size(); - if(graphSize > bestNumRelations) - { - bestNumRelations = graphSize; - bestCandidateId = entry.getKey(); - bestCandidateClass = entry.getValue(); - } - - determineBestCandidateQueryExecution.close(); - - } - logger.debug("The RDF graph contains multiple objects which can be parsed to " + targetClass.getSimpleName() + ". Determined " + bestCandidateId + " as best candidate."); - return (T) handleObject(rdfModel, bestCandidateId, bestCandidateClass); - } - - //We only reach this spot, if there is exactly one return candidate. Let's return it - Map.Entry> singularEntry = returnCandidates.entrySet().iterator().next(); - return (T) handleObject(rdfModel, singularEntry.getKey(), singularEntry.getValue()); - - } - - - /** - * Entry point to this class. Takes a message and a desired target class (can be an interface) - * @param message Object to be parsed. Note that the name is misleading: One can also parse non-message IDS objects with this function - * @param targetClass Desired target class (something as abstract as "Message.class" is allowed) - * @param Desired target class - * @return Object of desired target class, representing the values contained in input message - * @throws IOException if the parsing of the message fails - */ - T parseMessage(String message, Class targetClass) throws IOException { - Model model = readMessage(message); - return parseMessage(model, targetClass); - } - - /** - * Entry point to this class. Takes a message and a desired target class (can be an interface) - * @param message Object to be parsed. Note that the name is misleading: One can also parse non-message IDS objects with this function - * @param targetClass Desired target class (something as abstract as "Message.class" is allowed) - * @param serializationFormat Input RDF format - * @param Desired target class - * @return Object of desired target class, representing the values contained in input message - * @throws IOException if the parsing of the message fails - */ - T parseMessage(String message, Class targetClass, Lang serializationFormat) throws IOException { - Model model = readMessage(message, serializationFormat); - return parseMessage(model, targetClass); - } - - /** - * Reads a message into an Apache Jena model, guessing the input language. - * Note: Guessing the language may cause some error messages during parsing attempts - * - * @param message Message to be read - * @return The model of the message - */ - private Model readMessage(String message) throws IOException { - - List supportedLanguages = new ArrayList<>( - Arrays.asList( - RDFLanguages.JSONLD, //JSON-LD first - RDFLanguages.TURTLE, //N-TRIPLE is a subset of Turtle - RDFLanguages.RDFXML - )); - - for (Lang lang : supportedLanguages) { - try { - return readMessage(message, lang); - } catch (IOException ignored) { - } - } - throw new IOException("Could not parse string as any supported RDF format (JSON-LD, Turtle/N-Triple, RDF-XML)."); - } - - /** - * Reads a message into an Apache Jena model, guessing the input language. - * Note: Guessing the language may cause some error messages during parsing attempts - * - * @param message Message to be read - * @param language The RDF serialization of the input. Supported formats are JSON-LD, N-Triple, Turtle, and RDF-XML - * @return The model of the message - */ - private Model readMessage(String message, Lang language) throws IOException { - - Model targetModel = ModelFactory.createDefaultModel(); - - try { - RDFDataMgr.read(targetModel, new ByteArrayInputStream(message.getBytes()), language); - } - catch (RiotException e) - { - throw new IOException("Failed to parse input as " + language, e); - } - return targetModel; - } - - /** - * Get a list of all subclasses (by JsonSubTypes annotation) which can be instantiated - * @param someClass Input class of which implementable subclasses need to be found - * @return ArrayList of instantiable subclasses - */ - ArrayList> getImplementingClasses(Class someClass) { - ArrayList> result = new ArrayList<>(); - KnownSubtypes subTypeAnnotation = someClass.getAnnotation(KnownSubtypes.class); - if (subTypeAnnotation != null) { - KnownSubtypes.Type[] types = subTypeAnnotation.value(); - for (KnownSubtypes.Type type : types) { - result.addAll(getImplementingClasses(type.value())); - } - } - if (!someClass.isInterface() && !Modifier.isAbstract(someClass.getModifiers())) { - result.add(Serializer.customImplementationMap.getOrDefault(someClass, someClass)); - } - return result; - } - - private void addArtificialBlankNodeLabels(Model m) - { - //Get all blank nodes - Query q = QueryFactory.create("SELECT DISTINCT ?s { ?s ?p ?o . FILTER(isBlank(?s)) } "); - QueryExecution qe = QueryExecutionFactory.create(q, m); - ResultSet rs = qe.execSelect(); - List statementsToAdd = new ArrayList<>(); - while(rs.hasNext()) - { - QuerySolution qs = rs.next(); - statementsToAdd.add(ResourceFactory.createStatement(qs.get("?s").asResource(), - ResourceFactory.createProperty(blankNodeIdPropertyUri.toString()), - ResourceFactory.createStringLiteral(qs.get("?s").toString()))); - } - qe.close(); - m.add(statementsToAdd); - } - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java deleted file mode 100644 index ebdf6c1cc..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing.JsonPreprocessor; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing.TypeNamePreprocessor; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.ReflectiveMixInResolver; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.riot.Lang; -import org.apache.jena.riot.RDFDataMgr; -import org.apache.jena.riot.RDFLanguages; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.*; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.*; - -public class Serializer implements org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer, Deserializer { - - private static final ObjectMapper mapper = new ObjectMapper(); - private final List preprocessors; - private final Logger logger = LoggerFactory.getLogger(Serializer.class); - - public static String implementingClassesNamePrefix = "Default"; - public static String implementingClassesNameSuffix = ""; - - static Map, Class> customImplementationMap = new HashMap<>(); - - private static boolean charsetWarningPrinted = false; - - public Serializer() { - mapper.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL); - mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); - mapper.setMixInResolver(new ReflectiveMixInResolver()); - - preprocessors = new ArrayList<>(); - this.addPreprocessor(new TypeNamePreprocessor()); - - if(!Charset.defaultCharset().equals(StandardCharsets.UTF_8) && !charsetWarningPrinted) - { - charsetWarningPrinted = true; - logger.warn("Standard Charset is set to " + Charset.defaultCharset() + " - expecting " + StandardCharsets.UTF_8 + ". Some characters might not be displayed correctly.\nThis warning is only printed once"); - } - - //Default namespaces for AAS - addKnownNamespace("xsd", "http://www.w3.org/2001/XMLSchema#"); - addKnownNamespace("owl", "http://www.w3.org/2002/07/owl#"); - addKnownNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); - addKnownNamespace("aas", "https://admin-shell.io/aas/3/0/RC02/"); - //addKnownNamespace("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/"); - //addKnownNamespace("phys_unit", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/"); - - } - - /** - * Serializes an object to an RDF representation. In order to support RDF, the input instance must be - * annotated using AAS Metamodel annotations. Default format is Turtle (TTL). - * - * @param instance the instance to be serialized - * @return RDF serialization of the provided object graph - * @throws IOException if the serialization fails - */ - public String serialize(Object instance) throws IOException { - return serialize(instance, RDFLanguages.TTL, new HashMap<>()); - } - - /** - * Serializes an object to an RDF representation of a given RDF serialization format. In order to support RDF, the - * input instance must be annotated using AAS Metamodel annotations. - * - * @param instance the instance to be serialized - * @param format the RDF format to be returned (only RDFLanguages.TTL, RDFLanguages.JSONLD, RDFLanguages.RDFXML) - * @return RDF serialization of the provided object graph - * @throws IOException if the serialization fails - */ - public synchronized String serialize(Object instance, Lang format) throws IOException { - return serialize(instance, format, new HashMap<>() ); - } - - - //Synchronized is required for thread safety. Without it, context elements might be missing in case of multiple simultaneous calls to this function - public synchronized String serialize(Object instance, Lang format, Map idMap) throws IOException { - if (format != RDFLanguages.JSONLD && format != RDFLanguages.TURTLE && format != RDFLanguages.RDFXML) { - throw new IOException("RDFFormat " + format + " is currently not supported by the serializer."); - } - mapper.registerModule(new JsonLDModule(idMap)); - String jsonLD = (instance instanceof Collection) - ? serializeCollection((Collection) instance) - : mapper.writerWithDefaultPrettyPrinter().writeValueAsString(instance); - if (format == RDFLanguages.JSONLD) return jsonLD; - else return convertJsonLdToOtherRdfFormat(jsonLD, format); - } - - private String serializeCollection(Collection collection) throws IOException { - String lineSep = System.lineSeparator(); - StringBuilder jsonLDBuilder = new StringBuilder(); - - if (collection.isEmpty()) { - jsonLDBuilder.append("[]"); - } else { - jsonLDBuilder.append("["); - jsonLDBuilder.append(lineSep); - for (Object item : collection) { - jsonLDBuilder.append(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(item)); - jsonLDBuilder.append(","); - jsonLDBuilder.append(lineSep); - } - int lastComma = jsonLDBuilder.lastIndexOf(","); - jsonLDBuilder.replace(lastComma, lastComma + 1, ""); - jsonLDBuilder.append("]"); - } - jsonLDBuilder.append(lineSep); - - return jsonLDBuilder.toString(); - } - - public String convertJsonLdToOtherRdfFormat(String jsonLd, Lang format) { - Model model = ModelFactory.createDefaultModel(); - RDFDataMgr.read(model, new ByteArrayInputStream(jsonLd.getBytes()), RDFLanguages.JSONLD); - - ByteArrayOutputStream os = new ByteArrayOutputStream(); - RDFDataMgr.write(os, model, format); - return os.toString(); - } - - public String serializePlainJson(Object instance) throws JsonProcessingException { - return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(instance); - } - - /** - * Inverse method of "serialize" - * - * @param serialization JSON(-LD) string - * @param valueType class of top level type - * @param deserialized type - * @return an object representing the provided JSON(-LD) structure - * @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF - */ - public T deserialize(String serialization, Class valueType) throws DeserializationException { - try { - return new Parser().parseMessage(serialization, valueType); - } - catch (IOException e) - { - throw new DeserializationException("Failed to deserialize input.", e); - } - } - - /** - * Inverse method of "serialize" - * - * @param serialization JSON(-LD) string - * @param valueType class of top level type - * @param serializationFormat RDF input format - * @param deserialized type - * @return an object representing the provided JSON(-LD) structure - * @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF - */ - public T deserialize(String serialization, Class valueType, Lang serializationFormat) throws DeserializationException { - try { - - return new Parser().parseMessage(serialization, valueType, serializationFormat); - } - catch (IOException e) - { - throw new DeserializationException("Failed to deserialize input.", e); - } - } - - /** - * Inverse method of "serialize" - * - * @param rdfModel Input RDF Model to be turned into an Instance of the IDS Java classes - * @param valueType class of top level type - * @param deserialized type - * @return an object representing the provided JSON(-LD) structure - * @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF - */ - public T deserialize(Model rdfModel, Class valueType) throws DeserializationException { - try { - return new Parser().parseMessage(rdfModel, valueType); - } - catch (IOException e) - { - throw new DeserializationException("Failed to deserialize input.", e); - } - } - - /** - * Allows to add further known namespaces to the message parser. Allows parsing to Java objects with JsonSubTypes annotations with other prefixes than "ids:". - * @param prefix Prefix to be added - * @param namespaceUrl URL of the prefix - */ - public static void addKnownNamespace(String prefix, String namespaceUrl) - { - Parser.knownNamespaces.put(prefix, namespaceUrl); - JsonLDSerializer.contextItems.put(prefix, namespaceUrl); - } - - /** - * Method to add a preprocessor for deserialization. - *

- * Important note: The preprocessors are executed in the same order they were added. - * - * @param preprocessor the preprocessor to add - */ - public void addPreprocessor(JsonPreprocessor preprocessor) { - preprocessors.add(preprocessor); - } - - /** - * Method to add a preprocessor for deserialization. - *

- * Important note: The preprocessors are executed in the same order they were added. - * - * @param preprocessor the preprocessor to add - * @param validate set whether the preprocessors output should be checked by RDF4j - */ - public void addPreprocessor(JsonPreprocessor preprocessor, boolean validate) { - preprocessor.enableRDFValidation(validate); - addPreprocessor(preprocessor); - } - - /** - * remove a preprocessor if no longer needed - * - * @param preprocessor the preprocessor to remove - */ - public void removePreprocessor(JsonPreprocessor preprocessor) { - preprocessors.remove(preprocessor); - } - - @Override - public String write(Environment aasEnvironment) throws SerializationException { - try { - return serialize(aasEnvironment); - } - catch (IOException e) - { - throw new SerializationException("Failed to serialize environment.", e); - } - } - - public String write(Environment aasEnvironment, Lang format) throws SerializationException { - return write(aasEnvironment, format, new HashMap<>()); - } - - public String write(Environment aasEnvironment, Lang format, Map idMap) throws SerializationException { - try { - return serialize(aasEnvironment, format, idMap); - } - catch (IOException e) - { - throw new SerializationException("Failed to serialize environment.", e); - } - } - @Override - public Environment read(String value) throws DeserializationException { - try { - return new Parser().parseMessage(value, Environment.class); - } - catch (IOException e) - { - throw new DeserializationException("Could not deserialize to environment.", e); - } - } - - public Environment read(String value, Lang serializationFormat) throws DeserializationException { - try { - return new Parser().parseMessage(value, Environment.class, serializationFormat); - } - catch (IOException e) - { - throw new DeserializationException("Could not deserialize to environment.", e); - } - } - - @Override - public void useImplementation(Class aasInterface, Class implementation) { - customImplementationMap.put(aasInterface, implementation); - //throw new NotImplementedException("Custom implementation support not yet implemented"); - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java deleted file mode 100644 index 972b02561..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import java.io.IOException; -import java.net.URI; - - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonStreamContext; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; - -public class UriSerializer extends StdSerializer { - - - public UriSerializer() { - this(null); - } - - public UriSerializer(Class clazz) { - super(clazz); - } - - - @Override - public void serialize(URI value, JsonGenerator gen, SerializerProvider provider) throws IOException { - String serializedUri = value.toString(); - // String idPattern = "{\"@id\": \"" + serializedUri + "\"}"; - JsonStreamContext context = gen.getOutputContext(); - if (context.getCurrentName() != null && context.getCurrentName().contains("@id")) { - gen.writeString(serializedUri); - } else { - gen.writeStartObject(); - gen.writeStringField("@id", serializedUri); - gen.writeEndObject(); - } - } - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java deleted file mode 100644 index d2e04c6db..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; - -import java.io.IOException; -import java.math.BigDecimal; - -public class BigDecimalSerializer extends StdSerializer { - - public BigDecimalSerializer() { - this(null); - } - - public BigDecimalSerializer(Class clazz) { - super(clazz); - } - - @Override - public void serialize(BigDecimal value, JsonGenerator gen, SerializerProvider provider) throws IOException { - gen.writeStartObject(); - gen.writeStringField("@value", value.toString()); - gen.writeStringField("@type", "http://www.w3.org/2001/XMLSchema#decimal"); - gen.writeEndObject(); - } -} \ No newline at end of file diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java deleted file mode 100644 index 47ff2ec1d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; - -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.JsonLdEnumSerializer; - -@JsonSerialize(using = JsonLdEnumSerializer.class) -public class JsonLdEnumMixin { -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java deleted file mode 100644 index c60d62dc9..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - - -import java.util.List; - -@JsonTypeName("rdf:langString") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface LangStringMixin { - @JsonProperty("@value") - public String getValue(); - - @JsonProperty("@language") - public String getLanguage(); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java deleted file mode 100644 index e7eb1a61c..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; - -import com.fasterxml.jackson.databind.introspect.ClassIntrospector; - -public class ReflectiveMixInResolver implements ClassIntrospector.MixInResolver { - - @Override - public Class findMixInClassFor(Class cls) { - if (cls.isEnum()) - { - return JsonLdEnumMixin.class; - } - try { - return Class.forName("org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins." + cls.getSimpleName() + "Mixin"); - } - catch (ClassNotFoundException ignored) - { - return null; - } - } - - @Override - public ClassIntrospector.MixInResolver copy() { - return new ReflectiveMixInResolver(); - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java deleted file mode 100644 index 94c0f9d08..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; - -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; -import javax.xml.datatype.XMLGregorianCalendar; -import java.io.IOException; -import java.time.ZonedDateTime; -import java.util.GregorianCalendar; - -public class XMLGregorianCalendarDeserializer extends StdDeserializer { - - public XMLGregorianCalendarDeserializer() { - this(XMLGregorianCalendar.class); - } - - public XMLGregorianCalendarDeserializer(Class clazz) { - super(clazz); - } - - @Override - public XMLGregorianCalendar deserialize(JsonParser p, DeserializationContext context) throws IOException { - XMLGregorianCalendar xgc = null; - try { - xgc = DatatypeFactory.newInstance().newXMLGregorianCalendar(GregorianCalendar.from(ZonedDateTime.parse(p.getValueAsString()))); - } catch (DatatypeConfigurationException e) { - e.printStackTrace(); - } - return xgc; - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java deleted file mode 100644 index a4cfb571c..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; - -import javax.xml.datatype.XMLGregorianCalendar; -import java.io.IOException; -import java.text.SimpleDateFormat; - -public class XMLGregorianCalendarSerializer extends StdSerializer { - - public XMLGregorianCalendarSerializer() { - this(null); - } - - public XMLGregorianCalendarSerializer(Class clazz) { - super(clazz); - } - - @Override - public void serialize(XMLGregorianCalendar value, JsonGenerator gen, SerializerProvider provider) throws IOException { - SimpleDateFormat xsdDateTimeStampFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"); - xsdDateTimeStampFormat.setCalendar(value.toGregorianCalendar()); - String xsdDateTimeStampFormatted = xsdDateTimeStampFormat.format(value.toGregorianCalendar().getTime()); - gen.writeStartObject(); - gen.writeStringField("@value", xsdDateTimeStampFormatted); - gen.writeStringField("@type", "http://www.w3.org/2001/XMLSchema#dateTimeStamp"); - gen.writeEndObject(); - - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java deleted file mode 100644 index f3b92a6e0..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:AdministrativeInformation") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface AdministrativeInformationMixin extends HasDataSpecificationMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") - String getVersion(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") - void setVersion(String version); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") - String getRevision(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") - void setRevision(String revision); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java deleted file mode 100644 index 44edbc177..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; - -import java.util.List; - -@JsonTypeName("aas:AnnotatedRelationshipElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface AnnotatedRelationshipElementMixin extends RelationshipElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotation") - List getAnnotations(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotation") - void setAnnotations(List annotations); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java deleted file mode 100644 index 306463292..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:AssetAdministrationShell") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface AssetAdministrationShellMixin extends HasDataSpecificationMixin, IdentifiableMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") - AssetInformation getAssetInformation(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") - void setAssetInformation(AssetInformation assetInformation); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") - Reference getDerivedFrom(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") - void setDerivedFrom(Reference derivedFrom); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodel") - List getSubmodels(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodel") - void setSubmodels(List submodels); - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java deleted file mode 100644 index 45f2afe13..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:AssetInformation") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface AssetInformationMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") - AssetKind getAssetKind(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") - void setAssetKind(AssetKind assetKind); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") - Reference getGlobalAssetId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") - void setGlobalAssetId(Reference globalAssetId); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") - List getSpecificAssetIds(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") - void setSpecificAssetIds(List specificAssetIds); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/billOfMaterial") - List getBillOfMaterials(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/billOfMaterial") - void setBillOfMaterials(List billOfMaterials); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") - File getDefaultThumbnail(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") - void setDefaultThumbnail(File defaultThumbnail); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java deleted file mode 100644 index 2690318f6..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Direction; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - -@JsonTypeName("aas:BasicEventElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface BasicEventElementMixin extends EventElementMixin { - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") - Direction getDirection(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") - void setDirection(Direction direction); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") - String getLastUpdate(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") - void setLastUpdate(String lastUpdate); - - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") - String getMaxInterval(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") - void setMaxInterval(String maxInterval); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") - Reference getMessageBroker(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") - void setMessageBroker(Reference messageBroker); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") - String getMessageTopic(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") - void setMessageTopic(String messageTopic); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") - String getMinInterval(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") - void setMinInterval(String minInterval); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") - Reference getObserved(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") - void setObserved(Reference observed); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") - StateOfEvent getState(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") - void setState(StateOfEvent state); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java deleted file mode 100644 index dfb2e7a6d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:Blob") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface BlobMixin extends DataElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") - String getContentType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") - void setConentType(String mimeType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/value") - byte[] getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/value") - void setValue(byte[] value); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java deleted file mode 100644 index 1991a410d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:Capability") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface CapabilityMixin extends SubmodelElementMixin { - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java deleted file mode 100644 index 196244ecd..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:ConceptDescription") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ConceptDescriptionMixin extends HasDataSpecificationMixin, IdentifiableMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") - List getIsCaseOf(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") - void setIsCaseOf(List isCaseOf); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java deleted file mode 100644 index abc0d5f1d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - - -@JsonTypeName("aas:DataElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = File.class), - @JsonSubTypes.Type(value = Blob.class), - @JsonSubTypes.Type(value = MultiLanguageProperty.class), - @JsonSubTypes.Type(value = Property.class), - @JsonSubTypes.Type(value = Range.class), - @JsonSubTypes.Type(value = ReferenceElement.class) -}) -public interface DataElementMixin extends SubmodelElementMixin { - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java deleted file mode 100644 index ecef45ebc..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - -import java.util.List; - -@JsonTypeName("aas:DataSpecificationContent") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = DataSpecificationIEC61360.class) -}) -public interface DataSpecificationContentMixin { - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java deleted file mode 100644 index 13c3b6aec..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - -import java.util.List; - -@JsonTypeName("aas:DataSpecificationIEC61360") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface DataSpecificationIEC61360Mixin extends DataSpecificationContentMixin { - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") - public DataTypeIEC61360 getDataType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") - public void setDataType(DataTypeIEC61360 dataType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") - public List getDefinition(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") - public void setDefinitions(List definition); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") - public LevelType getLevelType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") - public void setLevelType(LevelType levelType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") - public List getPreferredName(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") - public void setPreferredName(List preferredName); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") - public List getShortName(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") - public void setShortName(List shortName); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") - public String getSourceOfDefinition(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") - public void setSourceOfDefinition(String sourceOfDefinition); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") - public String getSymbol(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") - public void setSymbol(String symbol); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") - public String getUnit(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") - public void setUnit(String unit); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") - public Reference getUnitId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") - public void setUnitId(Reference unitId); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") - public String getValueFormat(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") - public void setValueFormat(String valueFormat); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") - public String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") - public void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") - public ValueList getValueList(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") - public void setValueList(ValueList valueList); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueId") - public Reference getValueId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueId") - public void setValueId(Reference valueId); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java deleted file mode 100644 index 8caf8a712..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -import java.util.List; - -@JsonTypeName("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface DataSpecificationPhysicalUnitMixin { - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") - String getConversionFactor(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") - void setConversionFactor(String conversionFactor); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/definition") - List getDefinitions(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/definition") - void setDefinitions(List definitions); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") - String getDinNotation(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") - void setDinNotation(String dinNotation); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") - String getEceCode(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") - void setEceCode(String eceCode); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceName") - String getEceName(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceName") - void setEceName(String eceName); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/nistName") - String getNistName(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/nistName") - void setNistName(String nistName); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siName") - String getSiName(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siName") - void setSiName(String siName); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") - String getSiNotation(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") - void setSiNotation(String siNotation); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") - String getRegistrationAuthorityId(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") - void setRegistrationAuthorityId(String registrationAuthorityId); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/supplier") - String getSupplier(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/supplier") - void setSupplier(String supplier); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitName") - String getUnitName(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitName") - void setUnitName(String unitName); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") - String getUnitSymbol(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") - void setUnitSymbol(String unitSymbol); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java deleted file mode 100644 index af4615037..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:EmbeddedDataSpecification") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface EmbeddedDataSpecificationMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") - public DataSpecificationIEC61360 getDataSpecificationContent(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") - public void setDataSpecificationContent(DataSpecificationIEC61360 dataSpecificationContent); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") - public Reference getDataSpecification(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") - public void setDataSpecification(Reference dataSpecification); - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java deleted file mode 100644 index c99abc22d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.List; - -@JsonTypeName("aas:Entity") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface EntityMixin extends SubmodelElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") - Reference getGlobalAssetId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") - void setGlobalAssetId(Reference globalAssetId); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") - SpecificAssetId getSpecificAssetId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") - void setSpecificAssetId(SpecificAssetId specificAssetId); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") - EntityType getEntityType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") - void setEntityType(EntityType entityType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/statement") - List getStatements(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/statement") - void setStatements(List statements); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java deleted file mode 100644 index d11186246..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; - -import java.util.List; - -@JsonTypeName("aas:Environment") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface EnvironmentMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") - List getAssetAdministrationShells(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") - void setAssetAdministrationShells(List assetAdministrationShells); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") - List getConceptDescriptions(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") - void setConceptDescriptions(List conceptDescriptions); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") - List getSubmodels(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") - void setSubmodels(List submodels); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java deleted file mode 100644 index 242a382b8..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; - - -@JsonTypeName("aas:EventElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = BasicEventElement.class) -}) -public interface EventElementMixin extends SubmodelElementMixin { - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java deleted file mode 100644 index cf749d68b..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:EventMessage") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface EventMessageMixin extends SubmodelElementMixin { - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java deleted file mode 100644 index 49d8ef044..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:Extension") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ExtensionMixin extends HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/name") - String getName(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/name") - void setName(String name); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") - String getValueType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") - void setValueType(String valueType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/value") - void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") - Reference getRefersTo(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") - void setRefersTo(Reference refersTo); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java deleted file mode 100644 index b3d153445..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:File") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface FileMixin extends DataElementMixin, SubmodelElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/contentType") - String getContentType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/contentType") - void setContentType(String contentType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/value") - void setValue(String value); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java deleted file mode 100644 index a8005ea52..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:Formula") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface FormulaMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Formula/dependsOn") - List getDependsOns(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Formula/dependsOn") - void setDependsOns(List dependsOns); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java deleted file mode 100644 index 9663339aa..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - - -import java.util.List; - -@JsonTypeName("aas:HasDataSpecification") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Submodel.class), - @JsonSubTypes.Type(value = AdministrativeInformation.class), - @JsonSubTypes.Type(value = AssetAdministrationShell.class), - @JsonSubTypes.Type(value = ConceptDescription.class), - @JsonSubTypes.Type(value = SubmodelElement.class) -}) -public interface HasDataSpecificationMixin { - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiations") - List getDataSpecifications(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiations") - void setDataSpecifications(List dataSpecifications); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") - List getEmbeddedDataSpecifications(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") - void setEmbeddedDataSpecifications(List embeddedDataSpecifications); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java deleted file mode 100644 index 734ee4bbf..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; - -import java.util.List; - -@JsonTypeName("aas:HasExtensions") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface HasExtensionsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension") - List getExtensions(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension") - void setExtensions(List extensions); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java deleted file mode 100644 index 23a5c6a05..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -@JsonTypeName("aas:HasKind") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Submodel.class), - @JsonSubTypes.Type(value = SubmodelElement.class) -}) -public interface HasKindMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - ModelingKind getKind(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - void setKind(ModelingKind kind); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java deleted file mode 100644 index 588ad4c8e..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - -import java.util.List; - - -@JsonTypeName("aas:HasSemantics") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Submodel.class), - @JsonSubTypes.Type(value = SpecificAssetId.class), - @JsonSubTypes.Type(value = SubmodelElement.class), - @JsonSubTypes.Type(value = Qualifier.class), - @JsonSubTypes.Type(value = Extension.class) -}) -public interface HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") - Reference getSemanticId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") - void setSemanticId(Reference semanticId); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") - List getSupplementalSemanticIds(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") - void setSupplementalSemanticIds(List references); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java deleted file mode 100644 index 4e165f986..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; - -@JsonTypeName("aas:Identifiable") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Submodel.class), - @JsonSubTypes.Type(value = AssetAdministrationShell.class), - @JsonSubTypes.Type(value = ConceptDescription.class) -}) -public interface IdentifiableMixin extends ReferableMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") - AdministrativeInformation getAdministration(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") - void setAdministration(AdministrativeInformation administration); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") - String getId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") - void setId(String id); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java deleted file mode 100644 index 7c7f55f2a..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:IdentifierKeyValuePair") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface IdentifierKeyValuePairMixin extends HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/key") - String getKey(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/key") - void setKey(String key); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/value") - void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/externalSubjectId") - Reference getExternalSubjectId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/externalSubjectId") - void setExternalSubjectId(Reference externalSubjectId); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java deleted file mode 100644 index 1416e89a7..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:Identifier") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface IdentifierMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifier/identifier") - String getIdentifier(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifier/identifier") - void setIdentifier(String identifier); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java deleted file mode 100644 index 1d1c5c763..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; - -@JsonTypeName("aas:Key") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface KeyMixin { - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/type") - KeyTypes getType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/type") - void setType(KeyTypes type); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/value") - void setValue(String value); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java deleted file mode 100644 index 562facc00..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:MultiLanguageProperty") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface MultiLanguagePropertyMixin extends DataElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") - List getValues(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") - void setValues(List values); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") - Reference getValueId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") - void setValueId(Reference valueId); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java deleted file mode 100644 index 95e005f22..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:ObjectAttributes") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ObjectAttributesMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ObjectAttributes/objectAttribute") - List getObjectAttributes(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ObjectAttributes/objectAttribute") - void setObjectAttributes(List objectAttributes); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java deleted file mode 100644 index 3ad6ca03d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; - -import java.util.List; - -@JsonTypeName("aas:Operation") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface OperationMixin extends SubmodelElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariable") - List getInputVariables(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariable") - void setInputVariables(List inputVariables); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariable") - List getInoutputVariables(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariable") - void setInoutputVariables(List inoutputVariables); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariable") - List getOutputVariables(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariable") - void setOutputVariables(List outputVariables); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java deleted file mode 100644 index 76e45277b..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -@JsonTypeName("aas:OperationVariable") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface OperationVariableMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") - SubmodelElement getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") - void setValue(SubmodelElement value); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java deleted file mode 100644 index fade7f4e7..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:PolicyDecisionPoint") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface PolicyDecisionPointMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyDecisionPoint/externalPolicyDecisionPoints") - boolean getExternalPolicyDecisionPoints(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyDecisionPoint/externalPolicyDecisionPoints") - void setExternalPolicyDecisionPoints(boolean externalPolicyDecisionPoints); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java deleted file mode 100644 index 331c8a872..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:PolicyEnforcementPoints") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface PolicyEnforcementPointsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyEnforcementPoints/externalPolicyEnforcementPoint") - boolean getExternalPolicyEnforcementPoint(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyEnforcementPoints/externalPolicyEnforcementPoint") - void setExternalPolicyEnforcementPoint(boolean externalPolicyEnforcementPoint); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java deleted file mode 100644 index 817bb2f5c..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:PolicyInformationPoints") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface PolicyInformationPointsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/externalInformationPoints") - boolean getExternalInformationPoints(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/externalInformationPoints") - void setExternalInformationPoints(boolean externalInformationPoints); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/internalInformationPoint") - List getInternalInformationPoints(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/internalInformationPoint") - void setInternalInformationPoints(List internalInformationPoints); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java deleted file mode 100644 index 7658c2e2c..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:Property") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface PropertyMixin extends DataElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueType") - String getValueType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueType") - void setValueType(String valueType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/value") - void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueId") - Reference getValueId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueId") - void setValueId(Reference valueId); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java deleted file mode 100644 index 739dfc67f..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; - -import java.util.List; - -@JsonTypeName("aas:Qualifiable") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Submodel.class), - @JsonSubTypes.Type(value = SubmodelElement.class) -}) -public interface QualifiableMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifier") - List getQualifiers(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifier") - void setQualifiers(List qualifiers); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java deleted file mode 100644 index 899cbe893..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:Qualifier") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface QualifierMixin extends HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") - String getType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") - void setType(String type); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") - String getValueType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") - void setValueType(String valueType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") - void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") - Reference getValueId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") - void setValueId(Reference valueId); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java deleted file mode 100644 index fb38aafc5..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:Range") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface RangeMixin extends DataElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/valueType") - String getValueType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/valueType") - void setValueType(String valueType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/max") - String getMax(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/max") - void setMax(String max); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/min") - String getMin(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/min") - void setMin(String min); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java deleted file mode 100644 index c31908a5d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.List; - -@JsonTypeName("aas:Referable") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Identifiable.class), - @JsonSubTypes.Type(value = SubmodelElement.class) -}) -public interface ReferableMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/category") - String getCategory(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/category") - void setCategory(String category); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/description") - List getDescription(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/description") - void setDescription(List description); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - List getDisplayName(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - void setDisplayName(List displayName); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") - String getIdShort(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") - void setIdShort(String idShort); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java deleted file mode 100644 index 0a4cb3668..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:ReferenceElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ReferenceElementMixin extends DataElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") - Reference getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") - void setValue(Reference value); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java deleted file mode 100644 index bd836cf9d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - -import java.util.List; - -@JsonTypeName("aas:Reference") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ReferenceMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/keys") - List getKeys(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/keys") - void setKeys(List keys); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/type") - ReferenceTypes getType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/type") - void setType(ReferenceTypes type); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java deleted file mode 100644 index d523598ab..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:RelationshipElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = AnnotatedRelationshipElement.class) -}) -public interface RelationshipElementMixin extends SubmodelElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") - Reference getFirst(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") - void setFirst(Reference first); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") - Reference getSecond(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") - void setSecond(Reference second); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java deleted file mode 100644 index 6f535d8a2..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; - -import java.util.List; - -@JsonTypeName("aas:Resource") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ResourceMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") - String getContentType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") - void setContentType(String contentType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/path") - String getPath(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/path") - void setPath(String path); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java deleted file mode 100644 index 940f36639..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; - -@JsonTypeName("aas:SpecificAssetId") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface SpecificAssetIdMixin extends HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") - String getName(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") - void setName(String name); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") - void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") - Reference getExternalSubjectId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") - void setExternalSubjectId(Reference reference); - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java deleted file mode 100644 index 6ee1af3b6..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; - -import java.util.List; - -@JsonTypeName("aas:SubjectAttributes") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface SubjectAttributesMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubjectAttributes/subjectAttribute") - List getSubjectAttributes(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubjectAttributes/subjectAttribute") - void setSubjectAttributes(List subjectAttributes); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java deleted file mode 100644 index f9559be87..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.Collection; - -@JsonTypeName("aas:SubmodelElementCollection") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface SubmodelElementCollectionMixin extends SubmodelElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/allowDuplicates") - boolean getAllowDuplicates(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/allowDuplicates") - void setAllowDuplicates(boolean allowDuplicates); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/ordered") - boolean getOrdered(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/ordered") - void setOrdered(boolean ordered); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") - Collection getValues(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") - void setValues(Collection values); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java deleted file mode 100644 index 2b754f2c1..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - -import java.util.List; - -@JsonTypeName("aas:SubmodelElementList") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface SubmodelElementListMixin extends SubmodelElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") - boolean getOrderRelevant(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") - void setOrderRelevant(boolean orderRelevant); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") - Reference getSemanticIdListElement(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") - void setSemanticIdListElement(Reference semanticIdListElement); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") - AasSubmodelElements getTypeValueListElement(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") - void setTypeValueListElement(AasSubmodelElements typeValueListElement); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") - List getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") - void setValue(List value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") - DataTypeDefXsd getValueTypeListElement(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") - void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java deleted file mode 100644 index f8f878da4..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - - -@JsonTypeName("aas:SubmodelElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = RelationshipElement.class), - @JsonSubTypes.Type(value = DataElement.class), - @JsonSubTypes.Type(value = File.class), - @JsonSubTypes.Type(value = Capability.class), - @JsonSubTypes.Type(value = Entity.class), - @JsonSubTypes.Type(value = EventElement.class), - @JsonSubTypes.Type(value = EventPayload.class), - @JsonSubTypes.Type(value = Operation.class), - @JsonSubTypes.Type(value = SubmodelElementCollection.class) -}) -public interface SubmodelElementMixin extends ReferableMixin, QualifiableMixin, HasDataSpecificationMixin, HasKindMixin, HasSemanticsMixin { - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java deleted file mode 100644 index a5dcc9a8b..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.List; - -@JsonTypeName("aas:Submodel") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface SubmodelMixin extends QualifiableMixin, HasDataSpecificationMixin, IdentifiableMixin, HasKindMixin, HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElement") - List getSubmodelElements(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElement") - void setSubmodelElements(List submodelElements); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java deleted file mode 100644 index 5d7ac5811..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; - -import java.util.List; - - -@JsonTypeName("aas:ValueList") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ValueListMixin { - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") - List getValueReferencePairs(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") - void setValueReferencePairs(List valueReferencePairs); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java deleted file mode 100644 index fc75ff057..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:ValueReferencePair") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ValueReferencePairMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") - void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") - Reference getValueId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") - void setValueId(Reference valueId); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java deleted file mode 100644 index dcae112eb..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:View") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ViewMixin extends ReferableMixin, HasDataSpecificationMixin, HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/View/containedElement") - List getContainedElements(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/View/containedElement") - void setContainedElements(List containedElements); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java deleted file mode 100644 index 209b9e98f..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing; - - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.riot.RDFDataMgr; -import org.apache.jena.riot.RDFLanguages; - - -import java.io.ByteArrayInputStream; -import java.io.IOException; - -/** - * basic implementation of {@code JsonPreprocessor} that encapsulates validation. - * By default, validation is disabled for performance reasons (@context has to be downloaded each time). - */ -public abstract class BasePreprocessor implements JsonPreprocessor { - - private boolean validate = false; - - - @Override - public final String preprocess(String input) throws IOException { - String result = preprocess_impl(input); - if(validate) { - Model m = ModelFactory.createDefaultModel(); - RDFDataMgr.read(m, new ByteArrayInputStream(result.getBytes()), RDFLanguages.JSONLD); - } - return result; - } - - abstract String preprocess_impl(String input) throws IOException; - - @Override - public void enableRDFValidation(boolean validate) { - this.validate = validate; - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java deleted file mode 100644 index eb99ac8b3..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing; - -import java.io.IOException; - -/** - * Interface for JSON-LD preprocessors which should transform JSON-LD inputs - * before they are deserialized by Jackson. - * - * Implementations used at the same time must not interfere with each other. - */ -public interface JsonPreprocessor { - - /** - * preprocessing method - * @param input of the transformation, the original JSON-LD - * @return the transformation´s result - * @throws IOException if preprocessing fails, e.g. because the input is not valid RDF - */ - public String preprocess(String input) throws IOException; - - /** - * specify wheter the transformation's result should be validated to - * be parsable by RDF4j - * @param validate enable/disable switch - */ - public void enableRDFValidation(boolean validate); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java deleted file mode 100644 index e117d0359..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing; - -import com.fasterxml.jackson.databind.ObjectMapper; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; - -public class TypeNamePreprocessor extends BasePreprocessor { - - private static final Map prefixes; - - static { - prefixes = new HashMap<>(); - prefixes.put("ids:", "https://w3id.org/idsa/core/"); - prefixes.put("idsc:", "https://w3id.org/idsa/code/"); - prefixes.put("info:", "http://www.fraunhofer.de/fraunhofer-digital/infomodell#"); - prefixes.put("kdsf:", "http://kerndatensatz-forschung.de/version1/technisches_datenmodell/owl/Basis#"); - } - - @Override - String preprocess_impl(String input) throws IOException { - ObjectMapper mapper = new ObjectMapper(); - Map inMap = mapper.readValue(input, Map.class); - Map outMap = unifyTypeURIPrefix(inMap); - return mapper.writeValueAsString(outMap); - } - - - private Map unifyTypeURIPrefix(Map in) { - Map out = new LinkedHashMap<>(); - in.forEach((k,v) -> { - if(v instanceof String && k instanceof String && k.equals("@type")) { - - - // if key is @type and value is a string: add 'ids:' if no other namespace at the value - AtomicReference modifiableValue = new AtomicReference<>((String) v); - prefixes.forEach((p, u) -> modifiableValue.set(modifiableValue.get().replace(u, p))); // replace full URI with prefix - if(! (modifiableValue.get().startsWith("ids:") - || modifiableValue.get().startsWith("idsc:") - || modifiableValue.get().startsWith("info:") - || modifiableValue.get().startsWith("kdsf:") - || modifiableValue.get().startsWith("xsd:") - || modifiableValue.get().startsWith("http://") - || modifiableValue.get().startsWith("https://"))) { - modifiableValue.set("ids:".concat(modifiableValue.get())); // default to ids prefix for backwards compatibility - } - out.put(k, modifiableValue.get()); - - - } else if(v instanceof Map) { - AtomicReference modifiableKey = new AtomicReference<>((String) k); - - prefixes.forEach((prefix, uri) -> modifiableKey.set(modifiableKey.get().replace(uri, prefix))); // replace full URI with prefix - if(! (modifiableKey.get().startsWith("ids:") - || modifiableKey.get().startsWith("info:") - || modifiableKey.get().startsWith("kdsf:") - || modifiableKey.get().startsWith("http://") - || modifiableKey.get().startsWith("https://") - || modifiableKey.get().startsWith("@context"))) { - modifiableKey.set("ids:".concat(modifiableKey.get())); // default to ids prefix for backwards compatibility - } - - - // shorten an @id Map - if (((Map) v).containsKey("@id") && ((Map) v).keySet().size() == 1) { - Map idMap = new LinkedHashMap<>(); - idMap.put(k, ((Map) v).get("@id")); - - out.putAll(unifyTypeURIPrefix(idMap)); - - } else if (((Map) v).containsKey("@value") && - ((Map) v).containsKey("@type")) - { - if( ((Map) v).get("@type").toString().contains("dateTime") ) - { - - // shorten an @value Map with xsd:dateTimes - Object date = ((Map) v).get("@value"); - out.put(modifiableKey, date); - } - else if(((Map) v).get("@type").toString().equals("xsd:integer")) - { - int value = Integer.parseInt(((Map) v).get("@value").toString()); - out.put(modifiableKey, value); - } - else { //Do the same as below - out.put(modifiableKey, unifyTypeURIPrefix((Map) v)); - } - - } else { - - out.put(modifiableKey, unifyTypeURIPrefix((Map) v)); - - - } - - } else if(v instanceof ArrayList) { - - - AtomicReference modifiableKey = new AtomicReference<>((String) k); - prefixes.forEach((p, u) -> modifiableKey.set(modifiableKey.get().replace(u, p))); // replace full URI with prefix - if(! (modifiableKey.get().startsWith("ids:") - || modifiableKey.get().startsWith("info:") - || modifiableKey.get().startsWith("kdsf:") - || modifiableKey.get().startsWith("http://") - || modifiableKey.get().startsWith("https://"))) { - modifiableKey.set("ids:".concat(modifiableKey.get())); // default to ids prefix for backwards compatibility - } - - Iterator iter = new ArrayList((ArrayList) v).iterator(); //making a copy of the old array so the iterator does not get confused by the element deletions - while (iter.hasNext()) { - Object child = iter.next(); - if (child instanceof Map && ((Map) child).containsKey("@id") && ((Map) child).keySet().size() == 1) { - ((ArrayList) v).remove(child); - ((ArrayList) v).add(((Map) child).get("@id")); - } - } - - out.put(modifiableKey, unifyTypeURIPrefix((ArrayList) v)); // TODO: What happens with an Array inside the Array? - - - } else { - - - AtomicReference modifiableKey = new AtomicReference<>((String) k); - prefixes.forEach((p, u) -> modifiableKey.set(modifiableKey.get().replace(u, p))); // replace full URI with prefix - if(! (modifiableKey.get().startsWith("ids:") - || modifiableKey.get().startsWith("info:") - || modifiableKey.get().startsWith("kdsf:") - || modifiableKey.get().startsWith("http://") - || modifiableKey.get().startsWith("https://") - || modifiableKey.get().startsWith("@"))) { - //in the context definition, a pair might look like this: "ids" : "http://www.someURL.com" - //Here, we start with "ids", not "ids:". So we also need to check that the key is not contained in our prefixes - if(!prefixes.containsKey(modifiableKey.get() + ":")) { - modifiableKey.set("ids:".concat(modifiableKey.get())); // default to ids prefix for backwards compatibility - } - } - - out.put(modifiableKey, v); // modify nothing if not @type or a map - } - }); - return out; - } - - - private ArrayList unifyTypeURIPrefix(ArrayList in) { - ArrayList out = new ArrayList<>(); - - Iterator iter = in.iterator(); - - while (iter.hasNext()) { - Object v = iter.next(); - if(v instanceof Map) { - - - if (!((Map) v).isEmpty()) - out.add( unifyTypeURIPrefix((Map) v)); - - - } else if (v instanceof String) { - - out.add(v); // modify nothing if not @type or a map - } else { - out.add(v); - } - } - return out; - } - - - - -} diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java deleted file mode 100644 index 8d603f749..000000000 --- a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; - -import org.apache.jena.riot.RDFLanguages; - -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; - -import junitparams.JUnitParamsRunner; -import junitparams.Parameters; - -import java.io.IOException; - -@RunWith(JUnitParamsRunner.class) -public class ParserTest { - - @Test - public void parseAasEnvironmentTest() throws IOException, DeserializationException { - String aasEnvAsString = SerializerUtil.readResourceToString("example-from-serializer.jsonld"); - Environment aasEnv = new Serializer().read(aasEnvAsString); - Assert.assertEquals(1, aasEnv.getSubmodels().size()); - Assert.assertEquals(1, aasEnv.getAssetAdministrationShells().get(0).getDescription().size()); - Assert.assertEquals(2, aasEnv.getAssetAdministrationShells().get(0).getDisplayName().size()); - - Assert.assertEquals("de", aasEnv.getAssetAdministrationShells().get(0).getDisplayName().get(0).getLanguage()); - Assert.assertEquals("en", aasEnv.getAssetAdministrationShells().get(0).getDisplayName().get(1).getLanguage()); - Assert.assertNotNull(aasEnv.getAssetAdministrationShells().get(0).getDescription().get(0).getLanguage()); - - } - - @Test - @Ignore - public void parseFullTurtleEnvironmentTest() throws IOException, DeserializationException { - String aasEnvAsString = SerializerUtil.readResourceToString("AASFull.ttl"); - Environment environment = new Serializer().read(aasEnvAsString); - - // TODO continue providing a correct AASFull Turtle representation - // TODO test for LangStrings - Assert.assertEquals(AASFull.ENVIRONMENT, environment); - } - - - @Test - @Parameters({"AAS_Reference_shortExample.ttl", "AssetAdministrationShell_Example.ttl", - "Complete_Example.ttl", "ReferenceExample.ttl" /*, "KapitalVerwaltungsschaleExample.ttl"*/}) - public void parseAasTurtleSchemaExamplesTest(String file) throws IOException, DeserializationException { - Serializer serializer = new Serializer(); - - AssetAdministrationShell aas = serializer.deserialize(SerializerUtil.readResourceToString(file),AssetAdministrationShell.class, RDFLanguages.TURTLE); - - Assert.assertNotNull(aas.getAssetInformation().getAssetKind()); - } - - @Test - @Parameters({ "AAS_Reference_shortExample.nt", "Overall-Example.nt"}) - public void parseAasNtriplesSchemaExamplesTest(String file) throws IOException, DeserializationException { - Serializer serializer = new Serializer(); - - AssetAdministrationShell aas = serializer.deserialize(SerializerUtil.readResourceToString(file), AssetAdministrationShell.class, RDFLanguages.TURTLE); - - Assert.assertNotNull(aas.getAssetInformation().getAssetKind()); - } - - @Test - @Parameters({"Submodel_SubmodelElement_Example.ttl"}) - public void parseSubmodelSchemaExamplesTest(String file) throws IOException, DeserializationException { - Serializer serializer = new Serializer(); - //These work - - Submodel submodel = serializer.deserialize(SerializerUtil.readResourceToString(file), Submodel.class, RDFLanguages.TURTLE); - - Assert.assertNotNull(submodel.getSubmodelElements().get(0).getIdShort()); - - - //The following examples do not work yet, as they are semantically problematic - //serializer.deserialize(SerializerUtil.readResourceToString("Submodel_SubmodelElement_shortExample.ttl"), Reference.class, RDFLanguages.TURTLE); - //serializer.deserialize(SerializerUtil.readResourceToString("Submodel_SubmodelElement_shortExample.nt"), Reference.class, RDFLanguages.NTRIPLES); - } - - - - - @Test - public void deserializeConceptDescription() throws IOException, DeserializationException { - String conceptDescription = "{\n" + - " \"@context\" : {\n" + - " \"aas\" : \"https://admin-shell.io/aas/3/0/RC02/\",\n" + - " \"phys_unit\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/\",\n" + - " \"iec61360\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/\"\n" + - " },\n" + - " \"@id\" : \"https://admin-shell.io/autogen/DefaultConceptDescription/c6bd22b3-6487-49d2-a86d-e3834d22ceb9\",\n" + - " \"@type\" : \"aas:ConceptDescription\",\n" + - " \"isCaseOf\" : [ ],\n" + - " \"https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension\" : [ ],\n" + - " \"https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications\" : [ {\n" + - " \"@id\" : \"https://admin-shell.io/autogen/DefaultDataSpecification/f461858c-8981-4141-bac3-6aee56977017\",\n" + - " \"@type\" : \"aas:EmbeddedDataSpecification\",\n" + - " \"https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecifiation\" : {\n" + - " \"@id\" : \"https://admin-shell.io/autogen/DefaultReference/41ee5bcc-adde-4a5a-bfb5-ace237247d0c\",\n" + - " \"@type\" : \"aas:Reference\",\n" + - " \"https://admin-shell.io/aas/3/0/RC02/Reference/key\" : [ {\n" + - " \"@id\" : \"https://admin-shell.io/autogen/DefaultKey/234b457f-0e8f-46b3-8e73-f850a79269f1\",\n" + - " \"@type\" : \"aas:Key\",\n" + - " \"https://admin-shell.io/aas/3/0/RC02/Key/value\" : \"https://example.org\"\n" + - " } ]\n" + - " },\n" + - " \"https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent\" : {\n" + - " \"@id\" : \"https://admin-shell.io/autogen/DefaultDataSpecificationIEC61360/457288b3-77e1-474a-ab74-866bdcafd914\",\n" + - " \"@type\" : \"iec61360:DataSpecificationIEC61360\",\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType\" : {\n" + - " \"@type\" : \"https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360\",\n" + - " \"@id\" : \"https://admin-shell.io/aas/3/0/RC02/RATIONAL\"\n" + - " },\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition\" : [ ],\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName\" : [ ],\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName\" : [ ]\n" + - " },\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecification/id\" : \"http://example.org/DataSpecification1\"\n" + - " } ]\n" + - "}"; - - Serializer serializer = new Serializer(); - ConceptDescription c = serializer.deserialize(conceptDescription, ConceptDescription.class); - - Assert.assertNotNull(c); - } - - -} diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java deleted file mode 100644 index 2d7d56c03..000000000 --- a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.apache.jena.riot.RDFLanguages; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; - -import org.junit.Assert; -import org.junit.Test; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -public class SerializerTest { - - //TODO: Optional: Prefixes instead of full URIs - //TODO: Optional: Do not serialize empty collections - - @Test - public void serializeEnvironment() throws IOException, DeserializationException { - - AssetAdministrationShell aas = new DefaultAssetAdministrationShell.Builder() - .assetInformation(new DefaultAssetInformation.Builder() - .assetKind(AssetKind.INSTANCE) - .build()) - .description(Arrays.asList(new DefaultLangString.Builder().text("This is a test AAS").language("en-us").build())) - .displayName(Arrays.asList( - new DefaultLangString.Builder().text("Anzeigename 2").language("de").build(), - new DefaultLangString.Builder().text("Display Name 1").language("en").build() - )) - .build(); - - Submodel submodel = new DefaultSubmodel.Builder() - .description(Arrays.asList(new DefaultLangString.Builder().text("My Submodel").language("en-us").build())) - .displayName(Arrays.asList( - new DefaultLangString.Builder().text("First Submodel Element name").language("en").build(), - new DefaultLangString.Builder().text("Second Submodel Element name").language("en").build() - )) - .category("Example category") - .build(); - - ConceptDescription conceptDescription = new DefaultConceptDescription.Builder() - .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() - .dataSpecification(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .value("https://example.org") - .build()) - .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .dataType(DataTypeIEC61360.RATIONAL) - .build()) - .build()) - .build(); - - List aasList = new ArrayList<>(Collections.singletonList(aas)); - Environment aasEnv = new DefaultEnvironment.Builder() - .assetAdministrationShells(aasList) - .submodels(submodel) - .conceptDescriptions(conceptDescription) - .build(); - - String output = new Serializer().serialize(aasEnv, RDFLanguages.JSONLD); - //System.out.println(output); - - Assert.assertTrue(output.contains("@context")); - // Assert.assertTrue(output.contains("rdf:")); // TODO: why should the output contain the 'rdf' prefix? - Assert.assertTrue(output.contains("\"@type\" : \"aas:Environment\"")); - Assert.assertTrue(output.contains("\"@type\" : \"aas:AssetAdministrationShell\"")); - Assert.assertTrue(output.contains("\"@type\" : \"aas:Submodel\"")); - Assert.assertTrue(output.contains("\"@type\" : \"aas:ConceptDescription\"")); - - Environment environment = new Serializer().deserialize(output, Environment.class); - Assert.assertNotNull(environment); - - // Assert.assertTrue(aasEnv.equals(environment)); // TODO: Serialising and parsing to/from RDF looses the sequence of e.g. LangStrings, therefore this test fails also for semantically equal objects - } -} diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java deleted file mode 100644 index b738b7278..000000000 --- a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - - -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; - -import org.apache.commons.io.IOUtils; - -/** - * Helper class for Serializer Tests - * - * @author sbader - * - */ -public class SerializerUtil { - - public static String readResourceToString(String resourceName) throws IOException { - ClassLoader classloader = Thread.currentThread().getContextClassLoader(); - InputStream is = classloader.getResourceAsStream(resourceName); - StringWriter writer = new StringWriter(); - IOUtils.copy(is, writer, "UTF-8"); - return writer.toString(); - } - - public static String stripWhitespaces(String input) { - return input.replaceAll("\\s+", ""); - } - -} diff --git a/dataformat-rdf/src/test/resources/AASFull.ttl b/dataformat-rdf/src/test/resources/AASFull.ttl deleted file mode 100644 index 8c11c4546..000000000 --- a/dataformat-rdf/src/test/resources/AASFull.ttl +++ /dev/null @@ -1,354 +0,0 @@ -@prefix aas: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xs: . - -# AAS Environment - rdf:type aas:Environment ; - ; - ; - ; -. - - -# Asset Administration Shell - rdf:type aas:AssetAdministrationShell ; - "ExampleMotor"^^xs:string ; - rdfs:label "ExampleMotor"^^xs:string ; - "A very short description of the AAS instance"@en ; - rdfs:comment "A very short description of the AAS instance."^^xs:string ; - "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; - [ - rdf:type ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; - ] ; - ] ; - ; - ]; - - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ] - ]; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; - ] - ]; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^xs:string ; - ] - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "TechnicalData"^^xs:string ; - rdfs:label "TechnicalData"^^xs:string ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#01-AFZ615#016"^^xs:string ; - ] ; - ] ; - - - [ - rdf:type aas:Property ; - rdfs:label "MaxRotationSpeed"^^xs:string ; - "MaxRotationSpeed"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#02-BAA120#008"^^xs:string ; - ] ; - ]; - "5000"^^xs:string ; - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "OperationalData"^^xs:string ; - rdfs:label "OperationalData"^^xs:string ; - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; - ; - - [ - rdf:type aas:Property ; - rdfs:label "RotationSpeed"^^xs:string ; - "RotationSpeed"^^xs:string ; - ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://customer.com/cd/1/1/18EBD56F6B43D895"^^xs:string ; - ] - - ]; - "4370"^^xs:string ; - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "Documentation"^^xs:string ; - rdfs:label "Documentation"^^xs:string ; - " ; - [ - rdf:type aas:SubmodelElementList ; - "OperatingManual"^^xs:string ; - rdfs:label "OperatingManual"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; - ] - ] ; - ; - [ - rdf:type aas:SubmodelElementCollection ; - [ - rdf:type ; - rdf:subject ; - rdfs:label "Title"^^xs:string ; - "application/pdf" ; - "file:///aas/OperatingManual.pdf"^^xs:string ; # TODO - "Title"^^xs:string ; - "CONSTANT"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; - ] - ] ; - ; - ] - ]; - [ - rdf:type aas:SubmodelElementCollection ; - [ - rdf:type aas:File; - rdf:subject ; - rdfs:label "DigitalFile_PDF"^^xs:string ; - "application/pdf" ; - "file:///aasx/OperatingManual.pdf"^^xs:string ; - "DigitalFile_PDF"^^xs:string ; - "CONSTANT"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^xs:string ; - ] - ] ; - ; - ]; - ] ; - ; - ] ; -. - - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "MaxRotationSpeed"^^xs:string ; - rdfs:label "MaxRotationSpeed"^^xs:string ; - "PARAMETER"^^xs:string ; - "0173-1#02-BAA120#008"^^xs:string ; - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; -. - - rdf:type aas:DataSpecificationIEC61360 ; - "Max. rotation speed"@en, "max. Drehzahl"@de ; - "1/min"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#05-AAA650#002"^^xs:string ; - ] ; - ] ; - ; - "Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf"@de, "Greatest permissible rotation speed with which the motor or feeding unit may be operated"@en ; - . - - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "RotationSpeed"^^xs:string ; - rdfs:label "RotationSpeed"^^xs:string ; - "PROPERTY"^^xs:string ; - "https://customer.com/cd/18EBD56F6B43D895/RotationSpeed"^^xs:string ; - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] . - - rdf:type aas:DataSpecificationIEC61360 ; - "Actual rotation speed"@en, "Aktuelle Drehzahl"@de ; - "1/min"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#05-AAA650#002"^^xs:string ; - ] ; - ] ; - ; - "Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird."@de, "Actual rotation speed with which the motor or feeding unit is operated."@en ; -. - - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "Document"^^xs:string ; - rdfs:label "Document"^^xs:string ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; - - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; -. - - rdf:type aas:DataSpecificationIEC61360 ; - "Document"@en, "Dokument"@de ; - "Document"@en ; - "[ISO 15519-1:2010]"^^xs:string ; - ; - "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann."@de ; -. - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "Title"^^xs:string ; - rdfs:label "Title"^^xs:string ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; - - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; - . - - rdf:type aas:DataSpecificationIEC61360 ; - "Titel"@en, "Titel"@de ; - "Titel"@en ; - ; - "Sprachabhängiger Titel des Dokuments."@de ; -. - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "DigitalFile"^^xs:string ; - rdfs:label "DigitalFile"^^xs:string ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile"^^xs:string ; - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; -. - - - rdf:type aas:DataSpecificationIEC61360 ; - "Digital File"@en ; - "DigitalFile"@en ; - ; - "Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden."@de ; -. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt b/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt deleted file mode 100644 index 65b752bdc..000000000 --- a/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt +++ /dev/null @@ -1,16 +0,0 @@ - . - "ExampleMotor"^^ . - "ExampleMotor"^^ . - "A very short description of the AAS instance"@en . - "A very short description of the AAS instance."^^ . - "https://customer.com/aas/9175_7013_7091_9168"^^ . - _:AssetInformation . -_:AssetInformation . -_:AssetInformation _:GlobalAssetId . -_:AssetInformation . -_:GlobalAssetId . -_:GlobalAssetId . -_:GlobalAssetId _:Key . -_:Key . -_:Key . -_:Key "https://customer.com/assets/KHBVZJSQKIY"^^ . \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl b/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl deleted file mode 100644 index e22b250fd..000000000 --- a/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix : . -@prefix aas: . -@prefix rdf: . -@prefix rdfs: . -@prefix xs: . - - - rdf:type aas:AssetAdministrationShell ; - "ExampleMotor"^^xs:string ; - rdfs:label "ExampleMotor"^^xs:string ; - "A very short description of the AAS instance"@en ; - rdfs:comment "A very short description of the AAS instance."^^xs:string ; - "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; - [ - rdf:type ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; - ] ; - ] ; - ; - ]; -. diff --git a/dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl b/dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl deleted file mode 100644 index e5f25bfe6..000000000 --- a/dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl +++ /dev/null @@ -1,56 +0,0 @@ -@prefix aas: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xs: . - - -# Asset Administration Shell - rdf:type aas:AssetAdministrationShell ; - "ExampleMotor"^^xs:string ; - rdfs:label "ExampleMotor"^^xs:string ; - "A very short description of the AAS instance"@en ; - rdfs:comment "A very short description of the AAS instance."^^xs:string ; - "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; - [ - rdf:type ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; - ] ; - ] ; - ; - ]; - - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ] - ]; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; - ] - ]; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^xs:string ; - ] - ]; -. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Complete_Example.ttl b/dataformat-rdf/src/test/resources/Complete_Example.ttl deleted file mode 100644 index 0c800f8d1..000000000 --- a/dataformat-rdf/src/test/resources/Complete_Example.ttl +++ /dev/null @@ -1,347 +0,0 @@ -@prefix aas: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xs: . - - -# Asset Administration Shell - rdf:type aas:AssetAdministrationShell ; - "ExampleMotor"^^xs:string ; - rdfs:label "ExampleMotor"^^xs:string ; - "A very short description of the AAS instance"@en ; - rdfs:comment "A very short description of the AAS instance."^^xs:string ; - "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; - [ - rdf:type ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; - ] ; - ] ; - ; - ]; - - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ] - ]; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; - ] - ]; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^xs:string ; - ] - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "TechnicalData"^^xs:string ; - rdfs:label "TechnicalData"^^xs:string ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#01-AFZ615#016"^^xs:string ; - ] ; - ] ; - - - [ - rdf:type aas:Property ; - rdfs:label "MaxRotationSpeed"^^xs:string ; - "MaxRotationSpeed"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#02-BAA120#008"^^xs:string ; - ] ; - ]; - "5000"^^xs:string ; - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "OperationalData"^^xs:string ; - rdfs:label "OperationalData"^^xs:string ; - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; - ; - - [ - rdf:type aas:Property ; - rdfs:label "RotationSpeed"^^xs:string ; - "RotationSpeed"^^xs:string ; - ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://customer.com/cd/1/1/18EBD56F6B43D895"^^xs:string ; - ] - - ]; - "4370"^^xs:string ; - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "Documentation"^^xs:string ; - rdfs:label "Documentation"^^xs:string ; - " ; - [ - rdf:type aas:SubmodelElementList ; - "OperatingManual"^^xs:string ; - rdfs:label "OperatingManual"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; - ] - ] ; - ; - [ - rdf:type aas:SubmodelElementCollection ; - [ - rdf:type ; - rdf:subject ; - rdfs:label "Title"^^xs:string ; - "application/pdf" ; - "file:///aas/OperatingManual.pdf"^^xs:string ; # TODO - "Title"^^xs:string ; - "CONSTANT"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; - ] - ] ; - ; - ] - ]; - [ - rdf:type aas:SubmodelElementCollection ; - [ - rdf:type aas:File; - rdf:subject ; - rdfs:label "DigitalFile_PDF"^^xs:string ; - "application/pdf" ; - "file:///aasx/OperatingManual.pdf"^^xs:string ; - "DigitalFile_PDF"^^xs:string ; - "CONSTANT"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^xs:string ; - ] - ] ; - ; - ]; - ] ; - ; - ] ; -. - - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "MaxRotationSpeed"^^xs:string ; - rdfs:label "MaxRotationSpeed"^^xs:string ; - "PARAMETER"^^xs:string ; - "0173-1#02-BAA120#008"^^xs:string ; - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; -. - - rdf:type aas:DataSpecificationIEC61360 ; - "Max. rotation speed"@en, "max. Drehzahl"@de ; - "1/min"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#05-AAA650#002"^^xs:string ; - ] ; - ] ; - ; - "Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf"@de, "Greatest permissible rotation speed with which the motor or feeding unit may be operated"@en ; - . - - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "RotationSpeed"^^xs:string ; - rdfs:label "RotationSpeed"^^xs:string ; - "PROPERTY"^^xs:string ; - "https://customer.com/cd/18EBD56F6B43D895/RotationSpeed"^^xs:string ; - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] . - - rdf:type aas:DataSpecificationIEC61360 ; - "Actual rotation speed"@en, "Aktuelle Drehzahl"@de ; - "1/min"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#05-AAA650#002"^^xs:string ; - ] ; - ] ; - ; - "Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird."@de, "Actual rotation speed with which the motor or feeding unit is operated."@en ; -. - - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "Document"^^xs:string ; - rdfs:label "Document"^^xs:string ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; - - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; -. - - rdf:type aas:DataSpecificationIEC61360 ; - "Document"@en, "Dokument"@de ; - "Document"@en ; - "[ISO 15519-1:2010]"^^xs:string ; - ; - "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann."@de ; -. - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "Title"^^xs:string ; - rdfs:label "Title"^^xs:string ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; - - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; - . - - rdf:type aas:DataSpecificationIEC61360 ; - "Titel"@en, "Titel"@de ; - "Titel"@en ; - ; - "Sprachabhängiger Titel des Dokuments."@de ; -. - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "DigitalFile"^^xs:string ; - rdfs:label "DigitalFile"^^xs:string ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile"^^xs:string ; - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; -. - - - rdf:type aas:DataSpecificationIEC61360 ; - "Digital File"@en ; - "DigitalFile"@en ; - ; - "Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden."@de ; -. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Overall-Example.nt b/dataformat-rdf/src/test/resources/Overall-Example.nt deleted file mode 100644 index 3921c9aff..000000000 --- a/dataformat-rdf/src/test/resources/Overall-Example.nt +++ /dev/null @@ -1,253 +0,0 @@ - . - "ExampleMotor"^^ . - "ExampleMotor"^^ . - "A very short description of the AAS instance"@en . - "A very short description of the AAS instance."^^ . - "https://customer.com/aas/9175_7013_7091_9168"^^ . - _:AssetInformation . - _:Submodel1 . - _:Submodel2 . - _:Submodel3 . -_:AssetInformation . -_:AssetInformation _:GlobalAssetId1 . -_:AssetInformation . -_:GlobalAssetId1 . -_:GlobalAssetId1 . -_:GlobalAssetId1 _:Key1 . -_:Key1 . -_:Key1 . -_:Key1 "https://customer.com/assets/KHBVZJSQKIY"^^ . -_:Submodel1 . -_:Submodel1 . -_:Submodel1 _:Key2 . -_:Key2 . -_:Key2 . -_:Key2 "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^ . -_:Submodel2 . -_:Submodel2 . -_:Submodel2 _:Key3 . -_:Key3 . -_:Key3 . -_:Key3 "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^ . -_:Submodel3 . -_:Submodel3 . -_:Submodel3 _:Key4 . -_:Key4 . -_:Key4 . -_:Key4 "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^ . - . - "TechnicalData"^^ . - "TechnicalData"^^ . - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^ . - . - _:SemanticId1 . - _:SubmodelElement1 . -_:SemanticId1 . -_:SemanticId1 . -_:SemanticId1 _:Key5 . -_:Key5 . -_:Key5 . -_:Key5 "0173-1#01-AFZ615#016"^^ . -_:SubmodelElement1 . -_:SubmodelElement1 "MaxRotationSpeed"^^ . -_:SubmodelElement1 "MaxRotationSpeed"^^ . -_:SubmodelElement1 . -_:SubmodelElement1 _:ValueId1 . -_:SubmodelElement1 "5000"^^ . -_:ValueId1 . -_:ValueId1 . -_:ValueId1 _:Key6 . -_:Key6 . -_:Key6 . -_:Key6 "0173-1#02-BAA120#008"^^ . - . - "OperationalData"^^ . - "OperationalData"^^ . - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^ . - . - _:SubmodelElement2 . -_:SubmodelElement2 . -_:SubmodelElement2 "RotationSpeed"^^ . -_:SubmodelElement2 "RotationSpeed"^^ . -_:SubmodelElement2 . -_:SubmodelElement2 . -_:SubmodelElement2 _:ValueId2 . -_:SubmodelElement2 "4370"^^ . -_:ValueId2 . -_:ValueId2 . -_:ValueId2 _:Key7 . -_:Key7 . -_:Key7 . -_:Key7 "http://customer.com/cd/1/1/18EBD56F6B43D895"^^ . - . - "Documentation"^^ . - "Documentation"^^ . - " . - . - _:SubmodelElement3 . -_:SubmodelElement3 . -_:SubmodelElement3 "OperatingManual"^^ . -_:SubmodelElement3 "OperatingManual"^^ . -_:SubmodelElement3 _:SemanticIdListElement1 . -_:SubmodelElement3 . -_:SubmodelElement3 _:Value1 . -_:SubmodelElement3 _:Value3 . -_:SubmodelElement3 . -_:SemanticIdListElement1 . -_:SemanticIdListElement1 . -_:SemanticIdListElement1 _:Key8 . -_:Key8 . -_:Key8 . -_:Key8 "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^ . -_:Value1 . -_:Value1 _:Value2 . -_:Value2 . -_:Value2 . -_:Value2 "Title"^^ . -_:Value2 "application/pdf" . -_:Value2 "file:///aas/OperatingManual.pdf"^^ . -_:Value2 "Title"^^ . -_:Value2 "CONSTANT"^^ . -_:Value2 _:SemanticId2 . -_:Value2 . -_:SemanticId2 . -_:SemanticId2 . -_:SemanticId2 _:Key9 . -_:Key9 . -_:Key9 . -_:Key9 "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^ . -_:Value3 . -_:Value3 _:Value4 . -_:Value4 . -_:Value4 . -_:Value4 "DigitalFile_PDF"^^ . -_:Value4 "application/pdf" . -_:Value4 "file:///aasx/OperatingManual.pdf"^^ . -_:Value4 "DigitalFile_PDF"^^ . -_:Value4 "CONSTANT"^^ . -_:Value4 _:SemanticId3. -_:Value4 . -_:SemanticId3 . -_:SemanticId3 . -_:SemanticId3 _:Key10 . -_:Key10 . -_:Key10 . -_:Key10 "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^ . - . - "MaxRotationSpeed"^^ . - "MaxRotationSpeed"^^ . - "PARAMETER"^^ . - "0173-1#02-BAA120#008"^^ . - _:EmbeddedDataSpecification1 . -_:EmbeddedDataSpecification1 . -_:EmbeddedDataSpecification1 _:DataSpecification1 . -_:EmbeddedDataSpecification1 . -_:DataSpecification1 . -_:DataSpecification1 . -_:DataSpecification1 _:Key11 . -_:Key11 . -_:Key11 . -_:Key11 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . - . - "Max. rotation speed"@en . - "max. Drehzahl"@de . - "1/min"^^ . - _:UnitId1 . - . - "H\u00F6chste zul\u00E4ssige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf"@de . - "Greatest permissible rotation speed with which the motor or feeding unit may be operated"@en . -_:UnitId1 . -_:UnitId1 . -_:UnitId1 _:Key12 . -_:Key12 . -_:Key12 . -_:Key12 "0173-1#05-AAA650#002"^^ . - . - "RotationSpeed"^^ . - "RotationSpeed"^^ . - "PROPERTY"^^ . - "https://customer.com/cd/18EBD56F6B43D895/RotationSpeed"^^ . - _:EmbeddedDataSpecification2 . -_:EmbeddedDataSpecification2 . -_:EmbeddedDataSpecification2 _:DataSpecification2 . -_:EmbeddedDataSpecification2 . -_:DataSpecification2 . -_:DataSpecification2 . -_:DataSpecification2 _:Key13 . -_:Key13 . -_:Key13 . -_:Key13 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . - . - "Actual rotation speed"@en . - "Aktuelle Drehzahl"@de . - "1/min"^^ . - _:UnitId2 . - . - "Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird."@de . - "Actual rotation speed with which the motor or feeding unit is operated."@en . -_:UnitId2 . -_:UnitId2 . -_:UnitId2 _:Key14 . -_:Key14 . -_:Key14 . -_:Key14 "0173-1#05-AAA650#002"^^ . - . - "Document"^^ . - "Document"^^ . - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^ . - _:EmbeddedDataSpecification3 . -_:EmbeddedDataSpecification3 . -_:EmbeddedDataSpecification3 _:DataSpecification3 . -_:EmbeddedDataSpecification3 . -_:DataSpecification3 . -_:DataSpecification3 . -_:DataSpecification3 _:Key15 . -_:Key15 . -_:Key15 . -_:Key15 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . - . - "Document"@en . - "Dokument"@de . - "Document"@en . - "[ISO 15519-1:2010]"^^ . - . - "Feste und geordnete Menge von f\u00FCr die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann."@de . - . - "Title"^^ . - "Title"^^ . - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^ . - _:EmbeddedDataSpecification4 . -_:EmbeddedDataSpecification4 . -_:EmbeddedDataSpecification4 _:DataSpecification4 . -_:EmbeddedDataSpecification4 . -_:DataSpecification4 . -_:DataSpecification4 . -_:DataSpecification4 _:Key16 . -_:Key16 . -_:Key16 . -_:Key16 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . - . - "Titel"@en . - "Titel"@de . - "Titel"@en . - . - "Sprachabh\u00E4ngiger Titel des Dokuments."@de . - . - "DigitalFile"^^ . - "DigitalFile"^^ . - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile"^^ . - _:EmbeddedDataSpecification5 . -_:EmbeddedDataSpecification5 . -_:EmbeddedDataSpecification5 _:DataSpecification5 . -_:EmbeddedDataSpecification5 . -_:DataSpecification5 . -_:DataSpecification5 . -_:DataSpecification5 _:Key17 . -_:Key17 . -_:Key17 . -_:Key17 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . - . - "Digital File"@en . - "DigitalFile"@en . - . - "Eine Datei, die die DocumentVersion repr\u00E4sentiert. Neben der obligatorischen PDF/A Datei k\u00F6nnen weitere Dateien angegeben werden."@de . \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/ReferenceExample.ttl b/dataformat-rdf/src/test/resources/ReferenceExample.ttl deleted file mode 100644 index a18db83e5..000000000 --- a/dataformat-rdf/src/test/resources/ReferenceExample.ttl +++ /dev/null @@ -1,18 +0,0 @@ -@prefix xs: . - -# 1) Reference with KeyElements - a ; - [ - a ; - ; - [ - a ; - ; - [ - a ; - ; - "http://customer.com/assets/KHBVZJSQKIY"^^xs:string ; - ] - ] - ] ; -. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl deleted file mode 100644 index 3e50807d6..000000000 --- a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl +++ /dev/null @@ -1,137 +0,0 @@ -@prefix aas: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xs: . - - - -# Submodel - rdf:type aas:Submodel ; - "TechnicalData"^^xs:string ; - rdfs:label "TechnicalData"^^xs:string ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#01-AFZ615#016"^^xs:string ; - ] ; - ] ; - - - [ - rdf:type aas:Property ; - rdfs:label "MaxRotationSpeed"^^xs:string ; - "MaxRotationSpeed"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#02-BAA120#008"^^xs:string ; - ] ; - ]; - "5000"^^xs:string ; - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "OperationalData"^^xs:string ; - rdfs:label "OperationalData"^^xs:string ; - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; - ; - - [ - rdf:type aas:Property ; - rdfs:label "RotationSpeed"^^xs:string ; - "RotationSpeed"^^xs:string ; - ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://customer.com/cd/1/1/18EBD56F6B43D895"^^xs:string ; - ] - - ]; - "4370"^^xs:string ; - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "Documentation"^^xs:string ; - rdfs:label "Documentation"^^xs:string ; - " ; - [ - rdf:type aas:SubmodelElementList ; - "OperatingManual"^^xs:string ; - rdfs:label "OperatingManual"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; - ] - ] ; - ; - [ - rdf:type aas:SubmodelElementCollection ; - [ - rdf:type ; - rdf:subject ; - rdfs:label "Title"^^xs:string ; - "application/pdf" ; - "file:///aas/OperatingManual.pdf"^^xs:string ; # TODO - "Title"^^xs:string ; - "CONSTANT"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; - ] - ] ; - ; - ] - ]; - [ - rdf:type aas:SubmodelElementCollection ; - [ - rdf:type aas:File; - rdf:subject ; - rdfs:label "DigitalFile_PDF"^^xs:string ; - "application/pdf" ; - "file:///aasx/OperatingManual.pdf"^^xs:string ; - "DigitalFile_PDF"^^xs:string ; - "CONSTANT"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^xs:string ; - ] - ] ; - ; - ]; - ] ; - ; - ] ; -. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt deleted file mode 100644 index 2733f1131..000000000 --- a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt +++ /dev/null @@ -1,25 +0,0 @@ - . - "TechnicalData"^^ . - "TechnicalData"^^ . - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^ . - . - _:SemanticId . - _:SubmodelElements . -_:SemanticId . -_:SemanticId . -_:SemanticId _:Key1 . -_:Key1 . -_:Key1 . -_:Key1 "0173-1#01-AFZ615#016"^^ . -_:SubmodelElements . -_:SubmodelElements "MaxRotationSpeed"^^ . -_:SubmodelElements "MaxRotationSpeed"^^ . -_:SubmodelElements . -_:SubmodelElements _:ValueId . -_:SubmodelElements "5000"^^ . -_:ValueId . -_:ValueId . -_:ValueId _:Key2 . -_:Key2 . -_:Key2 . -_:Key2 "0173-1#02-BAA120#008"^^ . \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl deleted file mode 100644 index 9c1d7f8c4..000000000 --- a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix aas: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xs: . - - - -# Submodel - rdf:type aas:Submodel ; - "TechnicalData"^^xs:string ; - rdfs:label "TechnicalData"^^xs:string ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#01-AFZ615#016"^^xs:string ; - ] ; - ] ; - - - [ - rdf:type aas:Property ; - rdfs:label "MaxRotationSpeed"^^xs:string ; - "MaxRotationSpeed"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#02-BAA120#008"^^xs:string ; - ] ; - ]; - "5000"^^xs:string ; - ]; -. diff --git a/dataformat-rdf/src/test/resources/example-from-serializer.jsonld b/dataformat-rdf/src/test/resources/example-from-serializer.jsonld deleted file mode 100644 index 7eac7fa6c..000000000 --- a/dataformat-rdf/src/test/resources/example-from-serializer.jsonld +++ /dev/null @@ -1,88 +0,0 @@ -{ - "@context" : { - "aas" : "https://admin-shell.io/aas/3/0/RC02/" - }, - "@id" : "https://admin-shell.io/autogen/DefaultEnvironment/7e646a58-7419-41e2-99e8-163a7abb7b46", - "@type" : "aas:Environment", - "https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells" : [ { - "@id" : "https://admin-shell.io/autogen/DefaultAssetAdministrationShell/b869a629-8d69-4754-9c50-804b0e9eb35a", - "@type" : "aas:AssetAdministrationShell", - "https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation" : { - "@id" : "https://admin-shell.io/autogen/DefaultAssetInformation/6882a093-6831-445d-a884-f2ebc37aaa29", - "@type" : "aas:AssetInformation", - "https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind" : { - "@type" : "aas:AssetKind", - "@id" : "https://admin-shell.io/aas/3/0/RC02/AssetKind/Instance" - }, - "https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds" : [ ] - }, - "https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodel" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiation" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension" : [ ], - "https://admin-shell.io/aas/3/0/RC02/Referable/description" : [ { - "@language" : "en-us", - "@value" : "This is a test AAS" - } ], - "https://admin-shell.io/aas/3/0/RC02/Referable/displayName" : [ { - "@language" : "de", - "@value" : "Anzeigename 2" - }, { - "@language" : "en", - "@value" : "Display Name 1" - } ], - "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications" : [ ] - } ], - "https://admin-shell.io/aas/3/0/RC02/Environment/conceptdescriptions" : [ { - "@id" : "https://admin-shell.io/autogen/DefaultConceptDescription/14b4a819-7ca0-4cb2-b2c7-33a1c443c899", - "@type" : "aas:ConceptDescription", - "https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications" : [ { - "@id" : "https://admin-shell.io/autogen/DefaultDataSpecification/66cf9a6c-e656-4c95-91be-2ddc1779ec71", - "@type" : "aas:EmbeddedDataSpecification", - "https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecifiation" : { - "@id" : "https://admin-shell.io/autogen/DefaultReference/251d9f19-b36b-4c39-b517-3d7e93bd8c96", - "@type" : "aas:Reference", - "https://admin-shell.io/aas/3/0/RC02/Reference/key" : [ { - "@id" : "https://admin-shell.io/autogen/DefaultKey/ad4e8527-e002-4776-87ca-7049e7be440f", - "@type" : "aas:Key", - "https://admin-shell.io/aas/3/0/RC02/Key/value" : "https://example.org" - } ] - } , - "https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent" : { - "@id" : "https://admin-shell.io/autogen/DefaultDataSpecificationIEC61360/5319d62e-7ca1-4954-addf-76db6bf1e241", - "@type" : "aas:DataSpecificationIEC61360", - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType" : { - "@type" : "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/DataTypeIEC61360", - "@id" : "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/RATIONAL" - }, - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition" : [ ], - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName" : [ ], - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName" : [ ] - }, - "https://admin-shell.io/aas/3/0/RC02/DataSpecification/id" : "http://example.org/DataSpecification1" - } ] - } ], - "https://admin-shell.io/aas/3/0/RC02/Environment/submodels" : [ { - "@id" : "https://admin-shell.io/autogen/DefaultSubmodel/18810336-c309-42f8-9986-438f7068f0d6", - "@type" : "aas:Submodel", - "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiation" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds" : [ ], - "https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifier" : [ ], - "https://admin-shell.io/aas/3/0/RC02/Referable/category" : "Example category", - "https://admin-shell.io/aas/3/0/RC02/Referable/description" : [ { - "@language" : "en-us", - "@value" : "My Submodel" - } ], - "https://admin-shell.io/aas/3/0/RC02/Referable/displayName" : [ { - "@language" : "en", - "@value" : "First Submodel Element name" - }, { - "@language" : "en", - "@value" : "Second Submodel Element name" - } ], - "https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElement" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications" : [ ] - } ] -} \ No newline at end of file From a30a902fb7ff154ea230eccf1e26378635b3c22c Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Mon, 3 Jul 2023 15:02:29 +0200 Subject: [PATCH 13/59] fix compile errors --- .../core/DataSpecificationManager.java | 4 +- ...ministrationShellElementWalkerVisitor.java | 14 +- .../core/serialization/EnumSerializer.java | 4 +- ...ssetAdministrationShellElementVisitor.java | 4 +- ...ministrationShellElementWalkerVisitor.java | 10 +- .../aas4j/v3/dataformat/core/AASFull.java | 487 ++++++++---------- .../aas4j/v3/dataformat/core/AASSimple.java | 66 ++- .../v3/dataformat/core/CustomProperty.java | 21 +- .../dataformat/core/EnumDeserializerTest.java | 32 +- .../dataformat/core/EnumSerializerTest.java | 32 +- .../json/mixins/ConceptDescriptionMixin.java | 2 +- .../DataSpecificationIec61360Mixin.java | 2 +- .../json/JsonReferenceDeserializerTest.java | 6 +- .../v3/dataformat/json/TestDataHelper.java | 18 +- .../v3/dataformat/rdf/JsonLDSerializer.java | 2 +- .../aas4j/v3/dataformat/rdf/Serializer.java | 2 +- .../mixins/DataSpecificationContentMixin.java | 2 +- .../DataSpecificationIEC61360Mixin.java | 60 +-- .../EmbeddedDataSpecificationMixin.java | 6 +- .../aas4j/v3/dataformat/rdf/ParserTest.java | 16 +- .../v3/dataformat/rdf/SerializerTest.java | 6 +- ...mbeddedDataSpecificationsDeserializer.java | 12 +- .../DataSpecificationIec61360Mixin.java | 6 +- .../EmbeddedDataSpecificationMixin.java | 2 +- .../xml/mixins/HasSemanticsMixin.java | 2 +- .../dataformat/xml/mixins/PropertyMixin.java | 2 +- .../xml/mixins/SpecificAssetIDMixin.java | 2 +- .../xml/mixins/SubmodelElementListMixin.java | 2 +- .../EmbeddedDataSpecificationSerializer.java | 10 +- .../LangStringsNameTypeSerializer.java | 2 +- .../AssetAdministrationShellDescriptor.java | 8 +- .../aas4j/v3/model/AssetInformation.java | 4 +- .../v3/model/DataSpecificationContent.java | 2 +- .../v3/model/DataSpecificationIec61360.java | 84 +-- .../aas4j/v3/model/DataTypeIec61360.java | 42 +- .../digitaltwin/aas4j/v3/model/Entity.java | 4 +- .../digitaltwin/aas4j/v3/model/LevelType.java | 46 +- .../aas4j/v3/model/MultiLanguageProperty.java | 4 +- .../digitaltwin/aas4j/v3/model/Referable.java | 8 +- .../aas4j/v3/model/ReferenceTypes.java | 4 +- .../aas4j/v3/model/SubmodelDescriptor.java | 8 +- .../AnnotatedRelationshipElementBuilder.java | 4 +- .../AssetAdministrationShellBuilder.java | 8 +- ...tAdministrationShellDescriptorBuilder.java | 4 +- .../builder/AssetInformationBuilder.java | 2 +- .../builder/BasicEventElementBuilder.java | 8 +- .../aas4j/v3/model/builder/BlobBuilder.java | 8 +- .../v3/model/builder/CapabilityBuilder.java | 8 +- .../builder/ConceptDescriptionBuilder.java | 8 +- .../DataSpecificationIec61360Builder.java | 4 +- .../aas4j/v3/model/builder/EntityBuilder.java | 10 +- .../aas4j/v3/model/builder/FileBuilder.java | 8 +- .../builder/MultiLanguagePropertyBuilder.java | 12 +- .../v3/model/builder/OperationBuilder.java | 8 +- .../v3/model/builder/PropertyBuilder.java | 8 +- .../aas4j/v3/model/builder/RangeBuilder.java | 8 +- .../builder/ReferenceElementBuilder.java | 8 +- .../builder/RelationshipElementBuilder.java | 8 +- .../v3/model/builder/SubmodelBuilder.java | 8 +- .../builder/SubmodelDescriptorBuilder.java | 7 +- .../SubmodelElementCollectionBuilder.java | 8 +- .../builder/SubmodelElementListBuilder.java | 8 +- .../DefaultAnnotatedRelationshipElement.java | 12 +- .../impl/DefaultAssetAdministrationShell.java | 12 +- ...ultAssetAdministrationShellDescriptor.java | 12 +- .../model/impl/DefaultAssetInformation.java | 6 +- .../model/impl/DefaultBasicEventElement.java | 12 +- .../aas4j/v3/model/impl/DefaultBlob.java | 12 +- .../v3/model/impl/DefaultCapability.java | 12 +- .../model/impl/DefaultConceptDescription.java | 12 +- .../DefaultDataSpecificationIec61360.java | 50 +- .../aas4j/v3/model/impl/DefaultEntity.java | 18 +- .../aas4j/v3/model/impl/DefaultFile.java | 12 +- .../impl/DefaultMultiLanguageProperty.java | 18 +- .../aas4j/v3/model/impl/DefaultOperation.java | 12 +- .../aas4j/v3/model/impl/DefaultProperty.java | 12 +- .../aas4j/v3/model/impl/DefaultRange.java | 12 +- .../model/impl/DefaultReferenceElement.java | 12 +- .../impl/DefaultRelationshipElement.java | 12 +- .../aas4j/v3/model/impl/DefaultSubmodel.java | 12 +- .../model/impl/DefaultSubmodelDescriptor.java | 15 +- .../DefaultSubmodelElementCollection.java | 12 +- .../impl/DefaultSubmodelElementList.java | 12 +- .../v3/model/validator/TestAASc_006.java | 16 +- .../v3/model/validator/TestAASc_008.java | 10 +- .../v3/model/validator/TestAASd_067.java | 12 +- .../v3/model/validator/TestAASd_068.java | 16 +- .../v3/model/validator/TestAASd_069.java | 12 +- .../v3/model/validator/TestAASd_076.java | 8 +- .../v3/model/validator/TestAASd_65a.java | 24 +- .../v3/model/validator/TestAASd_66a.java | 10 +- 91 files changed, 792 insertions(+), 820 deletions(-) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java index 0db3ae12a..e1a214c87 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java @@ -39,11 +39,11 @@ public class DataSpecificationManager { public static final String PROP_DATA_SPECIFICATION = "dataSpecification"; public static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationContent"; - public static final String DATA_SPECIFICATION_IEC61360_IRI = "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0"; + public static final String DATA_SPECIFICATION_IEC61360_IRI = "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0"; public static final String DATA_SPECIFICATION_IEC61360_PREFIX = "IEC"; private static final Set KNOWN_IMPLEMENTATIONS = new HashSet<>(Arrays.asList( - // new DataSpecificationInfo(DataSpecificationIEC61360.class, + // new DataSpecificationInfo(DataSpecificationIec61360.class, // createGlobalIri(DATA_SPECIFICATION_IEC61360_IRI), // DATA_SPECIFICATION_IEC61360_PREFIX) )); diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java index f8229333e..90110b82c 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -72,7 +72,7 @@ public default void visit(ConceptDescription conceptDescription) { if (conceptDescription == null) { return; } - conceptDescription.getIsCaseOfs().forEach(x -> visit(x)); + conceptDescription.getIsCaseOf().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(conceptDescription); } @@ -127,7 +127,7 @@ public default void visit(MultiLanguageProperty multiLanguageProperty) { if (multiLanguageProperty == null) { return; } - multiLanguageProperty.getValues().forEach(x -> visit(x)); + multiLanguageProperty.getValue().forEach(x -> visit(x)); visit(multiLanguageProperty.getValueId()); AssetAdministrationShellElementVisitor.super.visit(multiLanguageProperty); } @@ -173,8 +173,8 @@ public default void visit(Referable referable) { if (referable == null) { return; } - referable.getDescriptions().forEach(x -> visit(x)); - referable.getDisplayNames().forEach(x -> visit(x)); + referable.getDescription().forEach(x -> visit(x)); + referable.getDisplayName().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(referable); } @@ -243,7 +243,7 @@ public default void visit(Entity entity) { if (entity == null) { return; } - entity.getSpecificAssetIds().forEach(x -> visit(x)); + visit(entity.getSpecificAssetId()); entity.getStatements().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(entity); } @@ -253,7 +253,7 @@ public default void visit(Extension extension) { if (extension == null) { return; } - extension.getRefersTos().forEach(x -> visit(x)); + visit(extension.getRefersTo()); AssetAdministrationShellElementVisitor.super.visit(extension); } @@ -282,7 +282,7 @@ public default void visit(SubmodelElementCollection submodelElementCollection) { if (submodelElementCollection == null) { return; } - submodelElementCollection.getValues().forEach(x -> visit(x)); + submodelElementCollection.getValue().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(submodelElementCollection); } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index c0f3631a5..a3583d770 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -24,7 +24,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; @@ -50,7 +50,7 @@ public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider String enum_string = AasUtils.serializeEnumName(value.name()); gen.writeString("xs:" + enum_string.substring(0, 1).toLowerCase() + enum_string.substring(1)); } - } else if (value instanceof DataTypeIEC61360 || value instanceof Direction || value instanceof StateOfEvent) { + } else if (value instanceof DataTypeIec61360 || value instanceof Direction || value instanceof StateOfEvent) { gen.writeString(value.name()); } else if (ReflectionHelper.ENUMS.contains(value.getClass())) { gen.writeString(AasUtils.serializeEnumName(value.name())); diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java index fc6f2af60..298f531f2 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java @@ -49,8 +49,8 @@ public default void visit(DataSpecificationContent dataSpecificationContent) { return; } Class type = dataSpecificationContent.getClass(); - // if (DataSpecificationIEC61360.class.isAssignableFrom(type)) { - // visit((DataSpecificationIEC61360) dataSpecificationContent); + // if (DataSpecificationIec61360.class.isAssignableFrom(type)) { + // visit((DataSpecificationIec61360) dataSpecificationContent); //} } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java index 9a1e53ad1..e4600c045 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -47,7 +47,7 @@ public default void visit(AssetInformation assetInformation) { if (assetInformation == null) { return; } - visit(assetInformation.getGlobalAssetId()); + //visit(assetInformation.getGlobalAssetId()); assetInformation.getSpecificAssetIds().forEach(x -> visit(x)); visit(assetInformation.getDefaultThumbnail()); AssetAdministrationShellElementVisitor.super.visit(assetInformation); @@ -129,7 +129,7 @@ public default void visit(MultiLanguageProperty multiLanguageProperty) { if (multiLanguageProperty == null) { return; } - multiLanguageProperty.getValue().forEach(x -> visit(x)); + //multiLanguageProperty.getValue().forEach(x -> visit(x)); visit(multiLanguageProperty.getValueId()); AssetAdministrationShellElementVisitor.super.visit(multiLanguageProperty); } @@ -175,8 +175,8 @@ public default void visit(Referable referable) { if (referable == null) { return; } - referable.getDescription().forEach(x -> visit(x)); - referable.getDisplayName().forEach(x -> visit(x)); + // referable.getDescription().forEach(x -> visit(x)); + // referable.getDisplayName().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(referable); } @@ -213,7 +213,7 @@ public default void visit(Entity entity) { if (entity == null) { return; } - visit(entity.getGlobalAssetId()); + //visit(entity.getGlobalAssetId()); visit(entity.getSpecificAssetId()); entity.getStatements().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(entity); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index e20d26153..3fa4dc987 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.Base64; +import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; @@ -41,14 +42,14 @@ public class AASFull { public final static ConceptDescription CONCEPT_DESCRIPTION_3 = createConceptDescription3(); public final static ConceptDescription CONCEPT_DESCRIPTION_4 = createConceptDescription4(); public static final Environment ENVIRONMENT = createEnvironment(); - public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"; + public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360"; public static AssetAdministrationShell createAAS1() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") .description(Arrays.asList( - new DefaultLangString.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_AssetAdministrationShell") .administration(new DefaultAdministrativeInformation.Builder() @@ -60,17 +61,11 @@ public static AssetAdministrationShell createAAS1() { .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) .value("https://acplt.org/TestAssetAdministrationShell2") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset") //.billOfMaterial((new DefaultReference.Builder() // .keys(new DefaultKey.Builder() // .type(KeyTypes.SUBMODEL) @@ -83,21 +78,21 @@ public static AssetAdministrationShell createAAS1() { .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -108,27 +103,21 @@ public static AssetAdministrationShell createAAS2() { .id("https://acplt.org/Test_AssetAdministrationShell_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset_Mandatory") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset_Mandatory") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel_Mandatory") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel2_Mandatory") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -139,13 +128,7 @@ public static AssetAdministrationShell createAAS3() { .id("https://acplt.org/Test_AssetAdministrationShell2_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset_Mandatory") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset_Mandatory") .build()) .build(); } @@ -154,8 +137,8 @@ public static AssetAdministrationShell createAAS4() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") .description(Arrays.asList( - new DefaultLangString.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_AssetAdministrationShell_Missing") .administration(new DefaultAdministrativeInformation.Builder() @@ -164,20 +147,14 @@ public static AssetAdministrationShell createAAS4() { .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset_Missing") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset_Missing") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel_Missing") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -186,8 +163,8 @@ public static Submodel createSubmodel1() { return new DefaultSubmodel.Builder() .idShort("Identification") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() )) .id("http://acplt.org/Submodels/Assets/TestAsset/Identification") .administration(new DefaultAdministrativeInformation.Builder() @@ -200,13 +177,13 @@ public static Submodel createSubmodel1() { .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/AssetIdentification") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultProperty.Builder() .idShort("ManufacturerName") .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -214,7 +191,7 @@ public static Submodel createSubmodel1() { .value("0173-1#02-AAO677#002") .build() ) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .value("100") @@ -233,14 +210,14 @@ public static Submodel createSubmodel1() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ACPLT") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultProperty.Builder() .idShort("InstanceId") .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -248,7 +225,7 @@ public static Submodel createSubmodel1() { .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build() ) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("978-8234-234-342") .valueType(DataTypeDefXsd.STRING) @@ -257,7 +234,7 @@ public static Submodel createSubmodel1() { .type(KeyTypes.GLOBAL_REFERENCE) .value("978-8234-234-342") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .build(); @@ -267,8 +244,8 @@ public static Submodel createSubmodel2() { return new DefaultSubmodel.Builder() .idShort("BillOfMaterial") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() )) .id("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .administration(new DefaultAdministrativeInformation.Builder() @@ -280,34 +257,34 @@ public static Submodel createSubmodel2() { .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/BillOfMaterial") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity") .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .statements(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("http://acplt.org/ValueId/ExampleValue2") .valueType(DataTypeDefXsd.STRING) @@ -316,22 +293,22 @@ public static Submodel createSubmodel2() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValue2") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .statements(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("http://acplt.org/ValueId/ExampleValueId") .valueType(DataTypeDefXsd.STRING) @@ -340,7 +317,7 @@ public static Submodel createSubmodel2() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .entityType(EntityType.CO_MANAGED_ENTITY) @@ -348,24 +325,18 @@ public static Submodel createSubmodel2() { .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity2") .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .entityType(EntityType.SELF_MANAGED_ENTITY) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset2") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset2") .build()) .build(); } @@ -374,8 +345,8 @@ public static Submodel createSubmodel3() { return new DefaultSubmodel.Builder() .idShort("TestSubmodel") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel") .administration(new DefaultAdministrativeInformation.Builder() @@ -388,21 +359,21 @@ public static Submodel createSubmodel3() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -439,15 +410,15 @@ public static Submodel createSubmodel3() { .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -492,30 +463,30 @@ public static Submodel createSubmodel3() { .kind(ModelingKind.TEMPLATE) .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() @@ -523,7 +494,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -533,15 +504,15 @@ public static Submodel createSubmodel3() { .idShort("ExampleProperty2") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() @@ -549,7 +520,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -559,15 +530,15 @@ public static Submodel createSubmodel3() { .idShort("ExampleProperty3") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() @@ -575,7 +546,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -585,15 +556,15 @@ public static Submodel createSubmodel3() { .idShort("ExampleCapability") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultBasicEventElement.Builder() @@ -602,15 +573,15 @@ public static Submodel createSubmodel3() { .direction(Direction.INPUT) .state(StateOfEvent.ON) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -633,30 +604,30 @@ public static Submodel createSubmodel3() { .category("PARAMETER") .orderRelevant(true) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() @@ -664,7 +635,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -672,41 +643,41 @@ public static Submodel createSubmodel3() { .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") .value(Arrays.asList( - new DefaultLangString.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), - new DefaultLangString.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleMultiLanguageValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .min("0") .max("100") @@ -717,28 +688,28 @@ public static Submodel createSubmodel3() { .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .contentType("application/pdf") .value(Base64.getDecoder().decode("AQIDBAU=")) @@ -747,15 +718,15 @@ public static Submodel createSubmodel3() { .idShort("ExampleFile") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example File object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("file:///TestFile.pdf") .contentType("application/pdf") @@ -764,15 +735,15 @@ public static Submodel createSubmodel3() { .idShort("ExampleReferenceElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -787,7 +758,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.PROPERTY) .value("ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .build()) @@ -944,8 +915,8 @@ public static Submodel createSubmodel6() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelMissing") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Missing") .kind(ModelingKind.INSTANCE) @@ -957,21 +928,21 @@ public static Submodel createSubmodel6() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1008,15 +979,15 @@ public static Submodel createSubmodel6() { .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1061,30 +1032,30 @@ public static Submodel createSubmodel6() { .kind(ModelingKind.TEMPLATE) .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1099,15 +1070,15 @@ public static Submodel createSubmodel6() { .idShort("ExampleProperty2") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1122,15 +1093,15 @@ public static Submodel createSubmodel6() { .idShort("ExampleProperty3") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1145,15 +1116,15 @@ public static Submodel createSubmodel6() { .idShort("ExampleCapability") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultBasicEventElement.Builder() @@ -1162,15 +1133,15 @@ public static Submodel createSubmodel6() { .direction(Direction.INPUT) .state(StateOfEvent.ON) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1185,7 +1156,7 @@ public static Submodel createSubmodel6() { .type(KeyTypes.PROPERTY) .value("ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultSubmodelElementList.Builder() @@ -1194,29 +1165,29 @@ public static Submodel createSubmodel6() { .orderRelevant(true) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1229,34 +1200,34 @@ public static Submodel createSubmodel6() { .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") .value(Arrays.asList( - new DefaultLangString.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), - new DefaultLangString.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .min("0") .max("100") @@ -1267,29 +1238,29 @@ public static Submodel createSubmodel6() { .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .contentType("application/pdf") .value(Base64.getDecoder().decode("AQIDBAU=")) @@ -1298,15 +1269,15 @@ public static Submodel createSubmodel6() { .idShort("ExampleFile") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example File object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("file:///TestFile.pdf") .contentType("application/pdf") @@ -1315,15 +1286,15 @@ public static Submodel createSubmodel6() { .idShort("ExampleReferenceElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1349,8 +1320,8 @@ public static Submodel createSubmodel7() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelTemplate") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Template") .kind(ModelingKind.TEMPLATE) @@ -1363,22 +1334,22 @@ public static Submodel createSubmodel7() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() @@ -1416,15 +1387,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() @@ -1463,15 +1434,15 @@ public static Submodel createSubmodel7() { .kind(ModelingKind.TEMPLATE) .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .inputVariables(new DefaultOperationVariable.Builder() @@ -1479,15 +1450,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .value(null) @@ -1499,15 +1470,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .value(null) @@ -1519,15 +1490,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .value(null) @@ -1539,15 +1510,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleCapability") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .build()) @@ -1557,15 +1528,15 @@ public static Submodel createSubmodel7() { .direction(Direction.OUTPUT) .state(StateOfEvent.OFF) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .observed(new DefaultReference.Builder() @@ -1589,15 +1560,15 @@ public static Submodel createSubmodel7() { .category("PARAMETER") .orderRelevant(true) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) @@ -1605,15 +1576,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .value(null) @@ -1623,15 +1594,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .build()) @@ -1639,15 +1610,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleRange") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .min(null) @@ -1658,15 +1629,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleRange2") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .min("0") @@ -1678,30 +1649,30 @@ public static Submodel createSubmodel7() { .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .contentType("application/pdf") @@ -1710,15 +1681,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleFile") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example File object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .value(null) @@ -1728,15 +1699,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleReferenceElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .build()) @@ -1745,15 +1716,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleSubmodelElementCollection2") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .build()) @@ -1764,8 +1735,8 @@ public static ConceptDescription createConceptDescription1() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example concept description for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_ConceptDescription") .administration(new DefaultAdministrativeInformation.Builder() @@ -1777,7 +1748,7 @@ public static ConceptDescription createConceptDescription1() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -1793,8 +1764,8 @@ public static ConceptDescription createConceptDescription3() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription1") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example concept description for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_ConceptDescription_Missing") .administration(new DefaultAdministrativeInformation.Builder() @@ -1817,22 +1788,22 @@ public static ConceptDescription createConceptDescription4() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() .dataSpecification(new DefaultReference.Builder() - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() .preferredName(Arrays.asList( new DefaultLangString.Builder().text("Test Specification").language("de").build(), new DefaultLangString.Builder().text("TestSpecification").language("en-us").build() )) - .dataType(DataTypeIEC61360.REAL_MEASURE) + .dataType(DataTypeIec61360.REAL_MEASURE) .definition(new DefaultLangString.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) .definition(new DefaultLangString.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) .shortName(new DefaultLangString.Builder().text("Test Spec").language("de").build()) @@ -1844,14 +1815,14 @@ public static ConceptDescription createConceptDescription4() { .value("http://acplt.org/Units/SpaceUnit") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") .symbol("SU") .valueFormat("string") .value("TEST") // .levelType(LevelType.MIN) - .levelType(LevelType.MAX) + .levelType(new DefaultLevelType.Builder().max(true).build()) .valueList(new DefaultValueList.Builder() .valueReferencePairs(new DefaultValueReferencePair.Builder() .value("http://acplt.org/ValueId/ExampleValueId") @@ -1860,7 +1831,7 @@ public static ConceptDescription createConceptDescription4() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) // TODO valueType? .build()) @@ -1871,7 +1842,7 @@ public static ConceptDescription createConceptDescription4() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId2") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) // TODO valueType? .build()) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index d48733dae..2347000a1 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -98,7 +98,7 @@ public class AASSimple { private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY = "VARIABLE"; private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE = "4370"; private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUETYPE = "integer"; - public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"; + public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360"; public AASSimple() { } @@ -120,13 +120,7 @@ public static AssetAdministrationShell createAAS() { .id(AAS_IDENTIFIER) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) .specificAssetIds(new DefaultSpecificAssetId.Builder() .name(EQUIPMENT_ID) .value(_538FD1B3_F99F_4A52_9C75_72E9FA921270) @@ -135,7 +129,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_ERP_012) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .specificAssetIds(new DefaultSpecificAssetId.Builder() @@ -146,7 +140,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_IO_T_1) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .defaultThumbnail(new DefaultResource.Builder() @@ -159,7 +153,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_TECHNICAL_DATA_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels( new DefaultReference.Builder() @@ -167,7 +161,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_OPERATIONAL_DATA_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels( new DefaultReference.Builder() @@ -175,7 +169,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_DOCUMENTATION_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -188,7 +182,7 @@ public static Submodel createSubmodelTechnicalData() { .type(KeyTypes.GLOBAL_REFERENCE) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.INSTANCE) .idShort(SUBMODEL_TECHNICAL_DATA_ID_SHORT) @@ -200,7 +194,7 @@ public static Submodel createSubmodelTechnicalData() { .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_PROPERTY) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_TECHNICAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_TECHNICAL_DATA_PROPERTY_CATEGORY) @@ -222,7 +216,7 @@ public static Submodel createSubmodelOperationalData() { .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_OPERATIONAL_DATA_SEMANTIC_ID_PROPERTY) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY) @@ -244,7 +238,7 @@ public static Submodel createSubmodelDocumentation() { .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_ID_SHORT) .value(new DefaultProperty.Builder() @@ -254,7 +248,7 @@ public static Submodel createSubmodelDocumentation() { .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT) .value(SUBMODEL_DOCUMENTATION_PROPERTY_VALUE) @@ -267,7 +261,7 @@ public static Submodel createSubmodelDocumentation() { .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_FILE_ID_SHORT) .contentType(SUBMODEL_DOCUMENTATION_FILE_contentType) @@ -289,16 +283,16 @@ public static ConceptDescription createConceptDescriptionTitle() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() .preferredName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) .preferredName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) .shortName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) .shortName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) + .dataType(DataTypeIec61360.STRING_TRANSLATABLE) .definition(new DefaultLangString.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) .build()) .build()) @@ -315,17 +309,17 @@ public static ConceptDescription createConceptDescriptionDigitalFile() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent( - new DefaultDataSpecificationIEC61360.Builder() + new DefaultDataSpecificationIec61360.Builder() .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) .shortName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) .shortName(new DefaultLangString.Builder().text(DIGITALE_DATEI).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.STRING) + .dataType(DataTypeIec61360.STRING) .definition(new DefaultLangString.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) .build()) .build()) @@ -347,9 +341,9 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() .preferredName(new DefaultLangString.Builder().text(MAX_DREHZAHL).language("de").build()) .preferredName(new DefaultLangString.Builder().text(MAX_ROTATIONSPEED).language("en").build()) .unit(_1_MIN) @@ -358,10 +352,10 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.REAL_MEASURE) + .dataType(DataTypeIec61360.REAL_MEASURE) .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) .build()) @@ -381,10 +375,10 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent( - new DefaultDataSpecificationIEC61360.Builder() + new DefaultDataSpecificationIec61360.Builder() .preferredName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) .preferredName(new DefaultLangString.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) .shortName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) @@ -395,10 +389,10 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.REAL_MEASURE) + .dataType(DataTypeIec61360.REAL_MEASURE) .definition(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) .definition(new DefaultLangString.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) .build()) @@ -416,15 +410,15 @@ public static ConceptDescription createConceptDescriptionDocument() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() .preferredName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) .shortName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) .shortName(new DefaultLangString.Builder().text(DOKUMENT).language("DE").build()) .unit("ExampleString") .sourceOfDefinition(ISO15519_1_2010) - .dataType(DataTypeIEC61360.STRING) + .dataType(DataTypeIec61360.STRING) .definition(new DefaultLangString.Builder().text(DOCUMENT_DEF).language("EN").build()) .build()) .build()) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java index d22adf747..3178bad56 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java @@ -16,14 +16,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.*; import java.util.List; import java.util.Objects; @@ -49,9 +42,9 @@ public class CustomProperty implements Property { protected String category; - protected List description; + protected List description; - protected List displayName; + protected List displayName; protected String idShort; @@ -130,12 +123,12 @@ final public void setCategory(String category) { } @Override - final public List getDescription() { + final public List getDescription() { return description; } @Override - final public void setDescription(List description) { + final public void setDescription(List description) { this.description = description; } @@ -150,12 +143,12 @@ public void setChecksum(String checksum) { } @Override - final public List getDisplayName() { + final public List getDisplayName() { return displayName; } @Override - final public void setDisplayName(List displayName) { + final public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java index efd6ef3a1..3ad801789 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import org.junit.Assert; @@ -41,21 +41,21 @@ public void setUp() { } @Test - public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { - assertDeserialization("BOOLEAN", DataTypeIEC61360.BOOLEAN); - assertDeserialization("DATE", DataTypeIEC61360.DATE); - assertDeserialization("INTEGER_CURRENCY", DataTypeIEC61360.INTEGER_CURRENCY); - assertDeserialization("INTEGER_COUNT", DataTypeIEC61360.INTEGER_COUNT); - assertDeserialization("INTEGER_MEASURE", DataTypeIEC61360.INTEGER_MEASURE); - assertDeserialization("RATIONAL", DataTypeIEC61360.RATIONAL); - assertDeserialization("RATIONAL_MEASURE", DataTypeIEC61360.RATIONAL_MEASURE); - assertDeserialization("REAL_COUNT", DataTypeIEC61360.REAL_COUNT); - assertDeserialization("REAL_MEASURE", DataTypeIEC61360.REAL_MEASURE); - assertDeserialization("STRING", DataTypeIEC61360.STRING); - assertDeserialization("STRING_TRANSLATABLE", DataTypeIEC61360.STRING_TRANSLATABLE); - assertDeserialization("TIME", DataTypeIEC61360.TIME); - assertDeserialization("TIMESTAMP", DataTypeIEC61360.TIMESTAMP); - assertDeserialization("IRI", DataTypeIEC61360.IRI); + public void whenSerializingEnum_usingDataTypeIec61360_shouldReturnUpperCase() { + assertDeserialization("BOOLEAN", DataTypeIec61360.BOOLEAN); + assertDeserialization("DATE", DataTypeIec61360.DATE); + assertDeserialization("INTEGER_CURRENCY", DataTypeIec61360.INTEGER_CURRENCY); + assertDeserialization("INTEGER_COUNT", DataTypeIec61360.INTEGER_COUNT); + assertDeserialization("INTEGER_MEASURE", DataTypeIec61360.INTEGER_MEASURE); + assertDeserialization("RATIONAL", DataTypeIec61360.RATIONAL); + assertDeserialization("RATIONAL_MEASURE", DataTypeIec61360.RATIONAL_MEASURE); + assertDeserialization("REAL_COUNT", DataTypeIec61360.REAL_COUNT); + assertDeserialization("REAL_MEASURE", DataTypeIec61360.REAL_MEASURE); + assertDeserialization("STRING", DataTypeIec61360.STRING); + assertDeserialization("STRING_TRANSLATABLE", DataTypeIec61360.STRING_TRANSLATABLE); + assertDeserialization("TIME", DataTypeIec61360.TIME); + assertDeserialization("TIMESTAMP", DataTypeIec61360.TIMESTAMP); + assertDeserialization("IRI", DataTypeIec61360.IRI); } @Test diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 422766102..23ebcab8f 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; @@ -51,21 +51,21 @@ public void setUp() throws Exception { } @Test - public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { - assertSerialization(DataTypeIEC61360.BOOLEAN, "BOOLEAN"); - assertSerialization(DataTypeIEC61360.DATE, "DATE"); - assertSerialization(DataTypeIEC61360.INTEGER_CURRENCY, "INTEGER_CURRENCY"); - assertSerialization(DataTypeIEC61360.INTEGER_COUNT, "INTEGER_COUNT"); - assertSerialization(DataTypeIEC61360.INTEGER_MEASURE, "INTEGER_MEASURE"); - assertSerialization(DataTypeIEC61360.RATIONAL, "RATIONAL"); - assertSerialization(DataTypeIEC61360.RATIONAL_MEASURE, "RATIONAL_MEASURE"); - assertSerialization(DataTypeIEC61360.REAL_COUNT, "REAL_COUNT"); - assertSerialization(DataTypeIEC61360.REAL_MEASURE, "REAL_MEASURE"); - assertSerialization(DataTypeIEC61360.STRING, "STRING"); - assertSerialization(DataTypeIEC61360.STRING_TRANSLATABLE, "STRING_TRANSLATABLE"); - assertSerialization(DataTypeIEC61360.TIME, "TIME"); - assertSerialization(DataTypeIEC61360.TIMESTAMP, "TIMESTAMP"); - assertSerialization(DataTypeIEC61360.IRI, "IRI"); + public void whenSerializingEnum_usingDataTypeIec61360_shouldReturnUpperCase() { + assertSerialization(DataTypeIec61360.BOOLEAN, "BOOLEAN"); + assertSerialization(DataTypeIec61360.DATE, "DATE"); + assertSerialization(DataTypeIec61360.INTEGER_CURRENCY, "INTEGER_CURRENCY"); + assertSerialization(DataTypeIec61360.INTEGER_COUNT, "INTEGER_COUNT"); + assertSerialization(DataTypeIec61360.INTEGER_MEASURE, "INTEGER_MEASURE"); + assertSerialization(DataTypeIec61360.RATIONAL, "RATIONAL"); + assertSerialization(DataTypeIec61360.RATIONAL_MEASURE, "RATIONAL_MEASURE"); + assertSerialization(DataTypeIec61360.REAL_COUNT, "REAL_COUNT"); + assertSerialization(DataTypeIec61360.REAL_MEASURE, "REAL_MEASURE"); + assertSerialization(DataTypeIec61360.STRING, "STRING"); + assertSerialization(DataTypeIec61360.STRING_TRANSLATABLE, "STRING_TRANSLATABLE"); + assertSerialization(DataTypeIec61360.TIME, "TIME"); + assertSerialization(DataTypeIec61360.TIMESTAMP, "TIMESTAMP"); + assertSerialization(DataTypeIec61360.IRI, "IRI"); } @Test diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java index 919c02f51..669c4cc58 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java @@ -24,7 +24,7 @@ public interface ConceptDescriptionMixin { @JsonProperty("isCaseOf") - public List getIsCaseOfs(); + public List getIsCaseOf(); @JsonProperty("isCaseOf") public void setIsCaseOfs(List isCaseOfs); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java index 67576b8cd..6df15ca74 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java @@ -25,7 +25,7 @@ import java.util.List; -public interface DataSpecificationIEC61360Mixin { +public interface DataSpecificationIec61360Mixin { @JsonProperty("levelType") public List getLevelTypes(); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java index 9ab226d17..fbcbdda00 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java @@ -19,7 +19,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.junit.Before; @@ -46,7 +46,7 @@ public void prepare() throws SerializationException { JsonSerializer serializer = new JsonSerializer(); reference_string = serializer.writeReference(AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId()); reference_list_string = serializer.writeReferences(AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels()); -// valueReferencePair_string = serializer.write(((DataSpecificationIEC61360) AASFull.ENVIRONMENT.getConceptDescriptions().get(3).getEmbeddedDataSpecifications().get(0).getDataSpecificationContent()).getValueList().getValueReferencePairs().get(0)); +// valueReferencePair_string = serializer.write(((DataSpecificationIec61360) AASFull.ENVIRONMENT.getConceptDescriptions().get(3).getEmbeddedDataSpecifications().get(0).getDataSpecificationContent()).getValueList().getValueReferencePairs().get(0)); } @@ -89,7 +89,7 @@ public void testDeserializeReferenceList() throws DeserializationException { List referenceList = deserializer.readReferences(reference_list_string); - assertTrue(referenceList.get(0).getType().equals(ReferenceTypes.GLOBAL_REFERENCE)); + assertTrue(referenceList.get(0).getType().equals(ReferenceTypes.EXTERNAL_REFERENCE)); } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java index 575dfb2da..a6d6d9c3f 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -13,12 +13,12 @@ public class TestDataHelper { public static final String DEFAULT_IDENTIFICATION = "identification"; public static final Reference DEFAULT_SEMANTIC_ID = - new DefaultReference.Builder().type(ReferenceTypes.GLOBAL_REFERENCE) + new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value("eClassDefaultSemanticId").build()) .build(); public static final EmbeddedDataSpecification DEFAULT_EMBEDDED_DATA_SPECIFICATION = new DefaultEmbeddedDataSpecification.Builder() - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder().build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder().build()) .dataSpecification(createGlobalReference("defaultEmbeddedDataSpecificationDataSpecificationValue")).build(); public static final AdministrativeInformation DEFAULT_ADMINISTRATIVE_INFORMATION = @@ -27,9 +27,9 @@ public class TestDataHelper { .revision("defaultAdministrativeInformationRevisionValue") .version("defaultAdministrativeInformationVersionValue").build(); - public static final List DEFAULT_DESCRIPTION = List.of(createLangString("en", "defaultDescription")); + public static final List DEFAULT_DESCRIPTION = List.of(createLangStringTextType("en", "defaultDescription")); - public static final List DEFAULT_DISPLAY_NAME = List.of(createLangString("en", "defaultDisplayName")); + public static final List DEFAULT_DISPLAY_NAME = List.of(createLangStringNameType("en", "defaultDisplayName")); public static final String DEFAULT_ID_SHORT = "defaultIdShort"; @@ -40,12 +40,20 @@ public static LangString createLangString(String langCode, String text) { return new DefaultLangString.Builder().language(langCode).text(text).build(); } + public static LangStringTextType createLangStringTextType(String langCode, String text) { + return new DefaultLangStringTextType.Builder().language(langCode).text(text).build(); + } + + public static LangStringNameType createLangStringNameType(String langCode, String text) { + return new DefaultLangStringNameType.Builder().language(langCode).text(text).build(); + } + public static Reference createReference(ReferenceTypes type, KeyTypes keyType, String value) { return new DefaultReference.Builder().type(type).keys(createKey(keyType, value)).build(); } public static Reference createGlobalReference(String value) { - return createReference(ReferenceTypes.GLOBAL_REFERENCE, KeyTypes.GLOBAL_REFERENCE, value); + return createReference(ReferenceTypes.EXTERNAL_REFERENCE, KeyTypes.GLOBAL_REFERENCE, value); } public static DefaultEndpoint.Builder createEndpointBuilder() { diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java index d59ef814d..0ce900ea3 100644 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java @@ -97,7 +97,7 @@ public void serializeWithType(Object bean, JsonGenerator gen, SerializerProvider private void filterContextWrtBean(Object bean, Map filteredContext) { //Some default entries for AAS filteredContext.put("aas", "https://admin-shell.io/aas/3/0/RC02/"); - //filteredContext.put("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/"); + //filteredContext.put("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/3/0/RC02/"); //filteredContext.put("phys_unit", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/"); if(bean == null || bean.getClass().getName().equals("com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl") || bean.getClass().getName().equals("org.apache.jena.ext.xerces.jaxp.datatype.XMLGregorianCalendarImpl") || bean.getClass() == BigInteger.class) return; // XMLGregorianCalendarImpl causes infinite recursion diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java index ebdf6c1cc..1a18c39e5 100644 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java @@ -73,7 +73,7 @@ public Serializer() { addKnownNamespace("owl", "http://www.w3.org/2002/07/owl#"); addKnownNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); addKnownNamespace("aas", "https://admin-shell.io/aas/3/0/RC02/"); - //addKnownNamespace("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/"); + //addKnownNamespace("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/3/0/RC02/"); //addKnownNamespace("phys_unit", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/"); } diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java index ecef45ebc..a6ef82bef 100644 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java @@ -27,7 +27,7 @@ @JsonTypeName("aas:DataSpecificationContent") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") @JsonSubTypes({ - @JsonSubTypes.Type(value = DataSpecificationIEC61360.class) + @JsonSubTypes.Type(value = DataSpecificationIec61360.class) }) public interface DataSpecificationContentMixin { diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java index 13c3b6aec..5d50519ea 100644 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java @@ -23,85 +23,85 @@ import java.util.List; -@JsonTypeName("aas:DataSpecificationIEC61360") +@JsonTypeName("aas:DataSpecificationIec61360") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface DataSpecificationIEC61360Mixin extends DataSpecificationContentMixin { +public interface DataSpecificationIec61360Mixin extends DataSpecificationContentMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") - public DataTypeIEC61360 getDataType(); + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType") + public DataTypeIec61360 getDataType(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") - public void setDataType(DataTypeIEC61360 dataType); + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType") + public void setDataType(DataTypeIec61360 dataType); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition") public List getDefinition(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition") public void setDefinitions(List definition); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType") public LevelType getLevelType(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType") public void setLevelType(LevelType levelType); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName") public List getPreferredName(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName") public void setPreferredName(List preferredName); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName") public List getShortName(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName") public void setShortName(List shortName); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition") public String getSourceOfDefinition(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition") public void setSourceOfDefinition(String sourceOfDefinition); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol") public String getSymbol(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol") public void setSymbol(String symbol); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit") public String getUnit(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit") public void setUnit(String unit); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId") public Reference getUnitId(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId") public void setUnitId(Reference unitId); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat") public String getValueFormat(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat") public void setValueFormat(String valueFormat); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value") public String getValue(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value") public void setValue(String value); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList") public ValueList getValueList(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList") public void setValueList(ValueList valueList); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueId") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueId") public Reference getValueId(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueId") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueId") public void setValueId(Reference valueId); } diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java index af4615037..9fab7b04c 100644 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -31,10 +31,10 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") public interface EmbeddedDataSpecificationMixin { @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") - public DataSpecificationIEC61360 getDataSpecificationContent(); + public DataSpecificationIec61360 getDataSpecificationContent(); @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") - public void setDataSpecificationContent(DataSpecificationIEC61360 dataSpecificationContent); + public void setDataSpecificationContent(DataSpecificationIec61360 dataSpecificationContent); @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") public Reference getDataSpecification(); diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java index 8d603f749..1d9a4f500 100644 --- a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java +++ b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java @@ -111,7 +111,7 @@ public void deserializeConceptDescription() throws IOException, DeserializationE " \"@context\" : {\n" + " \"aas\" : \"https://admin-shell.io/aas/3/0/RC02/\",\n" + " \"phys_unit\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/\",\n" + - " \"iec61360\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/\"\n" + + " \"iec61360\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/3/0/RC02/\"\n" + " },\n" + " \"@id\" : \"https://admin-shell.io/autogen/DefaultConceptDescription/c6bd22b3-6487-49d2-a86d-e3834d22ceb9\",\n" + " \"@type\" : \"aas:ConceptDescription\",\n" + @@ -130,15 +130,15 @@ public void deserializeConceptDescription() throws IOException, DeserializationE " } ]\n" + " },\n" + " \"https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent\" : {\n" + - " \"@id\" : \"https://admin-shell.io/autogen/DefaultDataSpecificationIEC61360/457288b3-77e1-474a-ab74-866bdcafd914\",\n" + - " \"@type\" : \"iec61360:DataSpecificationIEC61360\",\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType\" : {\n" + - " \"@type\" : \"https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360\",\n" + + " \"@id\" : \"https://admin-shell.io/autogen/DefaultDataSpecificationIec61360/457288b3-77e1-474a-ab74-866bdcafd914\",\n" + + " \"@type\" : \"iec61360:DataSpecificationIec61360\",\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType\" : {\n" + + " \"@type\" : \"https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360\",\n" + " \"@id\" : \"https://admin-shell.io/aas/3/0/RC02/RATIONAL\"\n" + " },\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition\" : [ ],\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName\" : [ ],\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName\" : [ ]\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition\" : [ ],\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName\" : [ ],\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName\" : [ ]\n" + " },\n" + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecification/id\" : \"http://example.org/DataSpecification1\"\n" + " } ]\n" + diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java index 2d7d56c03..244e98aa1 100644 --- a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java +++ b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java @@ -24,7 +24,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.junit.Assert; import org.junit.Test; @@ -70,8 +70,8 @@ public void serializeEnvironment() throws IOException, DeserializationException .value("https://example.org") .build()) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .dataType(DataTypeIEC61360.RATIONAL) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .dataType(DataTypeIec61360.RATIONAL) .build()) .build()) .build(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java index 45caad7c9..209c72ff3 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java @@ -25,10 +25,10 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DataSpecificationManager; import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; import java.io.IOException; import java.util.Collections; @@ -57,13 +57,13 @@ private JsonNode getReferenceNode(JsonParser parser, JsonNode node) throws JsonM private List createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { JsonNode nodeContent = node.get(DataSpecificationManager.PROP_DATA_SPECIFICATION_CONTENT); - JsonNode specificationNode = nodeContent.get("dataSpecificationIEC61360"); - DataSpecificationContent content = createDefaultDataSpecificationIEC61360FromNode(parser, specificationNode); + JsonNode specificationNode = nodeContent.get("DataSpecificationIec61360"); + DataSpecificationContent content = createDefaultDataSpecificationIec61360FromNode(parser, specificationNode); return Collections.singletonList(content); } - private DataSpecificationContent createDefaultDataSpecificationIEC61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { - return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIEC61360.class); + private DataSpecificationContent createDefaultDataSpecificationIec61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { + return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIec61360.class); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java index 7698c1926..a83d708ee 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java @@ -27,8 +27,8 @@ import java.util.List; @JsonPropertyOrder({"preferredName", "shortName", "unit", "unitId", "sourceOfDefinition", "symbol", "dataType", "definition", "valueFormat", "valueList", "value", "valueId", "levelType"}) -//@JacksonXmlRootElement(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationIec61360") -public interface DataSpecificationIEC61360Mixin { +//@JacksonXmlRootElement(namespace = AasXmlNamespaceContext.AAS_URI, localName = "DataSpecificationIec61360") +public interface DataSpecificationIec61360Mixin { @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") public List getDefinition(); @@ -82,6 +82,6 @@ public interface DataSpecificationIEC61360Mixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataType") @JsonSerialize(using = EnumSerializer.class) - public DataTypeIEC61360 getDataType(); + public DataTypeIec61360 getDataType(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java index 3b5bfe6fe..bc89c01f9 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java @@ -31,6 +31,6 @@ public interface EmbeddedDataSpecificationMixin { @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") @JsonSerialize(using = EmbeddedDataSpecificationSerializer.class) - public DataSpecificationIEC61360 getDataSpecificationContent(); + public DataSpecificationIec61360 getDataSpecificationContent(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java index 9bf5216df..5766c9532 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java @@ -18,7 +18,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.ReferencesDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java index 385e36446..7f9211a17 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java @@ -15,7 +15,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java index 3d9ee0220..2e815400d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java @@ -23,7 +23,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @JsonPropertyOrder({"hasSemantics", "name", "value", "externalSubjectId"}) -public interface SpecificAssetIdMixin { +public interface SpecificAssetIDMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "name") public String getName(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java index cbad40cc0..cc25e2ef6 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java @@ -19,7 +19,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java index aa99ff032..734b2b4af 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,12 +35,12 @@ * reference. */ // TODO: solve EmbeddedDataSpecifiction issue -public class EmbeddedDataSpecificationSerializer extends JsonSerializer { +public class EmbeddedDataSpecificationSerializer extends JsonSerializer { private static final Logger logger = LoggerFactory.getLogger(EmbeddedDataSpecificationSerializer.class); @Override - public void serialize(DataSpecificationIEC61360 data, JsonGenerator generator, SerializerProvider provider) + public void serialize(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider) throws IOException { if (data == null) { return; @@ -48,13 +48,13 @@ public void serialize(DataSpecificationIEC61360 data, JsonGenerator generator, S // generator.writeFieldName(PROP_DATA_SPECIFICATION_CONTENT); generator.writeStartObject(); // TODO: Add field name according to template type - generator.writeObjectField("dataSpecificationIec61360", data); + generator.writeObjectField("DataSpecificationIec61360", data); generator.writeEndObject(); } @Override - public void serializeWithType(DataSpecificationIEC61360 data, JsonGenerator generator, SerializerProvider provider, + public void serializeWithType(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider, TypeSerializer typedSerializer) throws IOException, JsonProcessingException { serialize(data, generator, provider); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java index b2ef9cc4a..5b2659d1a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java @@ -19,7 +19,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java index 124298da8..8fcb1be17 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java @@ -52,7 +52,7 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { * @return Returns the LangStringSet for the property description. */ @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description") - List getDescription(); + List getDescription(); /** * @@ -60,7 +60,7 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { * * @param description desired value for the property description. */ - void setDescription(List description); + void setDescription(List description); /** * @@ -69,7 +69,7 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { * @return Returns the LangStringSet for the property displayName. */ @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName") - List getDisplayName(); + List getDisplayName(); /** * @@ -77,7 +77,7 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { * * @param displayName desired value for the property displayName. */ - void setDisplayName(List displayName); + void setDisplayName(List displayName); /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java index 689bb3568..0664d8bed 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java @@ -77,7 +77,7 @@ public interface AssetInformation { * @return Returns the Reference for the property globalAssetId. */ @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") - Reference getGlobalAssetId(); + String getGlobalAssetId(); /** * Global identifier of the asset the AAS is representing. @@ -86,7 +86,7 @@ public interface AssetInformation { * * @param globalAssetId desired value for the property globalAssetId. */ - void setGlobalAssetId(Reference globalAssetId); + void setGlobalAssetId(String globalAssetId); /** * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java index 2bb5a92e7..2a5a59ae6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java @@ -26,7 +26,7 @@ * and meta information about the template itself. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DataSpecificationIEC61360.class), + @KnownSubtypes.Type(value = DataSpecificationIec61360.class), @KnownSubtypes.Type(value = DataSpecificationPhysicalUnit.class) }) public interface DataSpecificationContent { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java index 1848854db..1ab999fd6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java @@ -17,7 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; import java.util.List; @@ -27,43 +27,43 @@ * lists conformant to IEC 61360. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultDataSpecificationIEC61360.class) + @KnownSubtypes.Type(value = DefaultDataSpecificationIec61360.class) }) -public interface DataSpecificationIEC61360 extends DataSpecificationContent { +public interface DataSpecificationIec61360 extends DataSpecificationContent { /** * Data Type * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType * - * @return Returns the DataTypeIEC61360 for the property dataType. + * @return Returns the DataTypeIec61360 for the property dataType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") - DataTypeIEC61360 getDataType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType") + DataTypeIec61360 getDataType(); /** * Data Type * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType * * @param dataType desired value for the property dataType. */ - void setDataType(DataTypeIEC61360 dataType); + void setDataType(DataTypeIec61360 dataType); /** * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition * * @return Returns the List of LangStrings for the property definition. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition") List getDefinition(); /** * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition * * @param definition desired value for the property definition. */ @@ -72,17 +72,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Set of levels. * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType * * @return Returns the LevelType for the property levelType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType") LevelType getLevelType(); /** * Set of levels. * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType * * @param levelType desired value for the property levelType. */ @@ -92,18 +92,18 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { * Preferred name * * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName * * @return Returns the List of LangStrings for the property preferredName. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName") List getPreferredName(); /** * Preferred name * * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName * * @param preferredName desired value for the property preferredName. */ @@ -112,17 +112,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Short name * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName * * @return Returns the List of LangStrings for the property shortName. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName") List getShortName(); /** * Short name * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName * * @param shortName desired value for the property shortName. */ @@ -132,18 +132,18 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { * Source of definition * * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition * * @return Returns the String for the property sourceOfDefinition. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition") String getSourceOfDefinition(); /** * Source of definition * * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition * * @param sourceOfDefinition desired value for the property sourceOfDefinition. */ @@ -152,17 +152,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Symbol * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol * * @return Returns the String for the property symbol. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol") String getSymbol(); /** * Symbol * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol * * @param symbol desired value for the property symbol. */ @@ -171,17 +171,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Unit * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit * * @return Returns the String for the property unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit") String getUnit(); /** * Unit * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit * * @param unit desired value for the property unit. */ @@ -190,17 +190,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId * * @return Returns the Reference for the property unitId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId") Reference getUnitId(); /** * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId * * @param unitId desired value for the property unitId. */ @@ -209,17 +209,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Value * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value") String getValue(); /** * Value * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value * * @param value desired value for the property value. */ @@ -228,17 +228,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Value Format * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat * * @return Returns the String for the property valueFormat. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat") String getValueFormat(); /** * Value Format * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat * * @param valueFormat desired value for the property valueFormat. */ @@ -247,17 +247,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * List of allowed values * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList * * @return Returns the ValueList for the property valueList. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList") ValueList getValueList(); /** * List of allowed values * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList * * @param valueList desired value for the property valueList. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java index b78e2c83a..fd884386a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java @@ -22,129 +22,129 @@ /** */ -@IRI("aas:DataTypeIEC61360") -public enum DataTypeIEC61360 { +@IRI("aas:DataTypeIec61360") +public enum DataTypeIec61360 { /** * values containing the content of a file. Values may be binaries. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Blob") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Blob") BLOB, /** * values representing truth of logic or Boolean algebra (TRUE, FALSE) */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Boolean") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Boolean") BOOLEAN, /** * values containing a calendar date, conformant to ISO 8601:2004 Format yyyy-mm-dd Example from IEC * 61360-1:2017: "1999-05-31" is the [DATE] representation of: "31 May 1999". */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Date") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Date") DATE, /** * values containing an address to a file. The values are of type URI and can represent an absolute * or relative path. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/File") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/File") FILE, /** * Values containing string with any sequence of characters, using the syntax of HTML5 (see W3C * Recommendation 28:2014) */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Html") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Html") HTML, /** * values containing values of type INTEGER but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/IntegerCount") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/IntegerCount") INTEGER_COUNT, /** * values containing values of type INTEGER that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/IntegerCurrency") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/IntegerCurrency") INTEGER_CURRENCY, /** * values containing values that are measure of type INTEGER. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/IntegerMeasure") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/IntegerMeasure") INTEGER_MEASURE, /** * values conforming to ISO/IEC 11179 series global identifier sequences */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Irdi") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Irdi") IRDI, /** * values containing values of type STRING conformant to Rfc 3987 */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Iri") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Iri") IRI, /** * values containing values of type rational */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Rational") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Rational") RATIONAL, /** * values containing values of type rational. In addition such a value comes with a physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RationalMeasure") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RationalMeasure") RATIONAL_MEASURE, /** * values containing numbers that can be written as a terminating or non-terminating decimal; a * rational or irrational number but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RealCount") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RealCount") REAL_COUNT, /** * values containing values of type REAL that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RealCurrency") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RealCurrency") REAL_CURRENCY, /** * values containing values that are measures of type REAL. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RealMeasure") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RealMeasure") REAL_MEASURE, /** * values consisting of sequence of characters but cannot be translated into other languages */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/String") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/String") STRING, /** * values containing string but shall be represented as different string in different languages */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/StringTranslatable") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/StringTranslatable") STRING_TRANSLATABLE, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Time") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Time") TIME, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Timestamp") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Timestamp") TIMESTAMP; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java index 422cdb746..77ca80168 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java @@ -57,7 +57,7 @@ public interface Entity extends SubmodelElement { * @return Returns the Reference for the property globalAssetId. */ @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") - Reference getGlobalAssetId(); + String getGlobalAssetId(); /** * Global identifier of the asset the entity is representing. @@ -66,7 +66,7 @@ public interface Entity extends SubmodelElement { * * @param globalAssetId desired value for the property globalAssetId. */ - void setGlobalAssetId(Reference globalAssetId); + void setGlobalAssetId(String globalAssetId); /** * Reference to a specific asset ID representing a supplementary identifier of the asset represented diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java index e3ab34e5f..51b946890 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java @@ -23,26 +23,30 @@ /** */ @IRI("aas:LevelType") -public enum LevelType { - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Max") - MAX, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Min") - MIN, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Nom") - NOM, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Typ") - TYP; +public interface LevelType { + + + public boolean getMin(); + + + public void setMin(boolean min); + + + public boolean getNom(); + + + public void setNom(boolean nom); + + + public boolean getTyp(); + + + public void setTyp(boolean typ); + + + public boolean getMax(); + + + public void setMax(boolean max); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java index 3ab965e2d..6b91d51af 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java @@ -38,7 +38,7 @@ public interface MultiLanguageProperty extends DataElement { * @return Returns the List of LangStrings for the property value. */ @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") - List getValue(); + List getValue(); /** * The value of the property instance. @@ -47,7 +47,7 @@ public interface MultiLanguageProperty extends DataElement { * * @param value desired value for the property value. */ - void setValue(List value); + void setValue(List value); /** * Reference to the global unique ID of a coded value. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java index 87346d826..e0fd5497d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java @@ -80,7 +80,7 @@ public interface Referable extends HasExtensions { * @return Returns the List of LangStrings for the property description. */ @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - List getDescription(); + List getDescription(); /** * Description or comments on the element. @@ -89,7 +89,7 @@ public interface Referable extends HasExtensions { * * @param description desired value for the property description. */ - void setDescription(List description); + void setDescription(List description); /** * Display name. Can be provided in several languages. @@ -99,7 +99,7 @@ public interface Referable extends HasExtensions { * @return Returns the List of LangStrings for the property displayName. */ @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - List getDisplayName(); + List getDisplayName(); /** * Display name. Can be provided in several languages. @@ -108,7 +108,7 @@ public interface Referable extends HasExtensions { * * @param displayName desired value for the property displayName. */ - void setDisplayName(List displayName); + void setDisplayName(List displayName); /** * In case of identifiables this attribute is a short name of the element. In case of referable this diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java index fa65393f9..2f815c8a8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java @@ -29,8 +29,8 @@ public enum ReferenceTypes { /** * GlobalReference. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceTypes/GlobalReference") - GLOBAL_REFERENCE, + @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceTypes/ExternalReference") + EXTERNAL_REFERENCE, /** * ModelReference diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java index 83a51cfb4..b4173aa09 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java @@ -52,7 +52,7 @@ public interface SubmodelDescriptor extends Descriptor { * @return Returns the LangStringSet for the property description. */ @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description") - List getDescription(); + List getDescription(); /** * @@ -60,7 +60,7 @@ public interface SubmodelDescriptor extends Descriptor { * * @param description desired value for the property description. */ - void setDescription(List description); + void setDescription(List description); /** * @@ -69,7 +69,7 @@ public interface SubmodelDescriptor extends Descriptor { * @return Returns the LangStringSet for the property displayName. */ @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName") - List getDisplayName(); + List getDisplayName(); /** * @@ -77,7 +77,7 @@ public interface SubmodelDescriptor extends Descriptor { * * @param displayName desired value for the property displayName. */ - void setDisplayName(List displayName); + void setDisplayName(List displayName); /** * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java index ce53cdd63..995eeabd7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java @@ -187,7 +187,7 @@ public B idShort(String idShort) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -198,7 +198,7 @@ public B displayName(List displayName) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java index 4bd31ea8d..12cf93d6f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java @@ -139,7 +139,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -150,7 +150,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -161,7 +161,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -172,7 +172,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java index 2a4ba9612..950eb0017 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java @@ -39,7 +39,7 @@ public B administration(AdministrativeInformation administration) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -50,7 +50,7 @@ public B description(List description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java index 8ef76deb5..5e56f3aa1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java @@ -51,7 +51,7 @@ public B defaultThumbnail(Resource defaultThumbnail) { * @param globalAssetId desired value to be set * @return Builder object with new value for globalAssetId */ - public B globalAssetId(Reference globalAssetId) { + public B globalAssetId(String globalAssetId) { getBuildingInstance().setGlobalAssetId(globalAssetId); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java index 6a3d80774..142160c2e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java @@ -205,7 +205,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -216,7 +216,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -227,7 +227,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -238,7 +238,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java index f31291130..cc3569b14 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java @@ -138,7 +138,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -149,7 +149,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -160,7 +160,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -171,7 +171,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java index 2fcf75982..9fef383bd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java @@ -116,7 +116,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -127,7 +127,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -138,7 +138,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -149,7 +149,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java index 68dee27fb..3977d3764 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java @@ -117,7 +117,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -128,7 +128,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -139,7 +139,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -150,7 +150,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java index a37a1b854..e48eca4ec 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java @@ -20,7 +20,7 @@ import java.util.List; -public abstract class DataSpecificationIEC61360Builder> +public abstract class DataSpecificationIec61360Builder> extends ExtendableBuilder { /** @@ -29,7 +29,7 @@ public abstract class DataSpecificationIEC61360Builder description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -182,7 +182,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -193,7 +193,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -204,7 +204,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java index e8585a2da..28fae5424 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java @@ -138,7 +138,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -149,7 +149,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -160,7 +160,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -171,7 +171,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java index 8e00bcb14..0a6a178fc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java @@ -29,7 +29,7 @@ public abstract class MultiLanguagePropertyBuilder value) { + public B value(List value) { getBuildingInstance().setValue(value); return getSelf(); } @@ -40,7 +40,7 @@ public B value(List value) { * @param value desired value to be added * @return Builder object with new value for value */ - public B value(LangString value) { + public B value(LangStringTextType value) { getBuildingInstance().getValue().add(value); return getSelf(); } @@ -150,7 +150,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -161,7 +161,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -172,7 +172,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -183,7 +183,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java index 7ab8280cb..d54a79149 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java @@ -182,7 +182,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -193,7 +193,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -204,7 +204,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -215,7 +215,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java index fb89de487..de36ed0dd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java @@ -149,7 +149,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -160,7 +160,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -171,7 +171,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -182,7 +182,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java index 35472b5f4..35a2a059a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java @@ -149,7 +149,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -160,7 +160,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -171,7 +171,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -182,7 +182,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java index e7eabbeec..04c10f8e4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java @@ -128,7 +128,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -139,7 +139,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -150,7 +150,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -161,7 +161,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java index b5fa9c32b..90dc6d0b1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java @@ -139,7 +139,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -150,7 +150,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -161,7 +161,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -172,7 +172,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java index a4a25425c..1bc4b9a66 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java @@ -116,7 +116,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -127,7 +127,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -138,7 +138,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -149,7 +149,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java index 76f32ed66..178fcb391 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java @@ -19,7 +19,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; @@ -43,7 +44,7 @@ public B administration(AdministrativeInformation administration) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -54,7 +55,7 @@ public B description(List description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java index dbaa9905b..fb37809e6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java @@ -140,7 +140,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -151,7 +151,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -162,7 +162,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -173,7 +173,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java index f677a5553..cabcd023c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java @@ -183,7 +183,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -194,7 +194,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -205,7 +205,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -216,7 +216,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java index b92558245..902dac60a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java @@ -63,10 +63,10 @@ public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshi protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -219,22 +219,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java index ffc80b112..cd4830dff 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java @@ -61,10 +61,10 @@ public class DefaultAssetAdministrationShell implements AssetAdministrationShell protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -195,22 +195,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java index 998f3dd4e..634590eab 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java @@ -33,10 +33,10 @@ public class DefaultAssetAdministrationShellDescriptor implements AssetAdministr protected AdministrativeInformation administration; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description") - protected List description; + protected List description; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName") - protected List displayName; + protected List displayName; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort") protected String idShort; @@ -103,22 +103,22 @@ public void setAdministration(AdministrativeInformation administration) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java index 9b31fb191..a3f9112aa 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java @@ -41,7 +41,7 @@ public class DefaultAssetInformation implements AssetInformation { protected Resource defaultThumbnail; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") - protected Reference globalAssetId; + protected String globalAssetId; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") protected List specificAssetIds = new ArrayList<>(); @@ -96,12 +96,12 @@ public void setDefaultThumbnail(Resource defaultThumbnail) { } @Override - public Reference getGlobalAssetId() { + public String getGlobalAssetId() { return globalAssetId; } @Override - public void setGlobalAssetId(Reference globalAssetId) { + public void setGlobalAssetId(String globalAssetId) { this.globalAssetId = globalAssetId; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java index 7cdf7feb7..25616f747 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java @@ -82,10 +82,10 @@ public class DefaultBasicEventElement implements BasicEventElement { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -292,22 +292,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index 682d2d09d..47e6fca08 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -66,10 +66,10 @@ public class DefaultBlob implements Blob { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -206,22 +206,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java index 0a2a528a0..2201e9b54 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java @@ -59,10 +59,10 @@ public class DefaultCapability implements Capability { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -173,22 +173,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java index d0b7fcbb6..cbf4079e2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java @@ -56,10 +56,10 @@ public class DefaultConceptDescription implements ConceptDescription { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -168,22 +168,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java index 7c26835ce..4b97ea5e2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java @@ -17,7 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationIEC61360Builder; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationIec61360Builder; import java.util.ArrayList; import java.util.List; @@ -26,52 +26,52 @@ /** * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360 + * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360 * * Content of data specification template for concept descriptions for properties, values and value * lists conformant to IEC 61360. */ -@IRI("aas:DataSpecificationIEC61360") -public class DefaultDataSpecificationIEC61360 implements DataSpecificationIEC61360 { +@IRI("aas:DataSpecificationIec61360") +public class DefaultDataSpecificationIec61360 implements DataSpecificationIec61360 { - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") - protected DataTypeIEC61360 dataType; + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType") + protected DataTypeIec61360 dataType; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition") protected List definition = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType") protected LevelType levelType; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName") protected List preferredName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName") protected List shortName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition") protected String sourceOfDefinition; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol") protected String symbol; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit") protected String unit; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId") protected Reference unitId; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat") protected String valueFormat; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList") protected ValueList valueList; - public DefaultDataSpecificationIEC61360() { + public DefaultDataSpecificationIec61360() { } @@ -100,7 +100,7 @@ public boolean equals(Object obj) { } else if (this.getClass() != obj.getClass()) { return false; } else { - DefaultDataSpecificationIEC61360 other = (DefaultDataSpecificationIEC61360) obj; + DefaultDataSpecificationIec61360 other = (DefaultDataSpecificationIec61360) obj; return Objects.equals(this.dataType, other.dataType) && Objects.equals(this.definition, other.definition) && Objects.equals(this.levelType, other.levelType) && @@ -117,12 +117,12 @@ public boolean equals(Object obj) { } @Override - public DataTypeIEC61360 getDataType() { + public DataTypeIec61360 getDataType() { return dataType; } @Override - public void setDataType(DataTypeIEC61360 dataType) { + public void setDataType(DataTypeIec61360 dataType) { this.dataType = dataType; } @@ -237,9 +237,9 @@ public void setValueList(ValueList valueList) { } /** - * This builder class can be used to construct a DefaultDataSpecificationIEC61360 bean. + * This builder class can be used to construct a DefaultDataSpecificationIec61360 bean. */ - public static class Builder extends DataSpecificationIEC61360Builder { + public static class Builder extends DataSpecificationIec61360Builder { @Override protected Builder getSelf() { @@ -247,8 +247,8 @@ protected Builder getSelf() { } @Override - protected DefaultDataSpecificationIEC61360 newBuildingInstance() { - return new DefaultDataSpecificationIEC61360(); + protected DefaultDataSpecificationIec61360 newBuildingInstance() { + return new DefaultDataSpecificationIec61360(); } } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java index 979271811..7c50e9497 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java @@ -37,7 +37,7 @@ public class DefaultEntity implements Entity { protected EntityType entityType; @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") - protected Reference globalAssetId; + protected String globalAssetId; @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") protected SpecificAssetId specificAssetId; @@ -70,10 +70,10 @@ public class DefaultEntity implements Entity { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -142,12 +142,12 @@ public void setEntityType(EntityType entityType) { } @Override - public Reference getGlobalAssetId() { + public String getGlobalAssetId() { return globalAssetId; } @Override - public void setGlobalAssetId(Reference globalAssetId) { + public void setGlobalAssetId(String globalAssetId) { this.globalAssetId = globalAssetId; } @@ -232,22 +232,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java index 543eafd41..07fbdc6ae 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java @@ -64,10 +64,10 @@ public class DefaultFile implements File { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -204,22 +204,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java index 0bdc7638a..f145a7e5d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java @@ -49,7 +49,7 @@ public class DefaultMultiLanguageProperty implements MultiLanguageProperty { protected List supplementalSemanticIds = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") - protected List value = new ArrayList<>(); + protected List value = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") protected Reference valueId; @@ -64,10 +64,10 @@ public class DefaultMultiLanguageProperty implements MultiLanguageProperty { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -124,12 +124,12 @@ public boolean equals(Object obj) { } @Override - public List getValue() { + public List getValue() { return value; } @Override - public void setValue(List value) { + public void setValue(List value) { this.value = value; } @@ -204,22 +204,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java index fe8d5e818..570604091 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java @@ -67,10 +67,10 @@ public class DefaultOperation implements Operation { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -217,22 +217,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java index a83c00054..29a8c7c06 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java @@ -67,10 +67,10 @@ public class DefaultProperty implements Property { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -219,22 +219,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java index 1b1b12f53..ce1dcb808 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java @@ -67,10 +67,10 @@ public class DefaultRange implements Range { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -219,22 +219,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java index 23c2f26da..730521770 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java @@ -59,10 +59,10 @@ public class DefaultReferenceElement implements ReferenceElement { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -190,22 +190,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java index 99361ba3c..31ce95a0c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java @@ -59,10 +59,10 @@ public class DefaultRelationshipElement implements RelationshipElement { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -203,22 +203,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java index a1e816feb..1eb569d42 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java @@ -64,10 +64,10 @@ public class DefaultSubmodel implements Submodel { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -187,22 +187,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java index 580519f78..0c40ea39d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java @@ -21,7 +21,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; @@ -37,10 +38,10 @@ public class DefaultSubmodelDescriptor implements SubmodelDescriptor { protected AdministrativeInformation administration; @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description") - protected List description; + protected List description; @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName") - protected List displayName; + protected List displayName; @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort") protected String idShort; @@ -96,22 +97,22 @@ public void setAdministration(AdministrativeInformation administration) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java index 5713fbe6b..9db7dacce 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java @@ -61,10 +61,10 @@ public class DefaultSubmodelElementCollection implements SubmodelElementCollecti protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -190,22 +190,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java index d81d64b4d..631726d88 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java @@ -58,10 +58,10 @@ public class DefaultSubmodelElementList implements SubmodelElementList { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -248,22 +248,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_006.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_006.java index 1a0f04aab..6afccaaf8 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_006.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_006.java @@ -23,8 +23,8 @@ *

* For a ConceptDescription with category DOCUMENT using data specification * template IEC61360 - * (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0) - * - DataSpecificationIEC61360/dataType shall be one of the following values: + * (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0) + * - DataSpecificationIec61360/dataType shall be one of the following values: * STRING or URL. *

* @@ -37,37 +37,37 @@ public class TestAASc_006 { /* @Test public void correctDataTypeURL() throws ValidationException, IOException { - ConceptDescription correctURLCD = createConceptDescription(DataTypeIEC61360.URL); + ConceptDescription correctURLCD = createConceptDescription(DataTypeIec61360.URL); ShaclValidator.getInstance().validate(correctURLCD); } @Test public void wrongDataType() { - ConceptDescription wrongCD = createConceptDescription(DataTypeIEC61360.DATE); + ConceptDescription wrongCD = createConceptDescription(DataTypeIec61360.DATE); try { ShaclValidator.getInstance().validate(wrongCD); fail(); } catch (ValidationException e) { assertTrue(e.getMessage().endsWith( - "For a ConceptDescription with category DOCUMENT using data specification template IEC61360 (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0) - DataSpecificationIEC61360/dataType shall be one of the following values: String or URL.")); + "For a ConceptDescription with category DOCUMENT using data specification template IEC61360 (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0) - DataSpecificationIec61360/dataType shall be one of the following values: String or URL.")); } } @Test public void correctDataTypeString() throws ValidationException { - ConceptDescription correctStringCD = createConceptDescription(DataTypeIEC61360.STRING); + ConceptDescription correctStringCD = createConceptDescription(DataTypeIec61360.STRING); ShaclValidator.getInstance().validate(correctStringCD); } - private ConceptDescription createConceptDescription(DataTypeIEC61360 dataType) { + private ConceptDescription createConceptDescription(DataTypeIec61360 dataType) { ConceptDescription correctURLCD = ConstraintTestHelper.createConceptDescription("idShort1", "conceptDescriptionURL", "DOCUMENT"); - DataSpecificationIEC61360 urlDataTypeDS = new DefaultDataSpecificationIEC61360.Builder() + DataSpecificationIec61360 urlDataTypeDS = new DefaultDataSpecificationIec61360.Builder() .preferredName(new LangString("ds", "en")).definition(new LangString("some english definition", "EN")) .dataType(dataType).build(); diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_008.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_008.java index d5a07baa7..7a975148b 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_008.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_008.java @@ -31,8 +31,8 @@ *

* For all ConceptDescriptions except for ConceptDescriptions of category * VALUE using data specification template IEC61360 - * (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0) - * - DataSpecificationIEC61360/definition is mandatory and shall be defined at + * (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0) + * - DataSpecificationIec61360/definition is mandatory and shall be defined at * least in English. *

* @@ -60,7 +60,7 @@ public void conceptDescriptionNoEnglishDefinition() { } catch (ValidationException e) { System.out.println(e.getMessage()); assertTrue(e.getMessage().endsWith( - "For all ConceptDescriptions except for ConceptDescriptions of category VALUE using data specification template IEC61360 (https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition) - DataSpecificationIEC61360/definition is mandatory and shall be defined at least in English.")); + "For all ConceptDescriptions except for ConceptDescriptions of category VALUE using data specification template IEC61360 (https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition) - DataSpecificationIec61360/definition is mandatory and shall be defined at least in English.")); } } @@ -84,11 +84,11 @@ private ConceptDescription createConceptDescription(LangString definition) { ConceptDescription cd = ConstraintTestHelper.createConceptDescription("idShort1", "id", "QUALIFIER"); - DataSpecificationIEC61360 urlDataTypeDS = new DefaultDataSpecificationIEC61360.Builder() + DataSpecificationIec61360 urlDataTypeDS = new DefaultDataSpecificationIec61360.Builder() .preferredName(new DefaultLangString.Builder().language("en").text("ds").build()) .definition(definition) .definition(new DefaultLangString.Builder().language("de").text("test").build()) - .dataType(DataTypeIEC61360.IRI) + .dataType(DataTypeIec61360.IRI) .build(); EmbeddedDataSpecification urlDataTypeEDS = new DefaultEmbeddedDataSpecification.Builder() diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_067.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_067.java index 2c1f20f48..7c689b9cb 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_067.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_067.java @@ -31,7 +31,7 @@ * Tests the following constraint: *

* If the semanticId of a MultiLanguageProperty references a ConceptDescription then - * DataSpecificationIEC61360/dataType shall be STRING_TRANSLATABLE. + * DataSpecificationIec61360/dataType shall be STRING_TRANSLATABLE. *

* * @author bader, chang @@ -42,8 +42,8 @@ public class TestAASd_067 { @Test public void wrongConceptDescriptionDatatype() throws ValidationException { -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.DATE) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.DATE) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Wrong Data Specification", "en")) // .definition(new LangString("A definition of a Date in English.", "en")) // .build(); @@ -84,7 +84,7 @@ public void wrongConceptDescriptionDatatype() throws ValidationException { fail(); } catch (ValidationException e) { assertTrue(e.getMessage().endsWith( - "If the semanticId of a MultiLanguageProperty references a ConceptDescription then DataSpecificationIEC61360/dataType shall be STRING_TRANSLATABLE.")); + "If the semanticId of a MultiLanguageProperty references a ConceptDescription then DataSpecificationIec61360/dataType shall be STRING_TRANSLATABLE.")); } @@ -94,8 +94,8 @@ public void wrongConceptDescriptionDatatype() throws ValidationException { public void correctConceptDescriptionDatatype() throws ValidationException { -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.STRING_TRANSLATABLE) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Data Specification", "en")) // .definition(new LangString("A definition of a STRING_TRANSLATABLE in English.", "en")) // .build(); diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_068.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_068.java index c239a4d32..2bfd6694c 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_068.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_068.java @@ -31,7 +31,7 @@ * Tests the following constraint: *

* If the semanticId of a Range submodel element references a ConceptDescription then - * DataSpecificationIEC61360/dataType shall be a numerical one, i.e. REAL_* or RATIONAL_*. + * DataSpecificationIec61360/dataType shall be a numerical one, i.e. REAL_* or RATIONAL_*. *

* * @author bader, chang @@ -42,8 +42,8 @@ public class TestAASd_068 { @Test public void wrongConceptDescriptionDatatype() throws ValidationException { -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.INTEGER_COUNT) // This should be DataTypeIEC61360.REAL_* or RATIONAL_* +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.INTEGER_COUNT) // This should be DataTypeIec61360.REAL_* or RATIONAL_* // .preferredName(new LangString("Wrong Data Specification", "en")) // .definition(new LangString("A definition of a Date in English.", "en")) // .build(); @@ -87,7 +87,7 @@ public void wrongConceptDescriptionDatatype() throws ValidationException { fail(); } catch (ValidationException e) { assertTrue(e.getMessage().endsWith("If the semanticId of a Range submodel element references a " + - "ConceptDescription then DataSpecificationIEC61360/dataType shall be a numerical one, i.e. " + + "ConceptDescription then DataSpecificationIec61360/dataType shall be a numerical one, i.e. " + "Real* or Rational*.")); } @@ -98,8 +98,8 @@ public void wrongConceptDescriptionDatatype() throws ValidationException { public void correctRealConceptDescriptionDatatype() throws ValidationException { -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.REAL_COUNT) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.REAL_COUNT) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Data Specification", "en")) // .definition(new LangString("A definition of a REAL_COUNT in English.", "en")) // .build(); @@ -148,8 +148,8 @@ public void correctRealConceptDescriptionDatatype() throws ValidationException { public void correctRationalConceptDescriptionDatatype() throws ValidationException { -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.RATIONAL_MEASURE) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.RATIONAL_MEASURE) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Data Specification", "en")) // .definition(new LangString("A definition of a RATIONAL_MEASURE in English.", "en")) // .build(); diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_069.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_069.java index 5010d3fe2..6d84ecbe9 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_069.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_069.java @@ -33,7 +33,7 @@ * Tests the following constraint: *

* If the semanticId of a Range references a ConceptDescription then - * DataSpecificationIEC61360/levelType shall be identical to the set {Min, Max}. + * DataSpecificationIec61360/levelType shall be identical to the set {Min, Max}. * *

* @@ -76,7 +76,7 @@ public void wrongLevelTypes() { fail(); } catch (ValidationException e) { assertTrue(e.getMessage().endsWith( - "If the semanticId of a Range references a ConceptDescription then DataSpecificationIEC61360/levelType shall be identical to the set {Min, Max}.")); + "If the semanticId of a Range references a ConceptDescription then DataSpecificationIec61360/levelType shall be identical to the set {Min, Max}.")); } } @@ -99,10 +99,10 @@ private ConceptDescription getCDWithLevelType(String conceptDescriptionId) { ConceptDescription cd = ConstraintTestHelper.createConceptDescription("idShort1", conceptDescriptionId, "PROPERTY"); -// DataSpecificationIEC61360 stringDataTypeDS = new DefaultDataSpecificationIEC61360.Builder() +// DataSpecificationIec61360 stringDataTypeDS = new DefaultDataSpecificationIec61360.Builder() // .preferredName(new LangString("ds", "EN")) // .definition(new LangString("some english definition", "EN")) -// .dataType(DataTypeIEC61360.REAL_MEASURE) +// .dataType(DataTypeIec61360.REAL_MEASURE) // .levelTypes(Arrays.asList(LevelType.MIN, LevelType.MAX)) // .build(); @@ -126,10 +126,10 @@ private ConceptDescription getCDWithWrongLevelType(String conceptDescriptionId) ConceptDescription cd = ConstraintTestHelper.createConceptDescription("idShort1", conceptDescriptionId, "PROPERTY"); -// DataSpecificationIEC61360 stringDataTypeDS = new DefaultDataSpecificationIEC61360.Builder() +// DataSpecificationIec61360 stringDataTypeDS = new DefaultDataSpecificationIec61360.Builder() // .preferredName(new LangString("ds", "EN")) // .definition(new LangString("some english definition", "EN")) -// .dataType(DataTypeIEC61360.STRING) +// .dataType(DataTypeIec61360.STRING) // .levelTypes(Arrays.asList(LevelType.NOM, LevelType.MAX)) // .build(); diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_076.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_076.java index d27b080ad..8d4754c69 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_076.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_076.java @@ -29,7 +29,7 @@ * Tests the following constraint: *

* For all ConceptDescriptions using data specification template IEC61360 - * (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0) + * (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0) * at least a preferred name in English shall be defined. *

* @@ -68,7 +68,7 @@ public void noEnglishPreferredName() { } catch (ValidationException e) { System.out.println(e.getMessage()); assertTrue(e.getMessage().endsWith( - "For all ConceptDescriptions using data specification template IEC61360 (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0) at least a preferred name in English shall be defined.")); + "For all ConceptDescriptions using data specification template IEC61360 (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0) at least a preferred name in English shall be defined.")); } } @@ -76,11 +76,11 @@ private ConceptDescription createConceptDescription(LangString preferredName) { ConceptDescription cd = ConstraintTestHelper.createConceptDescription("idShort1", "id", "QUALIFIER"); -// DataSpecificationIEC61360 urlDataTypeDS = new DefaultDataSpecificationIEC61360.Builder() +// DataSpecificationIec61360 urlDataTypeDS = new DefaultDataSpecificationIec61360.Builder() // .preferredName(preferredName) // .preferredName(new LangString("test", "de")) // .definition(new LangString("definition", "en")) -// .dataType(DataTypeIEC61360.URL) +// .dataType(DataTypeIec61360.URL) // .build(); // EmbeddedDataSpecification urlDataTypeEDS = new DefaultEmbeddedDataSpecification.Builder() diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_65a.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_65a.java index 62cd05c38..63be0ce4d 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_65a.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_65a.java @@ -31,8 +31,8 @@ * Tests the following constraint: *

* If the semanticId of a Property references a ConceptDescription with the category VALUE - * then the value of the property is identical to DataSpecificationIEC61360/value and the valueId of - * the property is identical to DataSpecificationIEC61360/valueId. + * then the value of the property is identical to DataSpecificationIec61360/value and the valueId of + * the property is identical to DataSpecificationIec61360/valueId. *

* * @author bader, chang @@ -50,27 +50,27 @@ public void missmatchingValueAndValueId() throws ValidationException { .value("the value of property") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .value("DataSpecificationIEC61360") + .value("DataSpecificationIec61360") .type(KeyTypes.GLOBAL_REFERENCE) .build()) .build()) .valueType(DataTypeDefXsd.STRING) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .value("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC01/DataTypeIEC61360") + .value("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/3/0/RC01/DataTypeIec61360") .type(KeyTypes.CONCEPT_DESCRIPTION) .build()) .build()) .build(); -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.STRING_TRANSLATABLE) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Data Specification", "en")) // .definition(new LangString("A definition of a STRING_TRANSLATABLE in English.", "en")) // .value("the value") // .valueId(new DefaultReference.Builder(). // keys(new DefaultKey.Builder() -// .value("DataSpecificationIEC61360") +// .value("DataSpecificationIec61360") // // .type(KeyTypes.GLOBAL_REFERENCE) // .build()) @@ -112,7 +112,7 @@ public void matchingValueAndValueId() throws ValidationException { .value("the value of Property value") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .value("DataSpecificationIEC61360") + .value("DataSpecificationIec61360") .type(KeyTypes.GLOBAL_REFERENCE) .build()) @@ -121,20 +121,20 @@ public void matchingValueAndValueId() throws ValidationException { .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .value("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC01/DataTypeIEC61360") + .value("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/3/0/RC01/DataTypeIec61360") .type(KeyTypes.CONCEPT_DESCRIPTION) .build()) .build()) .build(); -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.STRING_TRANSLATABLE) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Data Specification", "en")) // .definition(new LangString("A definition of a STRING_TRANSLATABLE in English.", "en")) // .value("the value of Property value") // .valueId(new DefaultReference.Builder(). // keys(new DefaultKey.Builder() -// .value("DataSpecificationIEC61360") +// .value("DataSpecificationIec61360") // // .type(KeyTypes.GLOBAL_REFERENCE) // .build()) diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_66a.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_66a.java index 2221df83d..0d81577c5 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_66a.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_66a.java @@ -30,7 +30,7 @@ /** * Tests the following constraint: *

- * If the semanticId of a MultiLanguageProperty or MultiLanguageMultiLanguageProperty references a ConceptDescription with the category MultiLanguageProperty and DataSpecificationIEC61360/valueList is defined the value and valueId of the MultiLanguageProperty is identical to one of the value reference pair types references in the value list, + * If the semanticId of a MultiLanguageProperty or MultiLanguageMultiLanguageProperty references a ConceptDescription with the category MultiLanguageProperty and DataSpecificationIec61360/valueList is defined the value and valueId of the MultiLanguageProperty is identical to one of the value reference pair types references in the value list, * i.e. ValueReferencePairType/value or ValueReferencePairType/valueId, resp. *

* @@ -52,7 +52,7 @@ public void wrongValueReferencePairTypesValue() throws ValidationException { .build(); -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() // .valueList(new DefaultValueList.Builder() // .valueReferencePairTypes(new DefaultValueReferencePair.Builder() // .value("This is not identical to Multilanguage property value.") @@ -100,7 +100,7 @@ public void wrongValueReferencePairTypesValue() throws ValidationException { fail(); } catch (ValidationException e) { assertTrue(e.getMessage().endsWith( - "If the semanticId of a MultiLanguageProperty or MultiLanguageMultiLanguageProperty references a ConceptDescription with the category MultiLanguageProperty and DataSpecificationIEC61360/valueList is defined the value and valueId of the MultiLanguageProperty is identical to one of the value reference pair types references in the value list, i.e. ValueReferencePairType/value or ValueReferencePairType/valueId, resp.")); + "If the semanticId of a MultiLanguageProperty or MultiLanguageMultiLanguageProperty references a ConceptDescription with the category MultiLanguageProperty and DataSpecificationIec61360/valueList is defined the value and valueId of the MultiLanguageProperty is identical to one of the value reference pair types references in the value list, i.e. ValueReferencePairType/value or ValueReferencePairType/valueId, resp.")); } } @@ -115,8 +115,8 @@ public void correctConceptDescriptionDatatype() throws ValidationException { .type(ReferenceTypes.GLOBAL_REFERENCE) .build(); -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.STRING_TRANSLATABLE) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Data Specification", "en")) // .definition(new LangString("A definition of a STRING_TRANSLATABLE in English.", "en")) // .valueList(new DefaultValueList.Builder() From 651a3831c543af207386453224cbf593cab8c7ff Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Mon, 3 Jul 2023 15:23:36 +0200 Subject: [PATCH 14/59] fix compile errors --- .../v3/dataformat/aasx/AASXDeserializer.java | 2 +- .../v3/dataformat/aasx/AASXSerializer.java | 2 +- .../v3/dataformat/core/util/AasUtils.java | 4 +- .../v3/dataformat/core/AasUtilsTest.java | 52 --- .../v3/dataformat/json/JsonDeserializer.java | 337 ++++++------------ .../v3/dataformat/json/JsonSerializer.java | 275 ++++++++------ .../json/JsonReferableDeserializerTest.java | 105 ++++-- .../json/JsonReferableSerializerTest.java | 5 +- .../dataformat/json/JsonSerializerTest.java | 2 +- .../xml/serialization/KeySerializer.java | 2 +- 10 files changed, 346 insertions(+), 440 deletions(-) delete mode 100644 dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index 5108b7bf9..0b0aa33d9 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -169,7 +169,7 @@ private List parseElements(Collection elements) { paths.add(file.getValue()); } else if (element instanceof SubmodelElementCollection) { SubmodelElementCollection collection = (SubmodelElementCollection) element; - paths.addAll(parseElements(collection.getValues())); + paths.addAll(parseElements(collection.getValue())); } } return paths; diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index 449be54c3..f0456b2ee 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -226,7 +226,7 @@ private Collection findFileElements(Collection elements) files.add((File) element); } else if (element instanceof SubmodelElementCollection) { // Recursive call to deal with SubmodelElementCollections - files.addAll(findFileElements(((SubmodelElementCollection) element).getValues())); + files.addAll(findFileElements(((SubmodelElementCollection) element).getValue())); } } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index 46985b03e..a4ba8d154 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -332,14 +332,14 @@ public static T resolve(Reference reference, Environment e if (keyType != null) { if (SubmodelElementList.class.isAssignableFrom(current.getClass())) { try { - current = ((SubmodelElementList) current).getValues().get(Integer.parseInt(key.getValue())); + current = ((SubmodelElementList) current).getValue().get(Integer.parseInt(key.getValue())); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format("invalid value for key with index %d, expected integer values >= 0, but found '%s'", i, key.getValue())); } catch (IndexOutOfBoundsException ex) { throw new IllegalArgumentException(String.format("index out of bounds exception for key with index %d, expected integer values >= 0 and < %d, but found '%s'", i, - ((SubmodelElementList) current).getValues().size(), + ((SubmodelElementList) current).getValue().size(), key.getValue())); } } else { diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java deleted file mode 100644 index 995289faf..000000000 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; - - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.junit.Assert; -import org.junit.Test; - -public class AasUtilsTest { - - @Test - public void testParseReference() { - Reference reference = AasUtils.parseReference("(ModelReference)[Property]Temperature"); - Assert.assertNotNull(reference); - Assert.assertEquals(1, reference.getKeys().size()); - Assert.assertEquals(KeyTypes.PROPERTY, reference.getKeys().get(0).getType()); - Assert.assertEquals("Temperature", reference.getKeys().get(0).getValue()); - } - - @Test - public void whenDeserializingEnumNames_withUpperCamelCase_shouldReturnScreamingSnakeCase() { - Assert.assertEquals("ANY_ENUM", AasUtils.deserializeEnumName("AnyEnum")); - } - - @Test - public void whenDeserializingEnumNames_withLowerCamelCase_shouldReturnScreamingSnakeCase() { - Assert.assertEquals("ANY_ENUM", AasUtils.deserializeEnumName("anyEnum")); - } - - @Test - public void whenDeserializingEnumNames_withScreamingSnakeCase_shouldReturnUnchanged() { - final String name = "ANY_ENUM"; - Assert.assertEquals(name, AasUtils.deserializeEnumName(name)); - } -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index d44cafa7f..e5e77c90b 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -15,40 +15,36 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.List; -import java.util.stream.Collectors; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +// TODO import io.adminshell.aas.v3.dataformat.core.deserialization.EmbeddedDataSpecificationDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; + + /** * Class for deserializing/parsing AAS JSON documents. */ -public class JsonDeserializer { +public class JsonDeserializer implements Deserializer, ReferableDeserializer, ReferenceDeserializer, SpecificAssetIdDeserializer, SubmodelDescriptorDeserializer, AssetAdministrationShellDescriptorDeserializer { protected JsonMapper mapper; protected SimpleAbstractTypeResolver typeResolver; - - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + // TODO + protected static Map, com.fasterxml.jackson.databind.JsonDeserializer> customDeserializers = Map.of( + /* EmbeddedDataSpecification.class, new EmbeddedDataSpecificationDeserializer() */); public JsonDeserializer() { initTypeResolver(); @@ -62,15 +58,22 @@ protected void buildMapper() { .annotationIntrospector(new ReflectionAnnotationIntrospector()) .addModule(buildEnumModule()) .addModule(buildImplementationModule()) + .addModule(buildCustomDeserializerModule()) .build(); ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); } - @SuppressWarnings("unchecked") - private void initTypeResolver() { + protected SimpleModule buildCustomDeserializerModule() { + SimpleModule module = new SimpleModule(); + customDeserializers.forEach(module::addDeserializer); + return module; + } + + private void initTypeResolver() { typeResolver = new SimpleAbstractTypeResolver(); ReflectionHelper.DEFAULT_IMPLEMENTATIONS .stream() + .filter(x -> !customDeserializers.containsKey(x.getInterfaceType())) .forEach(x -> typeResolver.addMapping(x.getInterfaceType(), x.getImplementationType())); } @@ -86,255 +89,119 @@ protected SimpleModule buildImplementationModule() { return module; } - - /** - * Deserializes a given string into an instance of - * AssetAdministrationShellEnvironment - * - * @param value a string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ + @Override public Environment read(String value) throws DeserializationException { try { - return mapper.readValue(value, Environment.class); + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + //return mapper.treeToValue(ModelTypeProcessor.preprocess(value), Environment.class); + return mapper.treeToValue(new ObjectMapper().readTree(value), Environment.class); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); } } - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param src an InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src) throws DeserializationException { - return read(src, DEFAULT_CHARSET); - } - - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param src An InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src, Charset charset) throws DeserializationException { - return read(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator()))); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param file A java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file, Charset charset) - throws FileNotFoundException, DeserializationException { - return read(new FileInputStream(file), charset); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param file a java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if the file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { - return read(file, DEFAULT_CHARSET); - } - - /** - * Enables usage of custom implementation to be used for deserialization - * instead of default implementation, e.g. defining a custom implementation - * of the Submodel interface {@code class - * CustomSubmodel implements Submodel {}} and calling - * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will - * result in all instances of Submodel will be deserialized as - * CustomSubmodel. Subsequent class with the same aasInterface parameter - * will override the effects of all previous calls. - * - * @param the type of the interface to replace - * @param aasInterface the class of the interface to replace - * @param implementation the class implementing the interface that should be - * used for deserialization. - */ + @Override public void useImplementation(Class aasInterface, Class implementation) { typeResolver.addMapping(aasInterface, implementation); buildMapper(); } - /** - * Deserializes a given string into an instance of the given Referable - * - * @param src a string representation of the Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ public T readReferable(String src, Class outputClass) throws DeserializationException { + @Override + public T readReferable(String referable, Class outputClass) throws DeserializationException { try { - return mapper.readValue(src, outputClass); + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + //return mapper.treeToValue(ModelTypeProcessor.preprocess(referable), outputClass); + return mapper.treeToValue(new ObjectMapper().readTree(referable), outputClass); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing Referable", ex); } } - /** - * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(InputStream src, Class outputClass) throws DeserializationException { - return readReferable(src, DEFAULT_CHARSET, outputClass); + @Override + public List readReferables(String referables, Class outputClass) throws DeserializationException { + try { + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + // String parsed = mapper.writeValueAsString(ModelTypeProcessor.preprocess(referables)) ; + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(referables)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of Referables", ex); + } } - /** - * Deserializes a given input stream into an instance of the given Referable - * - * @param src a input stream representing a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - return readReferable(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator())), - outputClass); + @Override + public Reference readReference(String reference) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(reference), Reference.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the Reference", ex); + } } - /** - * Deserializes a given file into an instance of the given Referable using DEFAULT_CHARSET - * - * @param src a file containing string representation of a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public T readReferable(File src, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferable(src, DEFAULT_CHARSET, outputClass); + @Override + public List readReferences(String references) throws DeserializationException { + try { + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(references)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of References", ex); + } } - /** - * Deserializes a given file into an instance of the given Referable - * - * @param src a file containing string representation of a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public T readReferable(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferable(new FileInputStream(src), charset, outputClass); + @Override + public SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(specificAssetId), SpecificAssetId.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the SpecificAssetId", ex); + } } - /** - * Deserializes a given string into an instance of a list of the given Referables - * - * @param referables a string representation of an array of Referables - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of a list of the referables - * @throws DeserializationException if deserialization of referable fails - */ public List readReferables(String referables, Class outputClass) throws DeserializationException { + @Override + public List readSpecificAssetIds(String specificAssetIds) throws DeserializationException { try { - return mapper.readValue(referables, new TypeReference>() { - }); + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(specificAssetIds)) ; + return mapper.readValue(parsed,new TypeReference>(){}); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of Referable", ex); + throw new DeserializationException("error deserializing list of SpecificAssetIds", ex); } } - - /** - * Deserializes a given input stream into an instance of a list of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Class outputClass) throws DeserializationException { - return readReferables(src, DEFAULT_CHARSET, outputClass); + @Override + public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(submodelDescriptor), SubmodelDescriptor.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the SubmodelDescriptor", ex); + } } - /** - * Deserializes a given input stream into an instance of a list of the given Referable - * - * @param src a input stream representing a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - return readReferables(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator())), - outputClass); + @Override + public List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException { + try { + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(submodelDescriptors)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of SubmodelDescriptors", ex); + } } - /** - * Deserializes a given file into an instance of a list of the given Referable using DEFAULT_CHARSET - * - * @param src a file containing string representation of a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public List readReferables(File src, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferables(src, DEFAULT_CHARSET, outputClass); + @Override + public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(assetAdministrationShellDescriptor), AssetAdministrationShellDescriptor.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the AssetAdministrationShellDescriptor", ex); + } } - /** - * Deserializes a given file into an instance of a list of the given Referable - * - * @param src a file containing string representation of a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public List readReferables(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferables(new FileInputStream(src), charset, outputClass); + @Override + public List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException { + try { + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(assetAdministrationShellDescriptors)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of AssetAdministrationShellDescriptors", ex); + } } -} +} \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 563e3506e..6e7ceef7c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -15,35 +15,32 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.*; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.Collection; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleModule; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +// TODO import io.adminshell.aas.v3.dataformat.core.serialization.EmbeddedDataSpecificationSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; + +import java.util.List; /** - * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to JSON. + * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to + * JSON. */ -public class JsonSerializer { +public class JsonSerializer implements Serializer, ReferableSerializer, ReferenceSerializer, SpecificAssetIdSerializer, SubmodelDescriptorSerializer, AssetAdministrationShellDescriptorSerializer { protected JsonMapper mapper; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - public JsonSerializer() { buildMapper(); } @@ -53,136 +50,194 @@ protected void buildMapper() { .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .serializationInclusion(JsonInclude.Include.NON_NULL) .addModule(buildEnumModule()) + .addModule(buildCustomSerializerModule()) .annotationIntrospector(new ReflectionAnnotationIntrospector()) .build(); ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); } + protected SimpleModule buildCustomSerializerModule() { + SimpleModule module = new SimpleModule(); + // TODO: module.addSerializer(EmbeddedDataSpecification.class, new EmbeddedDataSpecificationSerializer()); + return module; + } + protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); module.addSerializer(Enum.class, new EnumSerializer()); return module; } - /** - * Serializes a given instance of AssetAdministrationShellEnvironment to - * string - * - * @param aasEnvironment the AssetAdministrationShellEnvironment to - * serialize - * @return the string representation of the environment - * @throws SerializationException if serialization fails - */ + @Override public String write(Environment aasEnvironment) throws SerializationException { try { - return mapper.writeValueAsString(aasEnvironment); + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + // return mapper.writeValueAsString(ModelTypeProcessor.postprocess(mapper.valueToTree(aasEnvironment))); + return mapper.writeValueAsString(mapper.valueToTree(aasEnvironment)); } catch (JsonProcessingException ex) { throw new SerializationException("error serializing AssetAdministrationShellEnvironment", ex); } } - /** - * Serializes a given instance of Environment to an - * OutputStream using DEFAULT_CHARSET - * - * @param out the Outputstream to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { - write(out, DEFAULT_CHARSET, aasEnvironment); + @Override + public String writeReferable(Referable referable) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(referable)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing Referable", ex); + } + } + + @Override + public String writeReferables(List referables) throws SerializationException { + if(referables.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.get(0).getClass())); + String json = objectWriter.writeValueAsString(referables); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of Referables", ex); + } + } + + @Override + public String writeReference(Reference reference) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(reference)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing Referable", ex); + } + } + + @Override + public String writeReferences(List references) throws SerializationException { + if(references.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, Reference.class)); + String json = objectWriter.writeValueAsString(references); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of References", ex); + } } - /** - * Serializes a given instance of Environment to an - * OutputStream using given charset - * - * @param out the Outputstream to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Charset charset, Environment aasEnvironment) - throws IOException, SerializationException { - try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { - writer.write(write(aasEnvironment)); + @Override + public String writeSpecificAssetId(SpecificAssetId specificAssetId) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(specificAssetId)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing SpecificAssetId", ex); + } + } + + @Override + public String writeSpecificAssetIds(List specificAssetIds) throws SerializationException { + if(specificAssetIds.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SpecificAssetId.class)); + String json = objectWriter.writeValueAsString(specificAssetIds); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of SpecificAssetIds", ex); } } - // Note that the AAS also defines a file class - /** - * Serializes a given instance of Environment to a - * java.io.File using DEFAULT_CHARSET - * - * @param file the java.io.File to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - void write(java.io.File file, Charset charset, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - try (OutputStream out = new FileOutputStream(file)) { - write(out, charset, aasEnvironment); + @Override + public String writeSubmodelDescriptor(SubmodelDescriptor submodelDescriptor) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(submodelDescriptor)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing SubmodelDescriptor", ex); } } - /** - * Serializes a given instance of Environment to a - * java.io.File using given charset - * - * @param file the java.io.File to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - void write(java.io.File file, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - write(file, DEFAULT_CHARSET, aasEnvironment); + @Override + public String writeSubmodelDescriptors(List submodelDescriptors) throws SerializationException { + if(submodelDescriptors.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SubmodelDescriptor.class)); + String json = objectWriter.writeValueAsString(submodelDescriptors); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of SubmodelDescriptors", ex); + } } - /** - * Serializes a given instance of a Referable to string - * - * @param referable the referable to serialize - * @return the string representation of the referable - * @throws SerializationException if serialization fails - */ - public String write(Referable referable) throws SerializationException { + @Override + public String writeAssetAdministrationShellDescriptor(AssetAdministrationShellDescriptor assetAdministrationShellDescriptor) throws SerializationException { try { - return mapper.writeValueAsString(referable); + return mapper.writeValueAsString(mapper.valueToTree(assetAdministrationShellDescriptor)); } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); + throw new SerializationException("error serializing AssetAdministrationShellDescriptor", ex); } } - /** - * - * @param referables the referables to serialize - * @return the string representation of the list of referables - * @throws SerializationException if serialization fails - */ - public String write(Collection referables) throws SerializationException { - if (referables == null) { + @Override + public String writeAssetAdministrationShellDescriptors(List assetAdministrationShellDescriptors) throws SerializationException { + if(assetAdministrationShellDescriptors.isEmpty()){ return null; - } else if (referables.isEmpty()) { - return mapper.createArrayNode().toString(); - } + } try { - return mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.iterator().next().getClass())) - .writeValueAsString(referables); + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, AssetAdministrationShellDescriptor.class)); + String json = objectWriter.writeValueAsString(assetAdministrationShellDescriptors); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of Referables", ex); + throw new SerializationException("error serializing list of AssetAdministrationShellDescriptors", ex); } } -} + + + +// @Override +// public String write(Object aas_element) throws SerializationException { +// try { +// // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore +// //return mapper.writeValueAsString(ModelTypeProcessor.postprocess(this.mapper.readTree(json))); +// return mapper.writeValueAsString(mapper.valueToTree(aas_element)); +// +// } catch (JsonProcessingException ex) { +// throw new SerializationException("error serializing an aas-element", ex); +// } +// } + +// @Override +// public String writeList(List aas_elements, Class outputClass) throws SerializationException { +// if(aas_elements.isEmpty()){ +// return null; +// } +// +// try { +// ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, outputClass)); +// String json = objectWriter.writeValueAsString(aas_elements); +// +// return mapper.writeValueAsString(this.mapper.readTree(json)); +// +// } catch (JsonProcessingException ex) { +// throw new SerializationException("error serializing list of AAS elements", ex); +// } +// } +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java index 68ef1d473..f2edff15d 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java @@ -17,84 +17,119 @@ import static org.junit.Assert.assertEquals; +import java.io.File; import java.io.IOException; -import java.util.Collections; +import java.nio.file.Files; +import java.util.Arrays; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; + import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; public class JsonReferableDeserializerTest { + private static final Logger logger = LoggerFactory.getLogger(JsonReferableDeserializerTest.class); + @Test public void testReadAAS() throws IOException, DeserializationException { - AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); - AssetAdministrationShell actual = new JsonDeserializer().readReferable(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/assetAdministrationShell.json"); + String expected = Files.readString(fileExpected.toPath()); + AssetAdministrationShell aas = new JsonDeserializer().readReferable(expected, AssetAdministrationShell.class); + Environment environment = AASFull.ENVIRONMENT; + AssetAdministrationShell aasExpected = environment.getAssetAdministrationShells().get(0); + + assertEquals(aasExpected, aas); } @Test public void testReadAASs() throws IOException, DeserializationException { - List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/assetAdministrationShellList.json"); + String expected = Files.readString(fileExpected.toPath()); + List aas = new JsonDeserializer().readReferables(expected, AssetAdministrationShell.class); + Environment environment = AASFull.ENVIRONMENT; + List aasExpected = Arrays.asList(environment.getAssetAdministrationShells().get(0) + ,environment.getAssetAdministrationShells().get(1)) ; + + assertEquals(aasExpected, aas); } @Test public void testReadSubmodel() throws IOException, DeserializationException { - Submodel expected = Examples.SUBMODEL.getModel(); - Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodel.json"); + String expected = Files.readString(fileExpected.toPath()); + Submodel submodel = new JsonDeserializer().readReferable(expected, Submodel.class); + Environment environment = AASFull.ENVIRONMENT; + Submodel submodelExpected = environment.getSubmodels().get(0); + + assertEquals(submodelExpected, submodel); } @Test public void testReadSubmodels() throws IOException, DeserializationException { - List expected = Examples.SUBMODEL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelList.json"); + String expected = Files.readString(fileExpected.toPath()); + List submodels = new JsonDeserializer().readReferables(expected,Submodel.class); + Environment environment = AASFull.ENVIRONMENT; + List submodelsExpected = Arrays.asList(environment.getSubmodels().get(0),environment.getSubmodels().get(1)); + + assertEquals(submodelsExpected, submodels); } @Test public void testReadSubmodelElement() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); - SubmodelElement actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelElement.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelElement submodelElement = new JsonDeserializer().readReferable(expected,SubmodelElement.class); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElementExpected = environment.getSubmodels().get(0).getSubmodelElements().get(0); + + assertEquals(submodelElementExpected, submodelElement); } @Test public void testReadSubmodelElements() throws IOException, DeserializationException { - List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables( - Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/listOfSubmodelElements.json"); + String expected = Files.readString(fileExpected.toPath()); + List submodelElements = new JsonDeserializer().readReferables(expected,SubmodelElement.class); + Environment environment = AASFull.ENVIRONMENT; + List submodelElementsExpected = Arrays.asList( + environment.getSubmodels().get(0).getSubmodelElements().get(0), + environment.getSubmodels().get(0).getSubmodelElements().get(1)); ; + + assertEquals(submodelElementsExpected, submodelElements); } @Test public void testReadSubmodelElementList() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); - SubmodelElementList actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelElementList.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelElementList submodelElementList = new JsonDeserializer().readReferable(expected, SubmodelElementList.class); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElementListExpected = environment.getSubmodels().get(6).getSubmodelElements().get(5); ; + + assertEquals(submodelElementListExpected, submodelElementList); } @Test public void testReadSubmodelElementCollection() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); - SubmodelElementCollection actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelElementCollection.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelElementCollection submodelElementCollection = new JsonDeserializer().readReferable(expected, SubmodelElementCollection.class); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElementCollectionExpected = environment.getSubmodels().get(6).getSubmodelElements().get(6); ; + + assertEquals(submodelElementCollectionExpected, submodelElementCollection); } - @Test - public void testReadEmptyReferableList() throws DeserializationException { - List emptyList = Collections.emptyList(); - List deserialized = new JsonDeserializer().readReferables("[]", Referable.class); - assertEquals(emptyList, deserialized); - } -} +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java index 7df276487..882958cd0 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.util.Collection; +import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; @@ -94,10 +95,10 @@ private void compare(ExampleData exampleData) throws IOException, Serializati if (Environment.class.isAssignableFrom(exampleData.getModel().getClass())) { actual = new JsonSerializer().write((Environment) exampleData.getModel()); } else if (Referable.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = new JsonSerializer().write((Referable) exampleData.getModel()); + actual = new JsonSerializer().writeReferable((Referable) exampleData.getModel()); } else if (Collection.class.isAssignableFrom(exampleData.getModel().getClass()) && ((Collection) exampleData.getModel()).stream().allMatch(x -> x != null && Referable.class.isAssignableFrom(x.getClass()))) { - actual = new JsonSerializer().write((Collection) exampleData.getModel()); + actual = new JsonSerializer().writeReferables((List) exampleData.getModel()); } JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 1ea73393e..21c4b2e77 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -78,7 +78,7 @@ public void testSerializeFullExample() throws SerializationException, JSONExcept @Test public void testSerializeEmptyReferableList() throws SerializationException { List emptyList = Collections.emptyList(); - String serialized = new JsonSerializer().write(emptyList); + String serialized = new JsonSerializer().writeReferables(emptyList); assertEquals("[]", serialized); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java index 8e545b727..b7e2ae19a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java @@ -33,7 +33,7 @@ public void serialize(Key key, JsonGenerator gen, SerializerProvider serializers ToXmlGenerator xgen = (ToXmlGenerator) gen; xgen.writeObjectFieldStart("key"); - String keyTypeValue = AasUtils.serializeEnumName(key.getType().toString()); + String keyTypeValue = key.getType().toString(); xgen.setNextIsAttribute(false); xgen.writeFieldName("type"); xgen.writeString(key.getType().name()); From c50a4ac93582b196da3b852612e68549c0608123 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 3 Jul 2023 16:28:41 +0200 Subject: [PATCH 15/59] Adapt the copyright notice --- .../eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java | 2 +- .../org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java | 2 +- .../aas4j/v3/dataformat/core/DataSpecificationManager.java | 2 +- .../digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java | 2 +- .../deserialization/EmbeddedDataSpecificationDeserializer.java | 2 +- .../core/serialization/EmbeddedDataSpecificationSerializer.java | 2 +- .../aas4j/v3/dataformat/core/util/IdentifiableCollector.java | 2 +- .../v3/dataformat/core/util/MostSpecificClassComparator.java | 2 +- .../dataformat/core/util/MostSpecificTypeTokenComparator.java | 2 +- .../core/visitor/AssetAdministrationShellElementVisitor.java | 2 +- .../visitor/AssetAdministrationShellElementWalkerVisitor.java | 2 +- .../eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java | 2 +- .../digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java | 2 +- .../aas4j/v3/dataformat/mapping/MappingException.java | 2 +- .../aas4j/v3/dataformat/mapping/MappingProvider.java | 2 +- .../aas4j/v3/dataformat/mapping/SourceBasedMapper.java | 2 +- .../aas4j/v3/dataformat/mapping/TargetBasedMapper.java | 2 +- .../json/AssetAdministrationShellDescriptorDeserializer.java | 2 +- .../aas4j/v3/dataformat/json/ReferableDeserializer.java | 2 +- .../aas4j/v3/dataformat/json/ReferenceSerializer.java | 2 +- .../aas4j/v3/dataformat/json/mixins/SubmodelMixin.java | 2 +- .../JsonAssetAdministrationShellDescriptorDeserializerTest.java | 2 +- .../JsonAssetAdministrationShellDescriptorSerializerTest.java | 2 +- .../aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java | 2 +- .../aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java | 2 +- .../v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java | 2 +- .../v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java | 2 +- .../dataformat/json/JsonSubmodelDescriptorDeserializerTest.java | 2 +- .../dataformat/json/JsonSubmodelDescriptorSerializerTest.java | 2 +- .../aas4j/v3/dataformat/xml/serialization/KeySerializer.java | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java index fd5b0826c..b6a4dfa91 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java index ef6fdbfb8..fea84b439 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java index 0db3ae12a..296b11284 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java index a88291966..148c676f8 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java index 64f8d4a15..3e782f0d9 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java index 3fd5b8c4a..6a933ea5f 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java index 78d0f7df0..30db91945 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java index 5c9805de7..a5f2e3bbc 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java index 5915e8867..c71797477 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java index fc6f2af60..1e24e44fb 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java index 9a1e53ad1..c43e12769 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java index 28d7b36fe..bf213a4fb 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java index 89fdb5859..81bc2ca4e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java index de7108db1..fafbec74e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java index 44e10d707..c69de2381 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java index b036a0836..3b53fb72b 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java index b34f6e09e..ef75d513e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java index ae3360f42..86fbd42bb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java index 501ee11ce..36c6ffb26 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java index affda40f4..ca1a7c7e5 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java index 56d53fc33..e7a2458c9 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java index 5fc1f8e6e..0422c2e2d 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java index bd7e90a73..bef8fd2da 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java index 9ab226d17..74bfb8fa3 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java index febc36eb5..c744f9ff6 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java index fd3587994..06324f3ce 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java index 37980a5b1..d449463fe 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java index 7bc2b30ff..2bf14bbb4 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java index d8a61dfb2..f82b47696 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java index 8e545b727..44387a761 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 4dcdcdaf6f79ff58a09a4fbe2c0a69b9b7780aff Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 3 Jul 2023 16:29:52 +0200 Subject: [PATCH 16/59] Adapt the copyright notice --- .../aas4j/v3/dataformat/json/ReferableSerializer.java | 2 +- .../aas4j/v3/dataformat/json/ReferenceDeserializer.java | 2 +- .../v3/dataformat/json/ReflectionAnnotationIntrospector.java | 2 +- .../aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java | 2 +- .../aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java | 2 +- .../v3/dataformat/json/SubmodelDescriptorDeserializer.java | 2 +- .../aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java | 2 +- .../json/mixins/AssetAdministrationShellDescriptorMixin.java | 2 +- .../json/mixins/DataSpecificationPhysicalUnitMixin.java | 2 +- .../aas4j/v3/dataformat/json/mixins/LangStringMixin.java | 2 +- .../v3/dataformat/json/mixins/SubmodelDescriptorMixin.java | 2 +- .../aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java | 2 +- .../aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java | 2 +- .../aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java | 2 +- .../aas4j/v3/dataformat/xml/SubmodelElementManager.java | 2 +- .../v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java | 2 +- .../xml/deserialization/LangStringNodeDeserializer.java | 2 +- .../dataformat/xml/deserialization/LangStringsDeserializer.java | 2 +- .../aas4j/v3/dataformat/xml/mixins/LangStringMixin.java | 2 +- .../v3/dataformat/xml/serialization/LangStringSerializer.java | 2 +- .../v3/dataformat/xml/serialization/LangStringsSerializer.java | 2 +- .../v3/dataformat/xml/serialization/ReferenceSerializer.java | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java index 41231cbfc..b3e6e375d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java index 99d877dd1..87725b376 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java index 53c94daf3..1fd77253c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java index 74c9145f3..e66d66791 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java index d87ad3a81..4f51d6d2a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java index 6f157e9f3..d1e7640db 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java index 38ccce841..4902bc2d5 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java index 93528fee5..4d589447f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java index 3c135cfa4..ee87e0d54 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java index 20a22471d..5a874c713 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java index 95826b52d..2dc8b5891 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java index 60de90b26..4463d9a3a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java index 19c04a054..c07f20bf5 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java index b7e4b1287..de2b6cd89 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java index e2a29a42b..e1b22bc93 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java index 4e157a834..6c8bc20ee 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java index 7fb61b6a4..cb2dfaa88 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java index ebc3eb0c7..eaee8aa90 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java index 8bf691b20..ec348ca41 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java index 1ee6cc058..2e79f42db 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java index 2282408e6..0b75bb518 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java index 419a36ef7..7313d9a02 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 84711324c3091912f3f3d198b85a8be79b80523c Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Mon, 3 Jul 2023 16:39:24 +0200 Subject: [PATCH 17/59] add next iteration of generated part 1 classes --- ...ministrationShellElementWalkerVisitor.java | 4 +- ...ssetAdministrationShellElementVisitor.java | 3 - ...ministrationShellElementWalkerVisitor.java | 4 +- .../aas4j/v3/dataformat/core/AASFull.java | 52 +--- .../aas4j/v3/dataformat/core/AASSimple.java | 65 ++-- .../v3/dataformat/core/CustomProperty.java | 27 +- .../dataformat/core/EnumSerializerTest.java | 6 +- .../serialization/LangStringSerializer.java | 2 +- .../aas4j/v3/model/AasSubmodelElements.java | 38 +-- .../aas4j/v3/model/AbstractLangString.java | 2 +- .../v3/model/AdministrativeInformation.java | 66 +++- .../model/AnnotatedRelationshipElement.java | 10 +- .../v3/model/AssetAdministrationShell.java | 48 ++- .../aas4j/v3/model/AssetInformation.java | 83 +++-- .../digitaltwin/aas4j/v3/model/AssetKind.java | 19 +- .../aas4j/v3/model/BasicEventElement.java | 140 ++++----- .../digitaltwin/aas4j/v3/model/Blob.java | 40 +-- .../aas4j/v3/model/Capability.java | 2 +- .../aas4j/v3/model/ConceptDescription.java | 14 +- .../aas4j/v3/model/DataElement.java | 2 +- .../v3/model/DataSpecificationContent.java | 7 +- .../v3/model/DataSpecificationIec61360.java | 214 +++++++------ .../model/DataSpecificationPhysicalUnit.java | 293 ------------------ .../aas4j/v3/model/DataTypeDefXsd.java | 83 ++--- .../aas4j/v3/model/DataTypeIec61360.java | 42 +-- .../digitaltwin/aas4j/v3/model/Direction.java | 8 +- .../v3/model/EmbeddedDataSpecification.java | 18 +- .../digitaltwin/aas4j/v3/model/Entity.java | 74 ++--- .../aas4j/v3/model/EntityType.java | 8 +- .../aas4j/v3/model/Environment.java | 46 +-- .../aas4j/v3/model/EventElement.java | 2 +- .../aas4j/v3/model/EventPayload.java | 132 ++++---- .../digitaltwin/aas4j/v3/model/Extension.java | 55 ++-- .../digitaltwin/aas4j/v3/model/File.java | 40 +-- .../aas4j/v3/model/HasDataSpecification.java | 12 +- .../aas4j/v3/model/HasExtensions.java | 10 +- .../digitaltwin/aas4j/v3/model/HasKind.java | 17 +- .../aas4j/v3/model/HasSemantics.java | 16 +- .../aas4j/v3/model/Identifiable.java | 16 +- .../digitaltwin/aas4j/v3/model/Key.java | 16 +- .../digitaltwin/aas4j/v3/model/KeyTypes.java | 52 ++-- .../aas4j/v3/model/LangString.java | 33 -- .../LangStringDefinitionTypeIec61360.java | 2 +- .../aas4j/v3/model/LangStringNameType.java | 2 +- .../LangStringPreferredNameTypeIec61360.java | 2 +- .../LangStringShortNameTypeIec61360.java | 2 +- .../aas4j/v3/model/LangStringTextType.java | 2 +- .../digitaltwin/aas4j/v3/model/LevelType.java | 101 ++++-- .../aas4j/v3/model/ModelingKind.java | 41 --- .../aas4j/v3/model/MultiLanguageProperty.java | 22 +- .../digitaltwin/aas4j/v3/model/Operation.java | 54 ++-- .../aas4j/v3/model/OperationVariable.java | 10 +- .../digitaltwin/aas4j/v3/model/Property.java | 54 ++-- .../aas4j/v3/model/Qualifiable.java | 10 +- .../digitaltwin/aas4j/v3/model/Qualifier.java | 66 ++-- .../aas4j/v3/model/QualifierKind.java | 10 +- .../digitaltwin/aas4j/v3/model/Range.java | 46 +-- .../digitaltwin/aas4j/v3/model/Referable.java | 87 ++---- .../digitaltwin/aas4j/v3/model/Reference.java | 46 +-- .../aas4j/v3/model/ReferenceElement.java | 10 +- .../aas4j/v3/model/ReferenceTypes.java | 14 +- .../aas4j/v3/model/RelationshipElement.java | 16 +- .../digitaltwin/aas4j/v3/model/Resource.java | 40 +-- .../aas4j/v3/model/SpecificAssetId.java | 54 ++-- .../aas4j/v3/model/StateOfEvent.java | 8 +- .../digitaltwin/aas4j/v3/model/Submodel.java | 12 +- .../aas4j/v3/model/SubmodelElement.java | 10 +- .../v3/model/SubmodelElementCollection.java | 20 +- .../aas4j/v3/model/SubmodelElementList.java | 64 ++-- .../digitaltwin/aas4j/v3/model/ValueList.java | 10 +- .../aas4j/v3/model/ValueReferencePair.java | 20 +- .../aas4j/v3/model/annotations/IRI.java | 4 +- .../v3/model/annotations/KnownSubtypes.java | 4 +- .../v3/model/builder/AbstractBuilder.java | 4 +- .../AdministrativeInformationBuilder.java | 37 ++- .../AnnotatedRelationshipElementBuilder.java | 68 ++-- .../AssetAdministrationShellBuilder.java | 83 +++-- .../builder/AssetInformationBuilder.java | 42 ++- .../builder/BasicEventElementBuilder.java | 166 +++++----- .../aas4j/v3/model/builder/BlobBuilder.java | 124 +++----- .../aas4j/v3/model/builder/Builder.java | 4 +- .../v3/model/builder/CapabilityBuilder.java | 104 +++---- .../builder/ConceptDescriptionBuilder.java | 69 ++--- .../DataSpecificationIec61360Builder.java | 138 ++++----- .../DataSpecificationPhysicalUnitBuilder.java | 181 ----------- .../EmbeddedDataSpecificationBuilder.java | 4 +- .../aas4j/v3/model/builder/EntityBuilder.java | 157 +++++----- .../v3/model/builder/EnvironmentBuilder.java | 44 +-- .../v3/model/builder/EventPayloadBuilder.java | 64 ++-- .../v3/model/builder/ExtendableBuilder.java | 2 +- .../v3/model/builder/ExtensionBuilder.java | 35 ++- .../aas4j/v3/model/builder/FileBuilder.java | 124 +++----- .../aas4j/v3/model/builder/KeyBuilder.java | 2 +- .../v3/model/builder/LangStringBuilder.java | 54 ---- ...ngStringDefinitionTypeIec61360Builder.java | 2 +- .../builder/LangStringNameTypeBuilder.java | 2 +- ...tringPreferredNameTypeIec61360Builder.java | 2 +- ...angStringShortNameTypeIec61360Builder.java | 2 +- .../builder/LangStringTextTypeBuilder.java | 2 +- .../v3/model/builder/LevelTypeBuilder.java | 2 +- .../builder/MultiLanguagePropertyBuilder.java | 110 +++---- .../v3/model/builder/OperationBuilder.java | 148 ++++----- .../builder/OperationVariableBuilder.java | 2 +- .../v3/model/builder/PropertyBuilder.java | 126 ++++---- .../v3/model/builder/QualifierBuilder.java | 26 +- .../aas4j/v3/model/builder/RangeBuilder.java | 124 +++----- .../v3/model/builder/ReferenceBuilder.java | 44 +-- .../builder/ReferenceElementBuilder.java | 104 +++---- .../builder/RelationshipElementBuilder.java | 104 +++---- .../v3/model/builder/ResourceBuilder.java | 24 +- .../model/builder/SpecificAssetIdBuilder.java | 26 +- .../v3/model/builder/SubmodelBuilder.java | 145 ++++----- .../SubmodelElementCollectionBuilder.java | 111 +++---- .../builder/SubmodelElementListBuilder.java | 132 ++++---- .../v3/model/builder/ValueListBuilder.java | 2 +- .../builder/ValueReferencePairBuilder.java | 2 +- .../DefaultAdministrativeInformation.java | 71 ++++- .../DefaultAnnotatedRelationshipElement.java | 111 +++---- .../impl/DefaultAssetAdministrationShell.java | 106 +++---- .../model/impl/DefaultAssetInformation.java | 75 +++-- .../model/impl/DefaultBasicEventElement.java | 205 ++++++------ .../aas4j/v3/model/impl/DefaultBlob.java | 136 ++++---- .../v3/model/impl/DefaultCapability.java | 104 +++---- .../model/impl/DefaultConceptDescription.java | 82 +++-- .../DefaultDataSpecificationIec61360.java | 177 ++++++----- .../DefaultDataSpecificationPhysicalUnit.java | 268 ---------------- .../DefaultEmbeddedDataSpecification.java | 20 +- .../aas4j/v3/model/impl/DefaultEntity.java | 158 ++++------ .../v3/model/impl/DefaultEnvironment.java | 47 +-- .../v3/model/impl/DefaultEventPayload.java | 110 ++++--- .../aas4j/v3/model/impl/DefaultExtension.java | 58 ++-- .../aas4j/v3/model/impl/DefaultFile.java | 136 ++++---- .../aas4j/v3/model/impl/DefaultKey.java | 20 +- .../v3/model/impl/DefaultLangString.java | 113 ------- ...faultLangStringDefinitionTypeIec61360.java | 2 +- .../model/impl/DefaultLangStringNameType.java | 2 +- ...ltLangStringPreferredNameTypeIec61360.java | 2 +- ...efaultLangStringShortNameTypeIec61360.java | 2 +- .../model/impl/DefaultLangStringTextType.java | 2 +- .../aas4j/v3/model/impl/DefaultLevelType.java | 2 +- .../impl/DefaultMultiLanguageProperty.java | 116 +++---- .../aas4j/v3/model/impl/DefaultOperation.java | 141 ++++----- .../model/impl/DefaultOperationVariable.java | 13 +- .../aas4j/v3/model/impl/DefaultProperty.java | 143 ++++----- .../aas4j/v3/model/impl/DefaultQualifier.java | 58 ++-- .../aas4j/v3/model/impl/DefaultRange.java | 139 ++++----- .../aas4j/v3/model/impl/DefaultReference.java | 47 +-- .../model/impl/DefaultReferenceElement.java | 109 +++---- .../impl/DefaultRelationshipElement.java | 110 +++---- .../aas4j/v3/model/impl/DefaultResource.java | 44 +-- .../v3/model/impl/DefaultSpecificAssetId.java | 55 ++-- .../aas4j/v3/model/impl/DefaultSubmodel.java | 152 +++++---- .../DefaultSubmodelElementCollection.java | 116 +++---- .../impl/DefaultSubmodelElementList.java | 140 ++++----- .../aas4j/v3/model/impl/DefaultValueList.java | 13 +- .../model/impl/DefaultValueReferencePair.java | 20 +- 156 files changed, 3690 insertions(+), 5147 deletions(-) delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java index 90110b82c..2bcfd2d80 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -243,7 +243,7 @@ public default void visit(Entity entity) { if (entity == null) { return; } - visit(entity.getSpecificAssetId()); + entity.getSpecificAssetIds().forEach(x -> visit(x)); entity.getStatements().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(entity); } @@ -253,7 +253,7 @@ public default void visit(Extension extension) { if (extension == null) { return; } - visit(extension.getRefersTo()); + extension.getRefersTo().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(extension); } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java index 298f531f2..4bff227da 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java @@ -226,9 +226,6 @@ public default void visit(SpecificAssetId identifierKeyValuePair) { public default void visit(Key key) { } - public default void visit(LangString langString) { - } - public default void visit(MultiLanguageProperty multiLanguageProperty) { } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java index e4600c045..998826fee 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -214,7 +214,7 @@ public default void visit(Entity entity) { return; } //visit(entity.getGlobalAssetId()); - visit(entity.getSpecificAssetId()); + entity.getSpecificAssetIds().forEach(x -> visit(x)); entity.getStatements().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(entity); } @@ -224,7 +224,7 @@ public default void visit(Extension extension) { if (extension == null) { return; } - visit(extension.getRefersTo()); + extension.getRefersTo().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(extension); } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 3fa4dc987..527b0f4c3 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -171,7 +171,7 @@ public static Submodel createSubmodel1() { .version("0.9") .revision("0") .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -251,7 +251,7 @@ public static Submodel createSubmodel2() { .administration(new DefaultAdministrativeInformation.Builder() .version("0.9") .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -353,7 +353,7 @@ public static Submodel createSubmodel3() { .version("0.9") .revision("0") .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) @@ -451,7 +451,6 @@ public static Submodel createSubmodel3() { .type(ReferenceTypes.MODEL_REFERENCE) .build()) .annotations(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .idShort("ExampleProperty3") .category("PARAMETER") .value("some example annotation") @@ -460,7 +459,6 @@ public static Submodel createSubmodel3() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .category("PARAMETER") .description(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), @@ -769,7 +767,7 @@ public static Submodel createSubmodel4() { return new DefaultSubmodel.Builder() .idShort("Test_Submodel_Mandatory") .id("https://acplt.org/Test_Submodel_Mandatory") - .kind(ModelingKind.TEMPLATE) + .kind(ModellingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .first(new DefaultReference.Builder() @@ -838,7 +836,6 @@ public static Submodel createSubmodel4() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .build()) .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") @@ -906,7 +903,7 @@ public static Submodel createSubmodel4() { public static Submodel createSubmodel5() { return new DefaultSubmodel.Builder() .idShort("Test_Submodel2_Mandatory") - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .id("https://acplt.org/Test_Submodel2_Mandatory") .build(); } @@ -919,7 +916,7 @@ public static Submodel createSubmodel6() { new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Missing") - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .administration(new DefaultAdministrativeInformation.Builder() .version("0.9") .revision("0").build()) @@ -1020,7 +1017,6 @@ public static Submodel createSubmodel6() { .type(ReferenceTypes.MODEL_REFERENCE) .build()) .annotations(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .idShort("ExampleProperty") .category("PARAMETER") .value("some example annotation") @@ -1029,7 +1025,6 @@ public static Submodel createSubmodel6() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .category("PARAMETER") .description(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), @@ -1324,7 +1319,7 @@ public static Submodel createSubmodel7() { new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Template") - .kind(ModelingKind.TEMPLATE) + .kind(ModellingKind.TEMPLATE) .administration(new DefaultAdministrativeInformation.Builder() .version("0.9") .revision("0") @@ -1336,7 +1331,7 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) + .kind(ModellingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") @@ -1351,7 +1346,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1397,7 +1391,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1431,7 +1424,6 @@ public static Submodel createSubmodel7() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .category("PARAMETER") .description(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), @@ -1444,7 +1436,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty") @@ -1460,7 +1451,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1480,7 +1470,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1500,7 +1489,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1520,7 +1508,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .submodelElements(new DefaultBasicEventElement.Builder() .idShort("ExampleBasicEvent") @@ -1538,7 +1525,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1570,7 +1556,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") @@ -1586,7 +1571,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1604,7 +1588,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") @@ -1620,7 +1603,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .min(null) .max("100") .valueType(DataTypeDefXsd.INT) @@ -1639,7 +1621,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .min("0") .max(null) .valueType(DataTypeDefXsd.INT) @@ -1659,7 +1640,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") @@ -1674,7 +1654,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .contentType("application/pdf") .build()) .value(new DefaultFile.Builder() @@ -1691,7 +1670,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .contentType("application/pdf") .build()) @@ -1709,7 +1687,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() @@ -1726,7 +1703,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .build(); } @@ -1800,14 +1776,14 @@ public static ConceptDescription createConceptDescription4() { .build()) .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() .preferredName(Arrays.asList( - new DefaultLangString.Builder().text("Test Specification").language("de").build(), - new DefaultLangString.Builder().text("TestSpecification").language("en-us").build() + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() )) .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangString.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) - .definition(new DefaultLangString.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) - .shortName(new DefaultLangString.Builder().text("Test Spec").language("de").build()) - .shortName(new DefaultLangString.Builder().text("TestSpec").language("en-us").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) .unit("SpaceUnit") .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index 2347000a1..158b8eb36 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -19,6 +19,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import java.util.Arrays; + public class AASSimple { @@ -125,10 +127,10 @@ public static AssetAdministrationShell createAAS() { .name(EQUIPMENT_ID) .value(_538FD1B3_F99F_4A52_9C75_72E9FA921270) .externalSubjectId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() + .keys(Arrays.asList(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_ERP_012) - .build()) + .build())) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) @@ -184,11 +186,10 @@ public static Submodel createSubmodelTechnicalData() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .idShort(SUBMODEL_TECHNICAL_DATA_ID_SHORT) .id(SUBMODEL_TECHNICAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) @@ -206,11 +207,10 @@ public static Submodel createSubmodelTechnicalData() { public static Submodel createSubmodelOperationalData() { return new DefaultSubmodel.Builder() - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .idShort(SUBMODEL_OPERATIONAL_DATA_ID_SHORT) .id(SUBMODEL_OPERATIONAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) @@ -228,11 +228,10 @@ public static Submodel createSubmodelOperationalData() { public static Submodel createSubmodelDocumentation() { return new DefaultSubmodel.Builder() - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .idShort(SUBMODEL_DOCUMENTATION_ID_SHORT) .id(SUBMODEL_DOCUMENTATION_ID) .submodelElements(new DefaultSubmodelElementCollection.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) @@ -242,7 +241,6 @@ public static Submodel createSubmodelDocumentation() { .build()) .idShort(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_ID_SHORT) .value(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) @@ -255,7 +253,6 @@ public static Submodel createSubmodelDocumentation() { .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultFile.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) @@ -286,14 +283,14 @@ public static ConceptDescription createConceptDescriptionTitle() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) - .preferredName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) - .shortName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(TITLE).language("EN").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(TITEL).language("DE").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(TITLE).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(TITEL).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") .dataType(DataTypeIec61360.STRING_TRANSLATABLE) - .definition(new DefaultLangString.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) .build()) .build()) .build(); @@ -313,14 +310,14 @@ public static ConceptDescription createConceptDescriptionDigitalFile() { .build()) .dataSpecificationContent( new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) - .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DIGITALE_DATEI).language("DE").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DIGITALE_DATEI).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") .dataType(DataTypeIec61360.STRING) - .definition(new DefaultLangString.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) .build()) .build()) .build(); @@ -344,8 +341,8 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangString.Builder().text(MAX_DREHZAHL).language("de").build()) - .preferredName(new DefaultLangString.Builder().text(MAX_ROTATIONSPEED).language("en").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_DREHZAHL).language("de").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_ROTATIONSPEED).language("en").build()) .unit(_1_MIN) .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -356,8 +353,8 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .build()) .sourceOfDefinition("ExampleString") .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) - .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) .build()) .build()) .build(); @@ -379,10 +376,10 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .build()) .dataSpecificationContent( new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) - .preferredName(new DefaultLangString.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) - .shortName(new DefaultLangString.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) .unit(_1_MIN) .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -393,8 +390,8 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .build()) .sourceOfDefinition("ExampleString") .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) - .definition(new DefaultLangString.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) .build()) .build()) .build(); @@ -413,13 +410,13 @@ public static ConceptDescription createConceptDescriptionDocument() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DOKUMENT).language("DE").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DOCUMENT).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DOCUMENT).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DOKUMENT).language("DE").build()) .unit("ExampleString") .sourceOfDefinition(ISO15519_1_2010) .dataType(DataTypeIec61360.STRING) - .definition(new DefaultLangString.Builder().text(DOCUMENT_DEF).language("EN").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(DOCUMENT_DEF).language("EN").build()) .build()) .build()) .build(); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java index 3178bad56..055ba67ba 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java @@ -28,8 +28,6 @@ public class CustomProperty implements Property { protected List dataSpecifications; - protected ModelingKind kind; - protected Reference semanticId; protected String value; @@ -58,7 +56,7 @@ protected CustomProperty() { @Override public int hashCode() { return Objects.hash(new Object[] { this.valueType, this.value, this.valueId, this.category, this.description, - this.displayName, this.idShort, this.qualifiers, /* this.embeddedDataSpecifications,*/ this.kind, + this.displayName, this.idShort, this.qualifiers, /* this.embeddedDataSpecifications, this.kind,*/ this.semanticId }); } @@ -78,7 +76,8 @@ public boolean equals(Object obj) { && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.qualifiers, other.qualifiers) // TODO && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) - && Objects.equals(this.kind, other.kind) && Objects.equals(this.semanticId, other.semanticId); + //&& Objects.equals(this.kind, other.kind) + && Objects.equals(this.semanticId, other.semanticId); } } @@ -132,16 +131,6 @@ final public void setDescription(List description) { this.description = description; } - @Override - public String getChecksum() { - return null; - } - - @Override - public void setChecksum(String checksum) { - - } - @Override final public List getDisplayName() { return displayName; @@ -182,16 +171,6 @@ final public void setEmbeddedDataSpecifications(List this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - final public ModelingKind getKind() { - return kind; - } - - @Override - final public void setKind(ModelingKind kind) { - this.kind = kind; - } - @Override final public Reference getSemanticId() { return semanticId; diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 23ebcab8f..29a67e198 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -21,7 +21,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; -import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import org.junit.Assert; import org.junit.Before; @@ -82,8 +82,8 @@ public void whenSerializingEnum_usingStateOfEvent_shouldReturnUpperCase() { @Test public void whenSerializingEnum_usingModelingKind_shouldReturnCamelCase() { - assertSerialization(ModelingKind.INSTANCE, "Instance"); - assertSerialization(ModelingKind.TEMPLATE, "Template"); + assertSerialization(ModellingKind.INSTANCE, "Instance"); + assertSerialization(ModellingKind.TEMPLATE, "Template"); } private void assertSerialization(Enum value, String expected) { this.serializationOutput.setLength(0); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java index 1ee6cc058..3c7f5e350 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java @@ -60,7 +60,7 @@ private void serializeLangString(ToXmlGenerator xgen, LangString langString) thr xgen.writeString(langString.getLanguage()); xgen.writeFieldName("text"); - xgen.writeString(langString.getText()); + xgen.writeString(langString.getValue()); xgen.writeEndObject(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java index 897fab65f..311f54a79 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,87 +28,87 @@ public enum AasSubmodelElements { /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/AnnotatedRelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/AnnotatedRelationshipElement") ANNOTATED_RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/BasicEventElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/BasicEventElement") BASIC_EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Blob") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Blob") BLOB, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Capability") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Capability") CAPABILITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/DataElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/DataElement") DATA_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Entity") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Entity") ENTITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/EventElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/EventElement") EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/File") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/File") FILE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/MultiLanguageProperty") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/MultiLanguageProperty") MULTI_LANGUAGE_PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Operation") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Operation") OPERATION, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Property") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Property") PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Range") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Range") RANGE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/ReferenceElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/ReferenceElement") REFERENCE_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/RelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/RelationshipElement") RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/SubmodelElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElement") SUBMODEL_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/SubmodelElementCollection") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElementCollection") SUBMODEL_ELEMENT_COLLECTION, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/SubmodelElementList") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElementList") SUBMODEL_ELEMENT_LIST; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java index fe6b51a24..7689f9526 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java index fc1808716..25e8457fd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,42 +29,80 @@ }) public interface AdministrativeInformation extends HasDataSpecification { + /** + * Version of the element. + * + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version + * + * @return Returns the String for the property version. + */ + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") + String getVersion(); + + /** + * Version of the element. + * + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version + * + * @param version desired value for the property version. + */ + void setVersion(String version); + /** * Revision of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/revision * * @return Returns the String for the property revision. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/revision") String getRevision(); /** * Revision of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/revision * * @param revision desired value for the property revision. */ void setRevision(String revision); /** - * Version of the element. + * The subject ID of the subject responsible for making the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator * - * @return Returns the String for the property version. + * @return Returns the Reference for the property creator. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") - String getVersion(); + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/creator") + Reference getCreator(); /** - * Version of the element. + * The subject ID of the subject responsible for making the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator * - * @param version desired value for the property version. + * @param creator desired value for the property creator. */ - void setVersion(String version); + void setCreator(Reference creator); + + /** + * Identifier of the template that guided the creation of the element. + * + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId + * + * @return Returns the String for the property templateId. + */ + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId") + String getTemplateId(); + + /** + * Identifier of the template that guided the creation of the element. + * + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId + * + * @param templateId desired value for the property templateId. + */ + void setTemplateId(String templateId); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java index b99fa839e..987cc7a15 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -35,20 +35,18 @@ public interface AnnotatedRelationshipElement extends RelationshipElement { * A data element that represents an annotation that holds for the relationship between the two * elements * - * More information under - * https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations + * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations * * @return Returns the List of DataElements for the property annotations. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations") + @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations") List getAnnotations(); /** * A data element that represents an annotation that holds for the relationship between the two * elements * - * More information under - * https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations + * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations * * @param annotations desired value for the property annotations. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java index 05483cef1..2b51a7a67 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,59 +31,57 @@ public interface AssetAdministrationShell extends HasDataSpecification, Identifiable { /** - * Meta-information about the asset the AAS is representing. + * The reference to the AAS the AAS was derived from. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom * - * @return Returns the AssetInformation for the property assetInformation. + * @return Returns the Reference for the property derivedFrom. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") - AssetInformation getAssetInformation(); + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom") + Reference getDerivedFrom(); /** - * Meta-information about the asset the AAS is representing. + * The reference to the AAS the AAS was derived from. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom * - * @param assetInformation desired value for the property assetInformation. + * @param derivedFrom desired value for the property derivedFrom. */ - void setAssetInformation(AssetInformation assetInformation); + void setDerivedFrom(Reference derivedFrom); /** - * The reference to the AAS the AAS was derived from. + * Meta-information about the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation * - * @return Returns the Reference for the property derivedFrom. + * @return Returns the AssetInformation for the property assetInformation. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") - Reference getDerivedFrom(); + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation") + AssetInformation getAssetInformation(); /** - * The reference to the AAS the AAS was derived from. + * Meta-information about the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation * - * @param derivedFrom desired value for the property derivedFrom. + * @param assetInformation desired value for the property assetInformation. */ - void setDerivedFrom(Reference derivedFrom); + void setAssetInformation(AssetInformation assetInformation); /** * References to submodels of the AAS. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels * * @return Returns the List of References for the property submodels. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels") List getSubmodels(); /** * References to submodels of the AAS. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels * * @param submodels desired value for the property submodels. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java index 0664d8bed..61ce8f421 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,55 +34,36 @@ public interface AssetInformation { /** * Denotes whether the Asset is of kind 'Type' or 'Instance'. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind + * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetKind * * @return Returns the AssetKind for the property assetKind. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetKind") AssetKind getAssetKind(); /** * Denotes whether the Asset is of kind 'Type' or 'Instance'. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind + * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetKind * * @param assetKind desired value for the property assetKind. */ void setAssetKind(AssetKind assetKind); - /** - * Thumbnail of the asset represented by the Asset Administration Shell. - * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail - * - * @return Returns the Resource for the property defaultThumbnail. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") - Resource getDefaultThumbnail(); - - /** - * Thumbnail of the asset represented by the Asset Administration Shell. - * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail - * - * @param defaultThumbnail desired value for the property defaultThumbnail. - */ - void setDefaultThumbnail(Resource defaultThumbnail); - /** * Global identifier of the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId + * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId * - * @return Returns the Reference for the property globalAssetId. + * @return Returns the String for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId") String getGlobalAssetId(); /** * Global identifier of the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId + * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId * * @param globalAssetId desired value for the property globalAssetId. */ @@ -92,21 +73,61 @@ public interface AssetInformation { * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial * number etc. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds * * @return Returns the List of SpecificAssetIds for the property specificAssetIds. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") List getSpecificAssetIds(); /** * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial * number etc. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds * * @param specificAssetIds desired value for the property specificAssetIds. */ void setSpecificAssetIds(List specificAssetIds); + /** + * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset + * under consideration as identified by 'globalAssetId'. + * + * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType + * + * @return Returns the String for the property assetType. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetType") + String getAssetType(); + + /** + * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset + * under consideration as identified by 'globalAssetId'. + * + * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType + * + * @param assetType desired value for the property assetType. + */ + void setAssetType(String assetType); + + /** + * Thumbnail of the asset represented by the Asset Administration Shell. + * + * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail + * + * @return Returns the Resource for the property defaultThumbnail. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") + Resource getDefaultThumbnail(); + + /** + * Thumbnail of the asset represented by the Asset Administration Shell. + * + * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail + * + * @param defaultThumbnail desired value for the property defaultThumbnail. + */ + void setDefaultThumbnail(Resource defaultThumbnail); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java index a781efe26..80401d406 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -27,16 +27,21 @@ public enum AssetKind { /** - * concrete, clearly identifiable component of a certain type + * Instance asset */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetKind/Instance") + @IRI("https://admin-shell.io/aas/3/0/AssetKind/Instance") INSTANCE, /** - * hardware or software element which specifies the common attributes shared by all instances of the - * type + * Neither a type asset nor an instance asset + */ + @IRI("https://admin-shell.io/aas/3/0/AssetKind/NotApplicable") + NOT_APPLICABLE, + + /** + * Type asset */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetKind/Type") + @IRI("https://admin-shell.io/aas/3/0/AssetKind/Type") TYPE; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java index 9393d184c..b4544ceef 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,73 +29,96 @@ }) public interface BasicEventElement extends EventElement { + /** + * Reference to the 'Referable', which defines the scope of the event. Can be + * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed + * + * @return Returns the Reference for the property observed. + */ + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/observed") + Reference getObserved(); + + /** + * Reference to the 'Referable', which defines the scope of the event. Can be + * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed + * + * @param observed desired value for the property observed. + */ + void setObserved(Reference observed); + /** * Direction of event. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/direction * * @return Returns the Direction for the property direction. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/direction") Direction getDirection(); /** * Direction of event. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/direction * * @param direction desired value for the property direction. */ void setDirection(Direction direction); /** - * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). + * State of event. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state * - * @return Returns the String for the property lastUpdate. + * @return Returns the StateOfEvent for the property state. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") - String getLastUpdate(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/state") + StateOfEvent getState(); /** - * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). + * State of event. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state * - * @param lastUpdate desired value for the property lastUpdate. + * @param state desired value for the property state. */ - void setLastUpdate(String lastUpdate); + void setState(StateOfEvent state); /** - * For input direction: not applicable. + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic * - * @return Returns the String for the property maxInterval. + * @return Returns the String for the property messageTopic. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") - String getMaxInterval(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic") + String getMessageTopic(); /** - * For input direction: not applicable. + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic * - * @param maxInterval desired value for the property maxInterval. + * @param messageTopic desired value for the property messageTopic. */ - void setMaxInterval(String maxInterval); + void setMessageTopic(String messageTopic); /** * Information, which outer message infrastructure shall handle messages for the 'EventElement'. * Refers to a 'Submodel', 'SubmodelElementList', 'SubmodelElementCollection' or 'Entity', which * contains 'DataElement''s describing the proprietary specification for the message broker. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker * * @return Returns the Reference for the property messageBroker. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker") Reference getMessageBroker(); /** @@ -103,92 +126,69 @@ public interface BasicEventElement extends EventElement { * Refers to a 'Submodel', 'SubmodelElementList', 'SubmodelElementCollection' or 'Entity', which * contains 'DataElement''s describing the proprietary specification for the message broker. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker * * @param messageBroker desired value for the property messageBroker. */ void setMessageBroker(Reference messageBroker); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate * - * @return Returns the String for the property messageTopic. + * @return Returns the String for the property lastUpdate. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") - String getMessageTopic(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate") + String getLastUpdate(); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate * - * @param messageTopic desired value for the property messageTopic. + * @param lastUpdate desired value for the property lastUpdate. */ - void setMessageTopic(String messageTopic); + void setLastUpdate(String lastUpdate); /** * For input direction, reports on the maximum frequency, the software entity behind the respective * Referable can handle input events. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/minInterval * * @return Returns the String for the property minInterval. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/minInterval") String getMinInterval(); /** * For input direction, reports on the maximum frequency, the software entity behind the respective * Referable can handle input events. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/minInterval * * @param minInterval desired value for the property minInterval. */ void setMinInterval(String minInterval); /** - * Reference to the 'Referable', which defines the scope of the event. Can be - * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. - * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed - * - * @return Returns the Reference for the property observed. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") - Reference getObserved(); - - /** - * Reference to the 'Referable', which defines the scope of the event. Can be - * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. - * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed - * - * @param observed desired value for the property observed. - */ - void setObserved(Reference observed); - - /** - * State of event. + * For input direction: not applicable. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval * - * @return Returns the StateOfEvent for the property state. + * @return Returns the String for the property maxInterval. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") - StateOfEvent getState(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval") + String getMaxInterval(); /** - * State of event. + * For input direction: not applicable. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval * - * @param state desired value for the property state. + * @param maxInterval desired value for the property maxInterval. */ - void setState(StateOfEvent state); + void setMaxInterval(String maxInterval); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java index 597dfcb1f..1edb58bed 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,41 +31,41 @@ public interface Blob extends DataElement { /** - * Content type of the content of the 'Blob'. + * The value of the 'Blob' instance of a blob data element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Blob/contentType + * More information under https://admin-shell.io/aas/3/0/Blob/value * - * @return Returns the String for the property contentType. + * @return Returns the byte[] for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/Blob/value") + byte[] getValue(); /** - * Content type of the content of the 'Blob'. + * The value of the 'Blob' instance of a blob data element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Blob/contentType + * More information under https://admin-shell.io/aas/3/0/Blob/value * - * @param contentType desired value for the property contentType. + * @param value desired value for the property value. */ - void setContentType(String contentType); + void setValue(byte[] value); /** - * The value of the 'Blob' instance of a blob data element. + * Content type of the content of the 'Blob'. * - * More information under https://admin-shell.io/aas/3/0/RC02/Blob/value + * More information under https://admin-shell.io/aas/3/0/Blob/contentType * - * @return Returns the byte[] for the property value. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/value") - byte[] getValue(); + @IRI("https://admin-shell.io/aas/3/0/Blob/contentType") + String getContentType(); /** - * The value of the 'Blob' instance of a blob data element. + * Content type of the content of the 'Blob'. * - * More information under https://admin-shell.io/aas/3/0/RC02/Blob/value + * More information under https://admin-shell.io/aas/3/0/Blob/contentType * - * @param value desired value for the property value. + * @param contentType desired value for the property contentType. */ - void setValue(byte[] value); + void setContentType(String contentType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java index de73e72cf..0dc242c2f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java index 483e61428..724d31fed 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,20 +34,20 @@ public interface ConceptDescription extends HasDataSpecification, Identifiable { /** * Reference to an external definition the concept is compatible to or was derived from. * - * More information under https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf + * More information under https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf * * @return Returns the List of References for the property isCaseOf. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") + @IRI("https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf") List getIsCaseOf(); /** * Reference to an external definition the concept is compatible to or was derived from. * - * More information under https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf + * More information under https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf * - * @param isCaseOf desired value for the property isCaseOf. + * @param isCaseOfs desired value for the property isCaseOf. */ - void setIsCaseOf(List isCaseOf); + void setIsCaseOf(List isCaseOfs); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java index 4b2208252..628d658af 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java index 2a5a59ae6..e2933c187 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -26,8 +26,7 @@ * and meta information about the template itself. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DataSpecificationIec61360.class), - @KnownSubtypes.Type(value = DataSpecificationPhysicalUnit.class) + @KnownSubtypes.Type(value = DataSpecificationIec61360.class) }) public interface DataSpecificationContent { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java index 1ab999fd6..182a70102 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,118 +32,97 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { /** - * Data Type - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType - * - * @return Returns the DataTypeIec61360 for the property dataType. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType") - DataTypeIec61360 getDataType(); - - /** - * Data Type - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType - * - * @param dataType desired value for the property dataType. - */ - void setDataType(DataTypeIec61360 dataType); - - /** - * Definition in different languages + * Preferred name * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName * - * @return Returns the List of LangStrings for the property definition. + * @return Returns the List of LangStringPreferredNameTypeIec61360s for the property preferredName. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition") - List getDefinition(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName") + List getPreferredName(); /** - * Definition in different languages + * Preferred name * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName * - * @param definition desired value for the property definition. + * @param preferredNames desired value for the property preferredName. */ - void setDefinition(List definition); + void setPreferredName(List preferredNames); /** - * Set of levels. + * Short name * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName * - * @return Returns the LevelType for the property levelType. + * @return Returns the List of LangStringShortNameTypeIec61360s for the property shortName. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType") - LevelType getLevelType(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName") + List getShortName(); /** - * Set of levels. + * Short name * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName * - * @param levelType desired value for the property levelType. + * @param shortNames desired value for the property shortName. */ - void setLevelType(LevelType levelType); + void setShortName(List shortNames); /** - * Preferred name + * Unit * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit * - * @return Returns the List of LangStrings for the property preferredName. + * @return Returns the String for the property unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName") - List getPreferredName(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit") + String getUnit(); /** - * Preferred name + * Unit * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit * - * @param preferredName desired value for the property preferredName. + * @param unit desired value for the property unit. */ - void setPreferredName(List preferredName); + void setUnit(String unit); /** - * Short name + * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId * - * @return Returns the List of LangStrings for the property shortName. + * @return Returns the Reference for the property unitId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName") - List getShortName(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId") + Reference getUnitId(); /** - * Short name + * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId * - * @param shortName desired value for the property shortName. + * @param unitId desired value for the property unitId. */ - void setShortName(List shortName); + void setUnitId(Reference unitId); /** * Source of definition * * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition + * https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition * * @return Returns the String for the property sourceOfDefinition. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition") String getSourceOfDefinition(); /** * Source of definition * * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition + * https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition * * @param sourceOfDefinition desired value for the property sourceOfDefinition. */ @@ -152,93 +131,74 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { /** * Symbol * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol * * @return Returns the String for the property symbol. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol") String getSymbol(); /** * Symbol * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol * * @param symbol desired value for the property symbol. */ void setSymbol(String symbol); /** - * Unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit - * - * @return Returns the String for the property unit. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit") - String getUnit(); - - /** - * Unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit - * - * @param unit desired value for the property unit. - */ - void setUnit(String unit); - - /** - * Unique unit id + * Data Type * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType * - * @return Returns the Reference for the property unitId. + * @return Returns the DataTypeIec61360 for the property dataType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId") - Reference getUnitId(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType") + DataTypeIec61360 getDataType(); /** - * Unique unit id + * Data Type * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType * - * @param unitId desired value for the property unitId. + * @param dataType desired value for the property dataType. */ - void setUnitId(Reference unitId); + void setDataType(DataTypeIec61360 dataType); /** - * Value + * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition * - * @return Returns the String for the property value. + * @return Returns the List of LangStringDefinitionTypeIec61360s for the property definition. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value") - String getValue(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition") + List getDefinition(); /** - * Value + * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition * - * @param value desired value for the property value. + * @param definitions desired value for the property definition. */ - void setValue(String value); + void setDefinition(List definitions); /** * Value Format * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat * * @return Returns the String for the property valueFormat. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat") String getValueFormat(); /** * Value Format * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat * * @param valueFormat desired value for the property valueFormat. */ @@ -247,20 +207,58 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { /** * List of allowed values * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList * * @return Returns the ValueList for the property valueList. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList") ValueList getValueList(); /** * List of allowed values * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList * * @param valueList desired value for the property valueList. */ void setValueList(ValueList valueList); + /** + * Value + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value + * + * @return Returns the String for the property value. + */ + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value") + String getValue(); + + /** + * Value + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value + * + * @param value desired value for the property value. + */ + void setValue(String value); + + /** + * Set of levels. + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType + * + * @return Returns the LevelType for the property levelType. + */ + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType") + LevelType getLevelType(); + + /** + * Set of levels. + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType + * + * @param levelType desired value for the property levelType. + */ + void setLevelType(LevelType levelType); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java deleted file mode 100644 index dc48bc871..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationPhysicalUnit; - -import java.util.List; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultDataSpecificationPhysicalUnit.class) -}) -public interface DataSpecificationPhysicalUnit extends DataSpecificationContent { - - /** - * Conversion factor - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor - * - * @return Returns the String for the property conversionFactor. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") - String getConversionFactor(); - - /** - * Conversion factor - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor - * - * @param conversionFactor desired value for the property conversionFactor. - */ - void setConversionFactor(String conversionFactor); - - /** - * Definition in different languages - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition - * - * @return Returns the List of LangStrings for the property definition. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition") - List getDefinition(); - - /** - * Definition in different languages - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition - * - * @param definition desired value for the property definition. - */ - void setDefinition(List definition); - - /** - * Notation of physical unit conformant to DIN - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation - * - * @return Returns the String for the property dinNotation. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") - String getDinNotation(); - - /** - * Notation of physical unit conformant to DIN - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation - * - * @param dinNotation desired value for the property dinNotation. - */ - void setDinNotation(String dinNotation); - - /** - * Code of physical unit conformant to ECE - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode - * - * @return Returns the String for the property eceCode. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") - String getEceCode(); - - /** - * Code of physical unit conformant to ECE - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode - * - * @param eceCode desired value for the property eceCode. - */ - void setEceCode(String eceCode); - - /** - * Name of physical unit conformant to ECE - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName - * - * @return Returns the String for the property eceName. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName") - String getEceName(); - - /** - * Name of physical unit conformant to ECE - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName - * - * @param eceName desired value for the property eceName. - */ - void setEceName(String eceName); - - /** - * Name of NIST physical unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName - * - * @return Returns the String for the property nistName. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName") - String getNistName(); - - /** - * Name of NIST physical unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName - * - * @param nistName desired value for the property nistName. - */ - void setNistName(String nistName); - - /** - * Registration authority ID - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId - * - * @return Returns the String for the property registrationAuthorityId. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") - String getRegistrationAuthorityId(); - - /** - * Registration authority ID - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId - * - * @param registrationAuthorityId desired value for the property registrationAuthorityId. - */ - void setRegistrationAuthorityId(String registrationAuthorityId); - - /** - * Name of SI physical unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName - * - * @return Returns the String for the property siName. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName") - String getSiName(); - - /** - * Name of SI physical unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName - * - * @param siName desired value for the property siName. - */ - void setSiName(String siName); - - /** - * Notation of SI physical unit - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation - * - * @return Returns the String for the property siNotation. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") - String getSiNotation(); - - /** - * Notation of SI physical unit - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation - * - * @param siNotation desired value for the property siNotation. - */ - void setSiNotation(String siNotation); - - /** - * Source of definition - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition - * - * @return Returns the String for the property sourceOfDefinition. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition") - String getSourceOfDefinition(); - - /** - * Source of definition - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition - * - * @param sourceOfDefinition desired value for the property sourceOfDefinition. - */ - void setSourceOfDefinition(String sourceOfDefinition); - - /** - * Supplier - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier - * - * @return Returns the String for the property supplier. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier") - String getSupplier(); - - /** - * Supplier - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier - * - * @param supplier desired value for the property supplier. - */ - void setSupplier(String supplier); - - /** - * Name of the physical unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName - * - * @return Returns the String for the property unitName. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName") - String getUnitName(); - - /** - * Name of the physical unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName - * - * @param unitName desired value for the property unitName. - */ - void setUnitName(String unitName); - - /** - * Symbol for the physical unit - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol - * - * @return Returns the String for the property unitSymbol. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") - String getUnitSymbol(); - - /** - * Symbol for the physical unit - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol - * - * @param unitSymbol desired value for the property unitSymbol. - */ - void setUnitSymbol(String unitSymbol); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java index 0b375631d..cb41effbd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -21,174 +21,159 @@ /** - * Enumeration listing all xsd anySimpleTypes + * Enumeration listing all XSD anySimpleTypes */ @IRI("aas:DataTypeDefXsd") public enum DataTypeDefXsd { /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/AnyUri") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/AnyUri") ANY_URI, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Base64Binary") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Base64Binary") BASE64BINARY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Boolean") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Boolean") BOOLEAN, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Byte") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Byte") BYTE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Date") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Date") DATE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/DateTime") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/DateTime") DATE_TIME, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/DateTimeStamp") - DATE_TIME_STAMP, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/DayTimeDuration") - DAY_TIME_DURATION, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Decimal") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Decimal") DECIMAL, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Double") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Double") DOUBLE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Duration") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Duration") DURATION, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Float") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Float") FLOAT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GDay") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/GDay") GDAY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GMonth") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/GMonth") GMONTH, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GMonthDay") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/GMonthDay") GMONTH_DAY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GYear") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/GYear") GYEAR, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GYearMonth") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/GYearMonth") GYEAR_MONTH, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/HexBinary") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/HexBinary") HEX_BINARY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Int") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Int") INT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Integer") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Integer") INTEGER, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Long") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Long") LONG, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/NegativeInteger") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/NegativeInteger") NEGATIVE_INTEGER, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/NonNegativeInteger") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/NonNegativeInteger") NON_NEGATIVE_INTEGER, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/NonPositiveInteger") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/NonPositiveInteger") NON_POSITIVE_INTEGER, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/PositiveInteger") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/PositiveInteger") POSITIVE_INTEGER, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Short") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Short") SHORT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/String") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/String") STRING, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Time") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Time") TIME, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedByte") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/UnsignedByte") UNSIGNED_BYTE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedInt") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/UnsignedInt") UNSIGNED_INT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedLong") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/UnsignedLong") UNSIGNED_LONG, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedShort") - UNSIGNED_SHORT, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/YearMonthDuration") - YEAR_MONTH_DURATION; + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/UnsignedShort") + UNSIGNED_SHORT; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java index fd884386a..d0ddfa144 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,123 +28,123 @@ public enum DataTypeIec61360 { /** * values containing the content of a file. Values may be binaries. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Blob") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Blob") BLOB, /** * values representing truth of logic or Boolean algebra (TRUE, FALSE) */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Boolean") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Boolean") BOOLEAN, /** * values containing a calendar date, conformant to ISO 8601:2004 Format yyyy-mm-dd Example from IEC * 61360-1:2017: "1999-05-31" is the [DATE] representation of: "31 May 1999". */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Date") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Date") DATE, /** * values containing an address to a file. The values are of type URI and can represent an absolute * or relative path. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/File") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/File") FILE, /** * Values containing string with any sequence of characters, using the syntax of HTML5 (see W3C * Recommendation 28:2014) */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Html") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Html") HTML, /** * values containing values of type INTEGER but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/IntegerCount") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerCount") INTEGER_COUNT, /** * values containing values of type INTEGER that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/IntegerCurrency") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerCurrency") INTEGER_CURRENCY, /** * values containing values that are measure of type INTEGER. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/IntegerMeasure") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerMeasure") INTEGER_MEASURE, /** * values conforming to ISO/IEC 11179 series global identifier sequences */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Irdi") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Irdi") IRDI, /** * values containing values of type STRING conformant to Rfc 3987 */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Iri") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Iri") IRI, /** * values containing values of type rational */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Rational") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Rational") RATIONAL, /** * values containing values of type rational. In addition such a value comes with a physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RationalMeasure") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RationalMeasure") RATIONAL_MEASURE, /** * values containing numbers that can be written as a terminating or non-terminating decimal; a * rational or irrational number but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RealCount") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealCount") REAL_COUNT, /** * values containing values of type REAL that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RealCurrency") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealCurrency") REAL_CURRENCY, /** * values containing values that are measures of type REAL. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RealMeasure") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealMeasure") REAL_MEASURE, /** * values consisting of sequence of characters but cannot be translated into other languages */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/String") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/String") STRING, /** * values containing string but shall be represented as different string in different languages */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/StringTranslatable") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/StringTranslatable") STRING_TRANSLATABLE, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Time") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Time") TIME, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Timestamp") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Timestamp") TIMESTAMP; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java index 0f510b76a..dcc154a6c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,13 +29,13 @@ public enum Direction { /** * Input direction. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Direction/Input") + @IRI("https://admin-shell.io/aas/3/0/Direction/Input") INPUT, /** * Output direction */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Direction/Output") + @IRI("https://admin-shell.io/aas/3/0/Direction/Output") OUTPUT; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java index 67673ab64..48c3a2ccb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,19 +32,17 @@ public interface EmbeddedDataSpecification { /** * Reference to the data specification * - * More information under - * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification + * More information under https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification * * @return Returns the Reference for the property dataSpecification. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") + @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification") Reference getDataSpecification(); /** * Reference to the data specification * - * More information under - * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification + * More information under https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification * * @param dataSpecification desired value for the property dataSpecification. */ @@ -54,18 +52,18 @@ public interface EmbeddedDataSpecification { * Actual content of the data specification * * More information under - * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent + * https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent * * @return Returns the DataSpecificationContent for the property dataSpecificationContent. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") + @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent") DataSpecificationContent getDataSpecificationContent(); /** * Actual content of the data specification * * More information under - * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent + * https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent * * @param dataSpecificationContent desired value for the property dataSpecificationContent. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java index 77ca80168..c29c453e2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,20 +30,41 @@ }) public interface Entity extends SubmodelElement { + /** + * Describes statements applicable to the entity by a set of submodel elements, typically with a + * qualified value. + * + * More information under https://admin-shell.io/aas/3/0/Entity/statements + * + * @return Returns the List of SubmodelElements for the property statements. + */ + @IRI("https://admin-shell.io/aas/3/0/Entity/statements") + List getStatements(); + + /** + * Describes statements applicable to the entity by a set of submodel elements, typically with a + * qualified value. + * + * More information under https://admin-shell.io/aas/3/0/Entity/statements + * + * @param statements desired value for the property statements. + */ + void setStatements(List statements); + /** * Describes whether the entity is a co-managed entity or a self-managed entity. * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/entityType + * More information under https://admin-shell.io/aas/3/0/Entity/entityType * * @return Returns the EntityType for the property entityType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") + @IRI("https://admin-shell.io/aas/3/0/Entity/entityType") EntityType getEntityType(); /** * Describes whether the entity is a co-managed entity or a self-managed entity. * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/entityType + * More information under https://admin-shell.io/aas/3/0/Entity/entityType * * @param entityType desired value for the property entityType. */ @@ -52,17 +73,17 @@ public interface Entity extends SubmodelElement { /** * Global identifier of the asset the entity is representing. * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId + * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetId * - * @return Returns the Reference for the property globalAssetId. + * @return Returns the String for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") + @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetId") String getGlobalAssetId(); /** * Global identifier of the asset the entity is representing. * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId + * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetId * * @param globalAssetId desired value for the property globalAssetId. */ @@ -72,42 +93,21 @@ public interface Entity extends SubmodelElement { * Reference to a specific asset ID representing a supplementary identifier of the asset represented * by the Asset Administration Shell. * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId + * More information under https://admin-shell.io/aas/3/0/Entity/specificAssetIds * - * @return Returns the SpecificAssetId for the property specificAssetId. + * @return Returns the List of SpecificAssetIds for the property specificAssetIds. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") - SpecificAssetId getSpecificAssetId(); + @IRI("https://admin-shell.io/aas/3/0/Entity/specificAssetIds") + List getSpecificAssetIds(); /** * Reference to a specific asset ID representing a supplementary identifier of the asset represented * by the Asset Administration Shell. * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId + * More information under https://admin-shell.io/aas/3/0/Entity/specificAssetIds * - * @param specificAssetId desired value for the property specificAssetId. + * @param specificAssetIds desired value for the property specificAssetIds. */ - void setSpecificAssetId(SpecificAssetId specificAssetId); - - /** - * Describes statements applicable to the entity by a set of submodel elements, typically with a - * qualified value. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/statements - * - * @return Returns the List of SubmodelElements for the property statements. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/statements") - List getStatements(); - - /** - * Describes statements applicable to the entity by a set of submodel elements, typically with a - * qualified value. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/statements - * - * @param statements desired value for the property statements. - */ - void setStatements(List statements); + void setSpecificAssetIds(List specificAssetIds); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java index 137e66dde..233102815 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,14 +30,14 @@ public enum EntityType { * For co-managed entities there is no separate AAS. Co-managed entities need to be part of a * self-managed entity. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EntityType/CoManagedEntity") + @IRI("https://admin-shell.io/aas/3/0/EntityType/CoManagedEntity") CO_MANAGED_ENTITY, /** * Self-Managed Entities have their own AAS but can be part of the bill of material of a composite * self-managed entity. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EntityType/SelfManagedEntity") + @IRI("https://admin-shell.io/aas/3/0/EntityType/SelfManagedEntity") SELF_MANAGED_ENTITY; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java index 5ea7ac571..e41524972 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,58 +33,58 @@ public interface Environment { /** * Asset administration shell * - * More information under https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells + * More information under https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells * * @return Returns the List of AssetAdministrationShells for the property assetAdministrationShells. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") + @IRI("https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells") List getAssetAdministrationShells(); /** * Asset administration shell * - * More information under https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells + * More information under https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells * * @param assetAdministrationShells desired value for the property assetAdministrationShells. */ void setAssetAdministrationShells(List assetAdministrationShells); /** - * Concept description + * Submodel * - * More information under https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions + * More information under https://admin-shell.io/aas/3/0/Environment/submodels * - * @return Returns the List of ConceptDescriptions for the property conceptDescriptions. + * @return Returns the List of Submodels for the property submodels. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") - List getConceptDescriptions(); + @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") + List getSubmodels(); /** - * Concept description + * Submodel * - * More information under https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions + * More information under https://admin-shell.io/aas/3/0/Environment/submodels * - * @param conceptDescriptions desired value for the property conceptDescriptions. + * @param submodels desired value for the property submodels. */ - void setConceptDescriptions(List conceptDescriptions); + void setSubmodels(List submodels); /** - * Submodel + * Concept description * - * More information under https://admin-shell.io/aas/3/0/RC02/Environment/submodels + * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions * - * @return Returns the List of Submodels for the property submodels. + * @return Returns the List of ConceptDescriptions for the property conceptDescriptions. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") - List getSubmodels(); + @IRI("https://admin-shell.io/aas/3/0/Environment/conceptDescriptions") + List getConceptDescriptions(); /** - * Submodel + * Concept description * - * More information under https://admin-shell.io/aas/3/0/RC02/Environment/submodels + * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions * - * @param submodels desired value for the property submodels. + * @param conceptDescriptions desired value for the property conceptDescriptions. */ - void setSubmodels(List submodels); + void setConceptDescriptions(List conceptDescriptions); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java index 074938c82..a134a0289 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java index ab5677f03..42720b37c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,116 +30,118 @@ public interface EventPayload { /** - * Reference to the referable, which defines the scope of the event. + * Reference to the source event element, including identification of 'AssetAdministrationShell', + * 'Submodel', 'SubmodelElement''s. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference + * More information under https://admin-shell.io/aas/3/0/EventPayload/source * - * @return Returns the Reference for the property observableReference. + * @return Returns the Reference for the property source. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference") - Reference getObservableReference(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") + Reference getSource(); /** - * Reference to the referable, which defines the scope of the event. + * Reference to the source event element, including identification of 'AssetAdministrationShell', + * 'Submodel', 'SubmodelElement''s. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference + * More information under https://admin-shell.io/aas/3/0/EventPayload/source * - * @param observableReference desired value for the property observableReference. + * @param source desired value for the property source. */ - void setObservableReference(Reference observableReference); + void setSource(Reference source); /** - * 'semanticId' of the referable which defines the scope of the event, if available. + * 'semanticId' of the source event element, if available * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId + * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId * - * @return Returns the Reference for the property observableSemanticId. + * @return Returns the Reference for the property sourceSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId") - Reference getObservableSemanticId(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId") + Reference getSourceSemanticId(); /** - * 'semanticId' of the referable which defines the scope of the event, if available. + * 'semanticId' of the source event element, if available * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId + * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId * - * @param observableSemanticId desired value for the property observableSemanticId. + * @param sourceSemanticId desired value for the property sourceSemanticId. */ - void setObservableSemanticId(Reference observableSemanticId); + void setSourceSemanticId(Reference sourceSemanticId); /** - * Event specific payload. + * Reference to the referable, which defines the scope of the event. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/payload + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference * - * @return Returns the String for the property payload. + * @return Returns the Reference for the property observableReference. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/payload") - String getPayload(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") + Reference getObservableReference(); /** - * Event specific payload. + * Reference to the referable, which defines the scope of the event. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/payload + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference * - * @param payload desired value for the property payload. + * @param observableReference desired value for the property observableReference. */ - void setPayload(String payload); + void setObservableReference(Reference observableReference); /** - * Reference to the source event element, including identification of 'AssetAdministrationShell', - * 'Submodel', 'SubmodelElement''s. + * 'semanticId' of the referable which defines the scope of the event, if available. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/source + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId * - * @return Returns the Reference for the property source. + * @return Returns the Reference for the property observableSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/source") - Reference getSource(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId") + Reference getObservableSemanticId(); /** - * Reference to the source event element, including identification of 'AssetAdministrationShell', - * 'Submodel', 'SubmodelElement''s. + * 'semanticId' of the referable which defines the scope of the event, if available. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/source + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId * - * @param source desired value for the property source. + * @param observableSemanticId desired value for the property observableSemanticId. */ - void setSource(Reference source); + void setObservableSemanticId(Reference observableSemanticId); /** - * 'semanticId' of the source event element, if available + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId + * More information under https://admin-shell.io/aas/3/0/EventPayload/topic * - * @return Returns the Reference for the property sourceSemanticId. + * @return Returns the String for the property topic. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId") - Reference getSourceSemanticId(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") + String getTopic(); /** - * 'semanticId' of the source event element, if available + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId + * More information under https://admin-shell.io/aas/3/0/EventPayload/topic * - * @param sourceSemanticId desired value for the property sourceSemanticId. + * @param topic desired value for the property topic. */ - void setSourceSemanticId(Reference sourceSemanticId); + void setTopic(String topic); /** * Subject, who/which initiated the creation. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId + * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectId * * @return Returns the Reference for the property subjectId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectId") Reference getSubjectId(); /** * Subject, who/which initiated the creation. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId + * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectId * * @param subjectId desired value for the property subjectId. */ @@ -148,41 +150,39 @@ public interface EventPayload { /** * Timestamp in UTC, when this event was triggered. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp + * More information under https://admin-shell.io/aas/3/0/EventPayload/timeStamp * * @return Returns the String for the property timeStamp. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/timeStamp") String getTimeStamp(); /** * Timestamp in UTC, when this event was triggered. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp + * More information under https://admin-shell.io/aas/3/0/EventPayload/timeStamp * * @param timeStamp desired value for the property timeStamp. */ void setTimeStamp(String timeStamp); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Event specific payload. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/topic + * More information under https://admin-shell.io/aas/3/0/EventPayload/payload * - * @return Returns the String for the property topic. + * @return Returns the byte[] for the property payload. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/topic") - String getTopic(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") + byte[] getPayload(); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Event specific payload. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/topic + * More information under https://admin-shell.io/aas/3/0/EventPayload/payload * - * @param topic desired value for the property topic. + * @param payload desired value for the property payload. */ - void setTopic(String topic); + void setPayload(byte[] payload); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java index e8a30fcda..c3c5f2659 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,11 +15,12 @@ package org.eclipse.digitaltwin.aas4j.v3.model; - import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; +import java.util.List; + /** * Single extension of an element. @@ -32,77 +33,77 @@ public interface Extension extends HasSemantics { /** * Name of the extension. * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/name + * More information under https://admin-shell.io/aas/3/0/Extension/name * * @return Returns the String for the property name. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/name") + @IRI("https://admin-shell.io/aas/3/0/Extension/name") String getName(); /** * Name of the extension. * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/name + * More information under https://admin-shell.io/aas/3/0/Extension/name * * @param name desired value for the property name. */ void setName(String name); /** - * Reference to an element the extension refers to. + * Type of the value of the extension. * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/refersTo + * More information under https://admin-shell.io/aas/3/0/Extension/valueType * - * @return Returns the Reference for the property refersTo. + * @return Returns the DataTypeDefXsd for the property valueType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") - Reference getRefersTo(); + @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") + DataTypeDefXsd getValueType(); /** - * Reference to an element the extension refers to. + * Type of the value of the extension. * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/refersTo + * More information under https://admin-shell.io/aas/3/0/Extension/valueType * - * @param refersTo desired value for the property refersTo. + * @param valueType desired value for the property valueType. */ - void setRefersTo(Reference refersTo); + void setValueType(DataTypeDefXsd valueType); /** * Value of the extension * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/value + * More information under https://admin-shell.io/aas/3/0/Extension/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/value") + @IRI("https://admin-shell.io/aas/3/0/Extension/value") String getValue(); /** * Value of the extension * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/value + * More information under https://admin-shell.io/aas/3/0/Extension/value * * @param value desired value for the property value. */ void setValue(String value); /** - * Type of the value of the extension. + * Reference to an element the extension refers to. * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/valueType + * More information under https://admin-shell.io/aas/3/0/Extension/refersTo * - * @return Returns the DataTypeDefXsd for the property valueType. + * @return Returns the List of References for the property refersTo. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") - DataTypeDefXsd getValueType(); + @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") + List getRefersTo(); /** - * Type of the value of the extension. + * Reference to an element the extension refers to. * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/valueType + * More information under https://admin-shell.io/aas/3/0/Extension/refersTo * - * @param valueType desired value for the property valueType. + * @param refersTos desired value for the property refersTo. */ - void setValueType(DataTypeDefXsd valueType); + void setRefersTo(List refersTos); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java index b4a55cd82..ed40d2d1e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,41 +30,41 @@ public interface File extends DataElement { /** - * Content type of the content of the file. + * Path and name of the referenced file (with file extension). * - * More information under https://admin-shell.io/aas/3/0/RC02/File/contentType + * More information under https://admin-shell.io/aas/3/0/File/value * - * @return Returns the String for the property contentType. + * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/File/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/File/value") + String getValue(); /** - * Content type of the content of the file. + * Path and name of the referenced file (with file extension). * - * More information under https://admin-shell.io/aas/3/0/RC02/File/contentType + * More information under https://admin-shell.io/aas/3/0/File/value * - * @param contentType desired value for the property contentType. + * @param value desired value for the property value. */ - void setContentType(String contentType); + void setValue(String value); /** - * Path and name of the referenced file (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/RC02/File/value + * More information under https://admin-shell.io/aas/3/0/File/contentType * - * @return Returns the String for the property value. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/File/value") - String getValue(); + @IRI("https://admin-shell.io/aas/3/0/File/contentType") + String getContentType(); /** - * Path and name of the referenced file (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/RC02/File/value + * More information under https://admin-shell.io/aas/3/0/File/contentType * - * @param value desired value for the property value. + * @param contentType desired value for the property contentType. */ - void setValue(String value); + void setContentType(String contentType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java index e4c2c5f05..5887c38e5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -27,8 +27,8 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = AdministrativeInformation.class), @KnownSubtypes.Type(value = AssetAdministrationShell.class), - @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = ConceptDescription.class), + @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class) }) public interface HasDataSpecification { @@ -37,19 +37,19 @@ public interface HasDataSpecification { * Embedded data specification. * * More information under - * https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications + * https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications * * @return Returns the List of EmbeddedDataSpecifications for the property * embeddedDataSpecifications. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") List getEmbeddedDataSpecifications(); /** * Embedded data specification. * * More information under - * https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications + * https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications * * @param embeddedDataSpecifications desired value for the property embeddedDataSpecifications. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java index 13fb36c83..761b5baca 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,17 +32,17 @@ public interface HasExtensions { /** * An extension of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions + * More information under https://admin-shell.io/aas/3/0/HasExtensions/extensions * * @return Returns the List of Extensions for the property extensions. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") List getExtensions(); /** * An extension of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions + * More information under https://admin-shell.io/aas/3/0/HasExtensions/extensions * * @param extensions desired value for the property extensions. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java index 442566120..452c60ee1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -25,7 +25,6 @@ * An element with a kind is an element that can either represent a template or an instance. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class) }) public interface HasKind { @@ -33,20 +32,20 @@ public interface HasKind { /** * Kind of the element: either type or instance. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasKind/kind + * More information under https://admin-shell.io/aas/3/0/HasKind/kind * - * @return Returns the ModelingKind for the property kind. + * @return Returns the ModellingKind for the property kind. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - ModelingKind getKind(); + @IRI("https://admin-shell.io/aas/3/0/HasKind/kind") + ModellingKind getKind(); /** * Kind of the element: either type or instance. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasKind/kind + * More information under https://admin-shell.io/aas/3/0/HasKind/kind * * @param kind desired value for the property kind. */ - void setKind(ModelingKind kind); + void setKind(ModellingKind kind); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java index b3ad0078e..41f9b9978 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -37,18 +37,18 @@ public interface HasSemantics { * Identifier of the semantic definition of the element. It is called semantic ID of the element or * also main semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId + * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticId * * @return Returns the Reference for the property semanticId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") Reference getSemanticId(); /** * Identifier of the semantic definition of the element. It is called semantic ID of the element or * also main semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId + * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticId * * @param semanticId desired value for the property semanticId. */ @@ -58,18 +58,18 @@ public interface HasSemantics { * Identifier of a supplemental semantic definition of the element. It is called supplemental * semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds + * More information under https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds * * @return Returns the List of References for the property supplementalSemanticIds. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") List getSupplementalSemanticIds(); /** * Identifier of a supplemental semantic definition of the element. It is called supplemental * semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds + * More information under https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds * * @param supplementalSemanticIds desired value for the property supplementalSemanticIds. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java index f48661fd5..6cf22f3bf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,17 +34,17 @@ public interface Identifiable extends Referable { /** * Administrative information of an identifiable element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/administration + * More information under https://admin-shell.io/aas/3/0/Identifiable/administration * * @return Returns the AdministrativeInformation for the property administration. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") AdministrativeInformation getAdministration(); /** * Administrative information of an identifiable element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/administration + * More information under https://admin-shell.io/aas/3/0/Identifiable/administration * * @param administration desired value for the property administration. */ @@ -53,17 +53,17 @@ public interface Identifiable extends Referable { /** * The globally unique identification of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/id + * More information under https://admin-shell.io/aas/3/0/Identifiable/id * * @return Returns the String for the property id. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") String getId(); /** * The globally unique identification of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/id + * More information under https://admin-shell.io/aas/3/0/Identifiable/id * * @param id desired value for the property id. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java index 80ead008c..f91b08a96 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,17 +32,17 @@ public interface Key { /** * Denotes which kind of entity is referenced. * - * More information under https://admin-shell.io/aas/3/0/RC02/Key/type + * More information under https://admin-shell.io/aas/3/0/Key/type * * @return Returns the KeyTypes for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Key/type") + @IRI("https://admin-shell.io/aas/3/0/Key/type") KeyTypes getType(); /** * Denotes which kind of entity is referenced. * - * More information under https://admin-shell.io/aas/3/0/RC02/Key/type + * More information under https://admin-shell.io/aas/3/0/Key/type * * @param type desired value for the property type. */ @@ -51,17 +51,17 @@ public interface Key { /** * The key value, for example an IRDI or an URI * - * More information under https://admin-shell.io/aas/3/0/RC02/Key/value + * More information under https://admin-shell.io/aas/3/0/Key/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Key/value") + @IRI("https://admin-shell.io/aas/3/0/Key/value") String getValue(); /** * The key value, for example an IRDI or an URI * - * More information under https://admin-shell.io/aas/3/0/RC02/Key/value + * More information under https://admin-shell.io/aas/3/0/Key/value * * @param value desired value for the property value. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java index 5e6cec41e..84d18f137 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,133 +28,133 @@ public enum KeyTypes { /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/AnnotatedRelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/AnnotatedRelationshipElement") ANNOTATED_RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/AssetAdministrationShell") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/AssetAdministrationShell") ASSET_ADMINISTRATION_SHELL, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/BasicEventElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/BasicEventElement") BASIC_EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Blob") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Blob") BLOB, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Capability") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Capability") CAPABILITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/ConceptDescription") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/ConceptDescription") CONCEPT_DESCRIPTION, /** * Data element. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/DataElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/DataElement") DATA_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Entity") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Entity") ENTITY, /** * Event. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/EventElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/EventElement") EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/File") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/File") FILE, /** * Bookmark or a similar local identifier of a subordinate part of a primary resource */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/FragmentReference") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/FragmentReference") FRAGMENT_REFERENCE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/GlobalReference") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/GlobalReference") GLOBAL_REFERENCE, /** * Identifiable. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Identifiable") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Identifiable") IDENTIFIABLE, /** * Property with a value that can be provided in multiple languages */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/MultiLanguageProperty") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/MultiLanguageProperty") MULTI_LANGUAGE_PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Operation") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Operation") OPERATION, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Property") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Property") PROPERTY, /** * Range with min and max */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Range") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Range") RANGE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Referable") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Referable") REFERABLE, /** * Reference */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/ReferenceElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/ReferenceElement") REFERENCE_ELEMENT, /** * Relationship */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/RelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/RelationshipElement") RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Submodel") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Submodel") SUBMODEL, /** * Submodel Element */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/SubmodelElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/SubmodelElement") SUBMODEL_ELEMENT, /** * Struct of Submodel Elements */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/SubmodelElementCollection") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/SubmodelElementCollection") SUBMODEL_ELEMENT_COLLECTION, /** * List of Submodel Elements */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/SubmodelElementList") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/SubmodelElementList") SUBMODEL_ELEMENT_LIST; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java deleted file mode 100644 index 9d374c663..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - -import java.io.Serializable; - - -@IRI("rdf:langString") -public interface LangString extends Serializable { - - public String getLanguage(); - - public void setLanguage(String language); - - public String getText(); - - public void setText(String text); -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java index 0e53dde47..fb49700bd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java index c28a05bbb..1fe4604ef 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java index 12de5f4d9..e03afda72 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java index fecf969e6..98fcdaf14 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java index 2fffe3cd8..2ff44c065 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java index 51b946890..4f3931d96 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -16,37 +16,94 @@ package org.eclipse.digitaltwin.aas4j.v3.model; - import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLevelType; -/** -*/ -@IRI("aas:LevelType") +/** + * Value represented by up to four variants of a numeric value in a specific role: MIN, NOM, TYP and + * MAX. True means that the value is available, false means the value is not available. + */ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultLevelType.class) +}) public interface LevelType { - - public boolean getMin(); + /** + * Minimum of the value + * + * More information under https://admin-shell.io/aas/3/0/LevelType/min + * + * @return Returns the boolean for the property min. + */ + @IRI("https://admin-shell.io/aas/3/0/LevelType/min") + boolean getMin(); - - public void setMin(boolean min); + /** + * Minimum of the value + * + * More information under https://admin-shell.io/aas/3/0/LevelType/min + * + * @param min desired value for the property min. + */ + void setMin(boolean min); - - public boolean getNom(); + /** + * Nominal value (value as designated) + * + * More information under https://admin-shell.io/aas/3/0/LevelType/nom + * + * @return Returns the boolean for the property nom. + */ + @IRI("https://admin-shell.io/aas/3/0/LevelType/nom") + boolean getNom(); - - public void setNom(boolean nom); + /** + * Nominal value (value as designated) + * + * More information under https://admin-shell.io/aas/3/0/LevelType/nom + * + * @param nom desired value for the property nom. + */ + void setNom(boolean nom); - - public boolean getTyp(); + /** + * Value as typically present + * + * More information under https://admin-shell.io/aas/3/0/LevelType/typ + * + * @return Returns the boolean for the property typ. + */ + @IRI("https://admin-shell.io/aas/3/0/LevelType/typ") + boolean getTyp(); - - public void setTyp(boolean typ); + /** + * Value as typically present + * + * More information under https://admin-shell.io/aas/3/0/LevelType/typ + * + * @param typ desired value for the property typ. + */ + void setTyp(boolean typ); - - public boolean getMax(); + /** + * Maximum of the value + * + * More information under https://admin-shell.io/aas/3/0/LevelType/max + * + * @return Returns the boolean for the property max. + */ + @IRI("https://admin-shell.io/aas/3/0/LevelType/max") + boolean getMax(); - - public void setMax(boolean max); + /** + * Maximum of the value + * + * More information under https://admin-shell.io/aas/3/0/LevelType/max + * + * @param max desired value for the property max. + */ + void setMax(boolean max); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java deleted file mode 100644 index a0e26f775..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - - -/** - * Enumeration for denoting whether an element is a template or an instance. - */ -@IRI("aas:ModelingKind") -public enum ModelingKind { - - /** - * Concrete, clearly identifiable component of a certain template. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ModelingKind/Instance") - INSTANCE, - - /** - * Software element which specifies the common attributes shared by all instances of the template. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ModelingKind/Template") - TEMPLATE; - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java index 6b91d51af..5058811c4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,36 +33,36 @@ public interface MultiLanguageProperty extends DataElement { /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value + * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/value * - * @return Returns the List of LangStrings for the property value. + * @return Returns the List of LangStringTextTypes for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") + @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/value") List getValue(); /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value + * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/value * - * @param value desired value for the property value. + * @param values desired value for the property value. */ - void setValue(List value); + void setValue(List values); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId + * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") + @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId") Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId + * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId * * @param valueId desired value for the property valueId. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java index 4ba439e71..093835165 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,39 +30,20 @@ }) public interface Operation extends SubmodelElement { - /** - * Parameter that is input and output of the operation. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables - * - * @return Returns the List of OperationVariables for the property inoutputVariables. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables") - List getInoutputVariables(); - - /** - * Parameter that is input and output of the operation. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables - * - * @param inoutputVariables desired value for the property inoutputVariables. - */ - void setInoutputVariables(List inoutputVariables); - /** * Input parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables + * More information under https://admin-shell.io/aas/3/0/Operation/inputVariables * * @return Returns the List of OperationVariables for the property inputVariables. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables") + @IRI("https://admin-shell.io/aas/3/0/Operation/inputVariables") List getInputVariables(); /** * Input parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables + * More information under https://admin-shell.io/aas/3/0/Operation/inputVariables * * @param inputVariables desired value for the property inputVariables. */ @@ -71,20 +52,39 @@ public interface Operation extends SubmodelElement { /** * Output parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables + * More information under https://admin-shell.io/aas/3/0/Operation/outputVariables * * @return Returns the List of OperationVariables for the property outputVariables. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables") + @IRI("https://admin-shell.io/aas/3/0/Operation/outputVariables") List getOutputVariables(); /** * Output parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables + * More information under https://admin-shell.io/aas/3/0/Operation/outputVariables * * @param outputVariables desired value for the property outputVariables. */ void setOutputVariables(List outputVariables); + /** + * Parameter that is input and output of the operation. + * + * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables + * + * @return Returns the List of OperationVariables for the property inoutputVariables. + */ + @IRI("https://admin-shell.io/aas/3/0/Operation/inoutputVariables") + List getInoutputVariables(); + + /** + * Parameter that is input and output of the operation. + * + * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables + * + * @param inoutputVariables desired value for the property inoutputVariables. + */ + void setInoutputVariables(List inoutputVariables); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java index 2975e42e9..c61563481 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface OperationVariable { /** * Describes an argument or result of an operation via a submodel element * - * More information under https://admin-shell.io/aas/3/0/RC02/OperationVariable/value + * More information under https://admin-shell.io/aas/3/0/OperationVariable/value * * @return Returns the SubmodelElement for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") + @IRI("https://admin-shell.io/aas/3/0/OperationVariable/value") SubmodelElement getValue(); /** * Describes an argument or result of an operation via a submodel element * - * More information under https://admin-shell.io/aas/3/0/RC02/OperationVariable/value + * More information under https://admin-shell.io/aas/3/0/OperationVariable/value * * @param value desired value for the property value. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java index b937792da..72fc83156 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,20 +29,39 @@ }) public interface Property extends DataElement { + /** + * Data type of the value + * + * More information under https://admin-shell.io/aas/3/0/Property/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/Property/valueType") + DataTypeDefXsd getValueType(); + + /** + * Data type of the value + * + * More information under https://admin-shell.io/aas/3/0/Property/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/RC02/Property/value + * More information under https://admin-shell.io/aas/3/0/Property/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Property/value") + @IRI("https://admin-shell.io/aas/3/0/Property/value") String getValue(); /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/RC02/Property/value + * More information under https://admin-shell.io/aas/3/0/Property/value * * @param value desired value for the property value. */ @@ -51,39 +70,20 @@ public interface Property extends DataElement { /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueId + * More information under https://admin-shell.io/aas/3/0/Property/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueId") + @IRI("https://admin-shell.io/aas/3/0/Property/valueId") Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueId + * More information under https://admin-shell.io/aas/3/0/Property/valueId * * @param valueId desired value for the property valueId. */ void setValueId(Reference valueId); - /** - * Data type of the value - * - * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueType - * - * @return Returns the DataTypeDefXsd for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueType") - DataTypeDefXsd getValueType(); - - /** - * Data type of the value - * - * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueType - * - * @param valueType desired value for the property valueType. - */ - void setValueType(DataTypeDefXsd valueType); - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java index 6e4389d84..d8f0e2e84 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface Qualifiable { /** * Additional qualification of a qualifiable element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers + * More information under https://admin-shell.io/aas/3/0/Qualifiable/qualifiers * * @return Returns the List of Qualifiers for the property qualifiers. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") List getQualifiers(); /** * Additional qualification of a qualifiable element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers + * More information under https://admin-shell.io/aas/3/0/Qualifiable/qualifiers * * @param qualifiers desired value for the property qualifiers. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java index 3f2063d97..fd3876c9d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface Qualifier extends HasSemantics { /** * The qualifier kind describes the kind of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/kind + * More information under https://admin-shell.io/aas/3/0/Qualifier/kind * * @return Returns the QualifierKind for the property kind. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/kind") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/kind") QualifierKind getKind(); /** * The qualifier kind describes the kind of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/kind + * More information under https://admin-shell.io/aas/3/0/Qualifier/kind * * @param kind desired value for the property kind. */ @@ -52,36 +52,55 @@ public interface Qualifier extends HasSemantics { /** * The qualifier type describes the type of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/type + * More information under https://admin-shell.io/aas/3/0/Qualifier/type * * @return Returns the String for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/type") String getType(); /** * The qualifier type describes the type of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/type + * More information under https://admin-shell.io/aas/3/0/Qualifier/type * * @param type desired value for the property type. */ void setType(String type); + /** + * Data type of the qualifier value. + * + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") + DataTypeDefXsd getValueType(); + + /** + * Data type of the qualifier value. + * + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + /** * The qualifier value is the value of the qualifier. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/value + * More information under https://admin-shell.io/aas/3/0/Qualifier/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/value") String getValue(); /** * The qualifier value is the value of the qualifier. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/value + * More information under https://admin-shell.io/aas/3/0/Qualifier/value * * @param value desired value for the property value. */ @@ -90,39 +109,20 @@ public interface Qualifier extends HasSemantics { /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueId") Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueId * * @param valueId desired value for the property valueId. */ void setValueId(Reference valueId); - /** - * Data type of the qualifier value. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType - * - * @return Returns the DataTypeDefXsd for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") - DataTypeDefXsd getValueType(); - - /** - * Data type of the qualifier value. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType - * - * @param valueType desired value for the property valueType. - */ - void setValueType(DataTypeDefXsd valueType); - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java index 3919791a2..3f34d3abd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,19 +29,19 @@ public enum QualifierKind { /** * qualifies the semantic definition the element is referring to ('semanticId') */ - @IRI("https://admin-shell.io/aas/3/0/RC02/QualifierKind/ConceptQualifier") + @IRI("https://admin-shell.io/aas/3/0/QualifierKind/ConceptQualifier") CONCEPT_QUALIFIER, /** * qualifies the elements within a specific submodel on concept level. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/QualifierKind/TemplateQualifier") + @IRI("https://admin-shell.io/aas/3/0/QualifierKind/TemplateQualifier") TEMPLATE_QUALIFIER, /** * qualifies the value of the element and can change during run-time. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/QualifierKind/ValueQualifier") + @IRI("https://admin-shell.io/aas/3/0/QualifierKind/ValueQualifier") VALUE_QUALIFIER; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java index 26b1b0c6e..9c9c60f51 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,60 +30,60 @@ public interface Range extends DataElement { /** - * The maximum value of the range. + * Data type of the min und max * - * More information under https://admin-shell.io/aas/3/0/RC02/Range/max + * More information under https://admin-shell.io/aas/3/0/Range/valueType * - * @return Returns the String for the property max. + * @return Returns the DataTypeDefXsd for the property valueType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Range/max") - String getMax(); + @IRI("https://admin-shell.io/aas/3/0/Range/valueType") + DataTypeDefXsd getValueType(); /** - * The maximum value of the range. + * Data type of the min und max * - * More information under https://admin-shell.io/aas/3/0/RC02/Range/max + * More information under https://admin-shell.io/aas/3/0/Range/valueType * - * @param max desired value for the property max. + * @param valueType desired value for the property valueType. */ - void setMax(String max); + void setValueType(DataTypeDefXsd valueType); /** * The minimum value of the range. * - * More information under https://admin-shell.io/aas/3/0/RC02/Range/min + * More information under https://admin-shell.io/aas/3/0/Range/min * * @return Returns the String for the property min. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Range/min") + @IRI("https://admin-shell.io/aas/3/0/Range/min") String getMin(); /** * The minimum value of the range. * - * More information under https://admin-shell.io/aas/3/0/RC02/Range/min + * More information under https://admin-shell.io/aas/3/0/Range/min * * @param min desired value for the property min. */ void setMin(String min); /** - * Data type of the min und max + * The maximum value of the range. * - * More information under https://admin-shell.io/aas/3/0/RC02/Range/valueType + * More information under https://admin-shell.io/aas/3/0/Range/max * - * @return Returns the DataTypeDefXsd for the property valueType. + * @return Returns the String for the property max. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Range/valueType") - DataTypeDefXsd getValueType(); + @IRI("https://admin-shell.io/aas/3/0/Range/max") + String getMax(); /** - * Data type of the min und max + * The maximum value of the range. * - * More information under https://admin-shell.io/aas/3/0/RC02/Range/valueType + * More information under https://admin-shell.io/aas/3/0/Range/max * - * @param valueType desired value for the property valueType. + * @param max desired value for the property max. */ - void setValueType(DataTypeDefXsd valueType); + void setMax(String max); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java index e0fd5497d..71c5e6ad8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -25,8 +25,8 @@ * An element that is referable by its 'idShort'. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = Identifiable.class), - @KnownSubtypes.Type(value = SubmodelElement.class) + @KnownSubtypes.Type(value = SubmodelElement.class), + @KnownSubtypes.Type(value = Identifiable.class) }) public interface Referable extends HasExtensions { @@ -34,101 +34,80 @@ public interface Referable extends HasExtensions { * The category is a value that gives further meta information w.r.t. to the class of the element. * It affects the expected existence of attributes and the applicability of constraints. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/category + * More information under https://admin-shell.io/aas/3/0/Referable/category * * @return Returns the String for the property category. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") String getCategory(); /** * The category is a value that gives further meta information w.r.t. to the class of the element. * It affects the expected existence of attributes and the applicability of constraints. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/category + * More information under https://admin-shell.io/aas/3/0/Referable/category * * @param category desired value for the property category. */ void setCategory(String category); /** - * Checksum to be used to determine if an Referable (including its aggregated child elements) has - * changed. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/checksum - * - * @return Returns the String for the property checksum. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - String getChecksum(); - - /** - * Checksum to be used to determine if an Referable (including its aggregated child elements) has - * changed. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/checksum - * - * @param checksum desired value for the property checksum. - */ - void setChecksum(String checksum); - - /** - * Description or comments on the element. + * In case of identifiables this attribute is a short name of the element. In case of referable this + * ID is an identifying string of the element within its name space. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/description + * More information under https://admin-shell.io/aas/3/0/Referable/idShort * - * @return Returns the List of LangStrings for the property description. + * @return Returns the String for the property idShort. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - List getDescription(); + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + String getIdShort(); /** - * Description or comments on the element. + * In case of identifiables this attribute is a short name of the element. In case of referable this + * ID is an identifying string of the element within its name space. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/description + * More information under https://admin-shell.io/aas/3/0/Referable/idShort * - * @param description desired value for the property description. + * @param idShort desired value for the property idShort. */ - void setDescription(List description); + void setIdShort(String idShort); /** * Display name. Can be provided in several languages. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/displayName + * More information under https://admin-shell.io/aas/3/0/Referable/displayName * - * @return Returns the List of LangStrings for the property displayName. + * @return Returns the List of LangStringNameTypes for the property displayName. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") List getDisplayName(); /** * Display name. Can be provided in several languages. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/displayName + * More information under https://admin-shell.io/aas/3/0/Referable/displayName * - * @param displayName desired value for the property displayName. + * @param displayNames desired value for the property displayName. */ - void setDisplayName(List displayName); + void setDisplayName(List displayNames); /** - * In case of identifiables this attribute is a short name of the element. In case of referable this - * ID is an identifying string of the element within its name space. + * Description or comments on the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/idShort + * More information under https://admin-shell.io/aas/3/0/Referable/description * - * @return Returns the String for the property idShort. + * @return Returns the List of LangStringTextTypes for the property description. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") - String getIdShort(); + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + List getDescription(); /** - * In case of identifiables this attribute is a short name of the element. In case of referable this - * ID is an identifying string of the element within its name space. + * Description or comments on the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/idShort + * More information under https://admin-shell.io/aas/3/0/Referable/description * - * @param idShort desired value for the property idShort. + * @param descriptions desired value for the property description. */ - void setIdShort(String idShort); + void setDescription(List descriptions); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java index 8575d95e8..ee6ceffda 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,60 +31,60 @@ public interface Reference { /** - * Unique references in their name space. + * Type of the reference. * - * More information under https://admin-shell.io/aas/3/0/RC02/Reference/keys + * More information under https://admin-shell.io/aas/3/0/Reference/type * - * @return Returns the List of Keys for the property keys. + * @return Returns the ReferenceTypes for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/keys") - List getKeys(); + @IRI("https://admin-shell.io/aas/3/0/Reference/type") + ReferenceTypes getType(); /** - * Unique references in their name space. + * Type of the reference. * - * More information under https://admin-shell.io/aas/3/0/RC02/Reference/keys + * More information under https://admin-shell.io/aas/3/0/Reference/type * - * @param keys desired value for the property keys. + * @param type desired value for the property type. */ - void setKeys(List keys); + void setType(ReferenceTypes type); /** * 'semanticId' of the referenced model element ('type' = 'ModelReference'). * - * More information under https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId + * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticId * * @return Returns the Reference for the property referredSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId") + @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticId") Reference getReferredSemanticId(); /** * 'semanticId' of the referenced model element ('type' = 'ModelReference'). * - * More information under https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId + * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticId * * @param referredSemanticId desired value for the property referredSemanticId. */ void setReferredSemanticId(Reference referredSemanticId); /** - * Type of the reference. + * Unique references in their name space. * - * More information under https://admin-shell.io/aas/3/0/RC02/Reference/type + * More information under https://admin-shell.io/aas/3/0/Reference/keys * - * @return Returns the ReferenceTypes for the property type. + * @return Returns the List of Keys for the property keys. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/type") - ReferenceTypes getType(); + @IRI("https://admin-shell.io/aas/3/0/Reference/keys") + List getKeys(); /** - * Type of the reference. + * Unique references in their name space. * - * More information under https://admin-shell.io/aas/3/0/RC02/Reference/type + * More information under https://admin-shell.io/aas/3/0/Reference/keys * - * @param type desired value for the property type. + * @param keys desired value for the property keys. */ - void setType(ReferenceTypes type); + void setKeys(List keys); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java index cd13ceb32..40a6de3a5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,18 +34,18 @@ public interface ReferenceElement extends DataElement { * Global reference to an external object or entity or a logical reference to another element within * the same or another AAS (i.e. a model reference to a Referable). * - * More information under https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value + * More information under https://admin-shell.io/aas/3/0/ReferenceElement/value * * @return Returns the Reference for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") + @IRI("https://admin-shell.io/aas/3/0/ReferenceElement/value") Reference getValue(); /** * Global reference to an external object or entity or a logical reference to another element within * the same or another AAS (i.e. a model reference to a Referable). * - * More information under https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value + * More information under https://admin-shell.io/aas/3/0/ReferenceElement/value * * @param value desired value for the property value. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java index 2f815c8a8..99ded8f49 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -21,21 +21,21 @@ /** - * ReferenceTypes + * Reference types */ @IRI("aas:ReferenceTypes") public enum ReferenceTypes { /** - * GlobalReference. + * External reference. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceTypes/ExternalReference") + @IRI("https://admin-shell.io/aas/3/0/ReferenceTypes/ExternalReference") EXTERNAL_REFERENCE, /** - * ModelReference + * Model reference. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceTypes/ModelReference") + @IRI("https://admin-shell.io/aas/3/0/ReferenceTypes/ModelReference") MODEL_REFERENCE; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java index e2ffe5b1d..986c78aa2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,17 +34,17 @@ public interface RelationshipElement extends SubmodelElement { /** * Reference to the first element in the relationship taking the role of the subject. * - * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first + * More information under https://admin-shell.io/aas/3/0/RelationshipElement/first * * @return Returns the Reference for the property first. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") + @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/first") Reference getFirst(); /** * Reference to the first element in the relationship taking the role of the subject. * - * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first + * More information under https://admin-shell.io/aas/3/0/RelationshipElement/first * * @param first desired value for the property first. */ @@ -53,17 +53,17 @@ public interface RelationshipElement extends SubmodelElement { /** * Reference to the second element in the relationship taking the role of the object. * - * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second + * More information under https://admin-shell.io/aas/3/0/RelationshipElement/second * * @return Returns the Reference for the property second. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") + @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") Reference getSecond(); /** * Reference to the second element in the relationship taking the role of the object. * - * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second + * More information under https://admin-shell.io/aas/3/0/RelationshipElement/second * * @param second desired value for the property second. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java index ac9f59ae6..4534c1408 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,41 +31,41 @@ public interface Resource { /** - * Content type of the content of the file. + * Path and name of the resource (with file extension). * - * More information under https://admin-shell.io/aas/3/0/RC02/Resource/contentType + * More information under https://admin-shell.io/aas/3/0/Resource/path * - * @return Returns the String for the property contentType. + * @return Returns the String for the property path. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/Resource/path") + String getPath(); /** - * Content type of the content of the file. + * Path and name of the resource (with file extension). * - * More information under https://admin-shell.io/aas/3/0/RC02/Resource/contentType + * More information under https://admin-shell.io/aas/3/0/Resource/path * - * @param contentType desired value for the property contentType. + * @param path desired value for the property path. */ - void setContentType(String contentType); + void setPath(String path); /** - * Path and name of the resource (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/RC02/Resource/path + * More information under https://admin-shell.io/aas/3/0/Resource/contentType * - * @return Returns the String for the property path. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/path") - String getPath(); + @IRI("https://admin-shell.io/aas/3/0/Resource/contentType") + String getContentType(); /** - * Path and name of the resource (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/RC02/Resource/path + * More information under https://admin-shell.io/aas/3/0/Resource/contentType * - * @param path desired value for the property path. + * @param contentType desired value for the property contentType. */ - void setPath(String path); + void setContentType(String contentType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java index 6c54d5d28..c868e3e2b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,39 +29,20 @@ }) public interface SpecificAssetId extends HasSemantics { - /** - * The (external) subject the key belongs to or has meaning to. - * - * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId - * - * @return Returns the Reference for the property externalSubjectId. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") - Reference getExternalSubjectId(); - - /** - * The (external) subject the key belongs to or has meaning to. - * - * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId - * - * @param externalSubjectId desired value for the property externalSubjectId. - */ - void setExternalSubjectId(Reference externalSubjectId); - /** * Name of the identifier * - * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name + * More information under https://admin-shell.io/aas/3/0/SpecificAssetId/name * * @return Returns the String for the property name. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") + @IRI("https://admin-shell.io/aas/3/0/SpecificAssetId/name") String getName(); /** * Name of the identifier * - * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name + * More information under https://admin-shell.io/aas/3/0/SpecificAssetId/name * * @param name desired value for the property name. */ @@ -70,20 +51,39 @@ public interface SpecificAssetId extends HasSemantics { /** * The value of the specific asset identifier with the corresponding name. * - * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value + * More information under https://admin-shell.io/aas/3/0/SpecificAssetId/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") + @IRI("https://admin-shell.io/aas/3/0/SpecificAssetId/value") String getValue(); /** * The value of the specific asset identifier with the corresponding name. * - * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value + * More information under https://admin-shell.io/aas/3/0/SpecificAssetId/value * * @param value desired value for the property value. */ void setValue(String value); + /** + * The (external) subject the key belongs to or has meaning to. + * + * More information under https://admin-shell.io/aas/3/0/SpecificAssetId/externalSubjectId + * + * @return Returns the Reference for the property externalSubjectId. + */ + @IRI("https://admin-shell.io/aas/3/0/SpecificAssetId/externalSubjectId") + Reference getExternalSubjectId(); + + /** + * The (external) subject the key belongs to or has meaning to. + * + * More information under https://admin-shell.io/aas/3/0/SpecificAssetId/externalSubjectId + * + * @param externalSubjectId desired value for the property externalSubjectId. + */ + void setExternalSubjectId(Reference externalSubjectId); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java index a52edcf60..c71416c94 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,13 +29,13 @@ public enum StateOfEvent { /** * Event is off. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/StateOfEvent/Off") + @IRI("https://admin-shell.io/aas/3/0/StateOfEvent/Off") OFF, /** * Event is on */ - @IRI("https://admin-shell.io/aas/3/0/RC02/StateOfEvent/On") + @IRI("https://admin-shell.io/aas/3/0/StateOfEvent/On") ON; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java index 12789fff0..4e8fd3266 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,22 +28,22 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultSubmodel.class) }) -public interface Submodel extends HasDataSpecification, Identifiable, HasSemantics, HasKind, Qualifiable { +public interface Submodel extends HasDataSpecification, HasKind, HasSemantics, Identifiable, Qualifiable { /** * A submodel consists of zero or more submodel elements. * - * More information under https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements + * More information under https://admin-shell.io/aas/3/0/Submodel/submodelElements * * @return Returns the List of SubmodelElements for the property submodelElements. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements") + @IRI("https://admin-shell.io/aas/3/0/Submodel/submodelElements") List getSubmodelElements(); /** * A submodel consists of zero or more submodel elements. * - * More information under https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements + * More information under https://admin-shell.io/aas/3/0/Submodel/submodelElements * * @param submodelElements desired value for the property submodelElements. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java index d864c6344..5c19158d9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,15 +24,15 @@ * A submodel element is an element suitable for the description and differentiation of assets. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = RelationshipElement.class), @KnownSubtypes.Type(value = DataElement.class), - @KnownSubtypes.Type(value = EventElement.class), @KnownSubtypes.Type(value = Capability.class), @KnownSubtypes.Type(value = Entity.class), + @KnownSubtypes.Type(value = EventElement.class), @KnownSubtypes.Type(value = Operation.class), + @KnownSubtypes.Type(value = RelationshipElement.class), @KnownSubtypes.Type(value = SubmodelElementCollection.class), @KnownSubtypes.Type(value = SubmodelElementList.class) }) -public interface SubmodelElement extends HasDataSpecification, HasSemantics, HasKind, Referable, Qualifiable { +public interface SubmodelElement extends HasDataSpecification, HasSemantics, Qualifiable, Referable { } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java index 7a913462d..2080567bd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -19,7 +19,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import java.util.Collection; +import java.util.List; /** @@ -34,20 +34,20 @@ public interface SubmodelElementCollection extends SubmodelElement { /** * Submodel element contained in the collection. * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value + * More information under https://admin-shell.io/aas/3/0/SubmodelElementCollection/value * - * @return Returns the Collection of SubmodelElements for the property value. + * @return Returns the List of SubmodelElements for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") - Collection getValue(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementCollection/value") + List getValue(); /** * Submodel element contained in the collection. * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value + * More information under https://admin-shell.io/aas/3/0/SubmodelElementCollection/value * - * @param value desired value for the property value. + * @param values desired value for the property value. */ - void setValue(Collection value); + void setValue(List values); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java index 34d62ee6c..7e94212b4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,18 +34,18 @@ public interface SubmodelElementList extends SubmodelElement { * Defines whether order in list is relevant. If 'orderRelevant' = False then the list is * representing a set or a bag. * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant * * @return Returns the boolean for the property orderRelevant. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant") boolean getOrderRelevant(); /** * Defines whether order in list is relevant. If 'orderRelevant' = False then the list is * representing a set or a bag. * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant * * @param orderRelevant desired value for the property orderRelevant. */ @@ -54,19 +54,17 @@ public interface SubmodelElementList extends SubmodelElement { /** * Semantic ID the submodel elements contained in the list match to. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement * * @return Returns the Reference for the property semanticIdListElement. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement") Reference getSemanticIdListElement(); /** * Semantic ID the submodel elements contained in the list match to. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement * * @param semanticIdListElement desired value for the property semanticIdListElement. */ @@ -75,62 +73,58 @@ public interface SubmodelElementList extends SubmodelElement { /** * The submodel element type of the submodel elements contained in the list. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement * * @return Returns the AasSubmodelElements for the property typeValueListElement. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement") AasSubmodelElements getTypeValueListElement(); /** * The submodel element type of the submodel elements contained in the list. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement * * @param typeValueListElement desired value for the property typeValueListElement. */ void setTypeValueListElement(AasSubmodelElements typeValueListElement); /** - * Submodel element contained in the list. + * The value type of the submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement * - * @return Returns the List of SubmodelElements for the property value. + * @return Returns the DataTypeDefXsd for the property valueTypeListElement. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") - List getValue(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") + DataTypeDefXsd getValueTypeListElement(); /** - * Submodel element contained in the list. + * The value type of the submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement * - * @param value desired value for the property value. + * @param valueTypeListElement desired value for the property valueTypeListElement. */ - void setValue(List value); + void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); /** - * The value type of the submodel element contained in the list. + * Submodel element contained in the list. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value * - * @return Returns the DataTypeDefXsd for the property valueTypeListElement. + * @return Returns the List of SubmodelElements for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") - DataTypeDefXsd getValueTypeListElement(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") + List getValue(); /** - * The value type of the submodel element contained in the list. + * Submodel element contained in the list. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value * - * @param valueTypeListElement desired value for the property valueTypeListElement. + * @param values desired value for the property value. */ - void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); + void setValue(List values); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java index cc89c5dcc..9313bc322 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface ValueList { /** * A pair of a value together with its global unique id. * - * More information under https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs + * More information under https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs * * @return Returns the List of ValueReferencePairs for the property valueReferencePairs. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") + @IRI("https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs") List getValueReferencePairs(); /** * A pair of a value together with its global unique id. * - * More information under https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs + * More information under https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs * * @param valueReferencePairs desired value for the property valueReferencePairs. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java index 3f6b6dcf2..53d12d3bf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,19 +31,19 @@ public interface ValueReferencePair { /** - * The value of the referenced concept definition of the value in valueId. + * The value of the referenced concept definition of the value in 'valueId'. * - * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value + * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") + @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/value") String getValue(); /** - * The value of the referenced concept definition of the value in valueId. + * The value of the referenced concept definition of the value in 'valueId'. * - * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value + * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/value * * @param value desired value for the property value. */ @@ -52,17 +52,17 @@ public interface ValueReferencePair { /** * Global unique id of the value. * - * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId + * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") + @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueId") Reference getValueId(); /** * Global unique id of the value. * - * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId + * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueId * * @param valueId desired value for the property valueId. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java index f37653283..075f2353a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java index bf9106f86..1c13de81d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java index 38e364da1..2090757dc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java index fc362a1a3..f75faf333 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,6 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import java.util.List; @@ -24,6 +25,17 @@ public abstract class AdministrativeInformationBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for version + * + * @param version desired value to be set + * @return Builder object with new value for version + */ + public B version(String version) { + getBuildingInstance().setVersion(version); + return getSelf(); + } + /** * This function allows setting a value for revision * @@ -36,13 +48,24 @@ public B revision(String revision) { } /** - * This function allows setting a value for version + * This function allows setting a value for creator * - * @param version desired value to be set - * @return Builder object with new value for version + * @param creator desired value to be set + * @return Builder object with new value for creator */ - public B version(String version) { - getBuildingInstance().setVersion(version); + public B creator(Reference creator) { + getBuildingInstance().setCreator(creator); + return getSelf(); + } + + /** + * This function allows setting a value for templateId + * + * @param templateId desired value to be set + * @return Builder object with new value for templateId + */ + public B templateId(String templateId) { + getBuildingInstance().setTemplateId(templateId); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java index 995eeabd7..f26548cc2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,9 +20,6 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - - public abstract class AnnotatedRelationshipElementBuilder> extends ExtendableBuilder { @@ -70,22 +67,10 @@ public B second(Reference second) { return getSelf(); } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set * @return Builder object with new value for embeddedDataSpecifications */ public B embeddedDataSpecifications(List embeddedDataSpecifications) { @@ -94,13 +79,13 @@ public B embeddedDataSpecifications(List embeddedData } /** - * This function allows setting a value for kind + * This function allows adding a value to the List embeddedDataSpecifications * - * @param kind desired value to be set - * @return Builder object with new value for kind + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); return getSelf(); } @@ -184,33 +169,44 @@ public B idShort(String idShort) { /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** * This function allows setting a value for description * - * @param description desired value to be set + * @param descriptions desired value to be set * @return Builder object with new value for description */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List description * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param description desired value to be added + * @return Builder object with new value for description */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java index 12cf93d6f..51e9059c1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,24 +24,24 @@ public abstract class AssetAdministrationShellBuilder { /** - * This function allows setting a value for assetInformation + * This function allows setting a value for derivedFrom * - * @param assetInformation desired value to be set - * @return Builder object with new value for assetInformation + * @param derivedFrom desired value to be set + * @return Builder object with new value for derivedFrom */ - public B assetInformation(AssetInformation assetInformation) { - getBuildingInstance().setAssetInformation(assetInformation); + public B derivedFrom(Reference derivedFrom) { + getBuildingInstance().setDerivedFrom(derivedFrom); return getSelf(); } /** - * This function allows setting a value for derivedFrom + * This function allows setting a value for assetInformation * - * @param derivedFrom desired value to be set - * @return Builder object with new value for derivedFrom + * @param assetInformation desired value to be set + * @return Builder object with new value for assetInformation */ - public B derivedFrom(Reference derivedFrom) { - getBuildingInstance().setDerivedFrom(derivedFrom); + public B assetInformation(AssetInformation assetInformation) { + getBuildingInstance().setAssetInformation(assetInformation); return getSelf(); } @@ -123,46 +123,24 @@ public B category(String category) { } /** - * This function allows setting a value for checksum - * - * @param checksum desired value to be set - * @return Builder object with new value for checksum - */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param description desired value to be set - * @return Builder object with new value for description - */ - public B description(List description) { - getBuildingInstance().setDescription(description); - return getSelf(); - } - - /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -178,13 +156,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java index 5e56f3aa1..974bbcae2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,7 +15,10 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.Resource; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import java.util.List; @@ -34,17 +37,6 @@ public B assetKind(AssetKind assetKind) { return getSelf(); } - /** - * This function allows setting a value for defaultThumbnail - * - * @param defaultThumbnail desired value to be set - * @return Builder object with new value for defaultThumbnail - */ - public B defaultThumbnail(Resource defaultThumbnail) { - getBuildingInstance().setDefaultThumbnail(defaultThumbnail); - return getSelf(); - } - /** * This function allows setting a value for globalAssetId * @@ -77,4 +69,26 @@ public B specificAssetIds(SpecificAssetId specificAssetIds) { getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); return getSelf(); } + + /** + * This function allows setting a value for assetType + * + * @param assetType desired value to be set + * @return Builder object with new value for assetType + */ + public B assetType(String assetType) { + getBuildingInstance().setAssetType(assetType); + return getSelf(); + } + + /** + * This function allows setting a value for defaultThumbnail + * + * @param defaultThumbnail desired value to be set + * @return Builder object with new value for defaultThumbnail + */ + public B defaultThumbnail(Resource defaultThumbnail) { + getBuildingInstance().setDefaultThumbnail(defaultThumbnail); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java index 142160c2e..718767d8b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,6 +23,17 @@ public abstract class BasicEventElementBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for observed + * + * @param observed desired value to be set + * @return Builder object with new value for observed + */ + public B observed(Reference observed) { + getBuildingInstance().setObserved(observed); + return getSelf(); + } + /** * This function allows setting a value for direction * @@ -35,24 +46,24 @@ public B direction(Direction direction) { } /** - * This function allows setting a value for lastUpdate + * This function allows setting a value for state * - * @param lastUpdate desired value to be set - * @return Builder object with new value for lastUpdate + * @param state desired value to be set + * @return Builder object with new value for state */ - public B lastUpdate(String lastUpdate) { - getBuildingInstance().setLastUpdate(lastUpdate); + public B state(StateOfEvent state) { + getBuildingInstance().setState(state); return getSelf(); } /** - * This function allows setting a value for maxInterval + * This function allows setting a value for messageTopic * - * @param maxInterval desired value to be set - * @return Builder object with new value for maxInterval + * @param messageTopic desired value to be set + * @return Builder object with new value for messageTopic */ - public B maxInterval(String maxInterval) { - getBuildingInstance().setMaxInterval(maxInterval); + public B messageTopic(String messageTopic) { + getBuildingInstance().setMessageTopic(messageTopic); return getSelf(); } @@ -68,13 +79,13 @@ public B messageBroker(Reference messageBroker) { } /** - * This function allows setting a value for messageTopic + * This function allows setting a value for lastUpdate * - * @param messageTopic desired value to be set - * @return Builder object with new value for messageTopic + * @param lastUpdate desired value to be set + * @return Builder object with new value for lastUpdate */ - public B messageTopic(String messageTopic) { - getBuildingInstance().setMessageTopic(messageTopic); + public B lastUpdate(String lastUpdate) { + getBuildingInstance().setLastUpdate(lastUpdate); return getSelf(); } @@ -90,24 +101,13 @@ public B minInterval(String minInterval) { } /** - * This function allows setting a value for observed - * - * @param observed desired value to be set - * @return Builder object with new value for observed - */ - public B observed(Reference observed) { - getBuildingInstance().setObserved(observed); - return getSelf(); - } - - /** - * This function allows setting a value for state + * This function allows setting a value for maxInterval * - * @param state desired value to be set - * @return Builder object with new value for state + * @param maxInterval desired value to be set + * @return Builder object with new value for maxInterval */ - public B state(StateOfEvent state) { - getBuildingInstance().setState(state); + public B maxInterval(String maxInterval) { + getBuildingInstance().setMaxInterval(maxInterval); return getSelf(); } @@ -167,68 +167,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -244,13 +233,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -275,26 +275,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java index cc3569b14..6fe946097 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,24 +23,24 @@ public abstract class BlobBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for contentType + * This function allows setting a value for value * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param value desired value to be set + * @return Builder object with new value for value */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B value(byte[] value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for value + * This function allows setting a value for contentType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B value(byte[] value) { - getBuildingInstance().setValue(value); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } @@ -100,68 +100,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -177,13 +166,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -208,26 +208,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java index 111002598..cdc11013e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java index 9fef383bd..2264c9c68 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -78,68 +78,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -155,13 +144,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -186,26 +186,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java index 3977d3764..85c3f259b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -26,11 +26,11 @@ public abstract class ConceptDescriptionBuilder isCaseOf) { - getBuildingInstance().setIsCaseOf(isCaseOf); + public B isCaseOf(List isCaseOfs) { + getBuildingInstance().setIsCaseOf(isCaseOfs); return getSelf(); } @@ -101,46 +101,24 @@ public B category(String category) { } /** - * This function allows setting a value for checksum - * - * @param checksum desired value to be set - * @return Builder object with new value for checksum - */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param description desired value to be set - * @return Builder object with new value for description - */ - public B description(List description) { - getBuildingInstance().setDescription(description); - return getSelf(); - } - - /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -156,13 +134,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java index e48eca4ec..41ce802e4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,58 +23,14 @@ public abstract class DataSpecificationIec61360Builder> extends ExtendableBuilder { - /** - * This function allows setting a value for dataType - * - * @param dataType desired value to be set - * @return Builder object with new value for dataType - */ - public B dataType(DataTypeIec61360 dataType) { - getBuildingInstance().setDataType(dataType); - return getSelf(); - } - - /** - * This function allows setting a value for definition - * - * @param definition desired value to be set - * @return Builder object with new value for definition - */ - public B definition(List definition) { - getBuildingInstance().setDefinition(definition); - return getSelf(); - } - - /** - * This function allows adding a value to the List definition - * - * @param definition desired value to be added - * @return Builder object with new value for definition - */ - public B definition(LangString definition) { - getBuildingInstance().getDefinition().add(definition); - return getSelf(); - } - - /** - * This function allows setting a value for levelType - * - * @param levelType desired value to be set - * @return Builder object with new value for levelType - */ - public B levelType(LevelType levelType) { - getBuildingInstance().setLevelType(levelType); - return getSelf(); - } - /** * This function allows setting a value for preferredName * - * @param preferredName desired value to be set + * @param preferredNames desired value to be set * @return Builder object with new value for preferredName */ - public B preferredName(List preferredName) { - getBuildingInstance().setPreferredName(preferredName); + public B preferredName(List preferredNames) { + getBuildingInstance().setPreferredName(preferredNames); return getSelf(); } @@ -84,7 +40,7 @@ public B preferredName(List preferredName) { * @param preferredName desired value to be added * @return Builder object with new value for preferredName */ - public B preferredName(LangString preferredName) { + public B preferredName(LangStringPreferredNameTypeIec61360 preferredName) { getBuildingInstance().getPreferredName().add(preferredName); return getSelf(); } @@ -92,11 +48,11 @@ public B preferredName(LangString preferredName) { /** * This function allows setting a value for shortName * - * @param shortName desired value to be set + * @param shortNames desired value to be set * @return Builder object with new value for shortName */ - public B shortName(List shortName) { - getBuildingInstance().setShortName(shortName); + public B shortName(List shortNames) { + getBuildingInstance().setShortName(shortNames); return getSelf(); } @@ -106,11 +62,33 @@ public B shortName(List shortName) { * @param shortName desired value to be added * @return Builder object with new value for shortName */ - public B shortName(LangString shortName) { + public B shortName(LangStringShortNameTypeIec61360 shortName) { getBuildingInstance().getShortName().add(shortName); return getSelf(); } + /** + * This function allows setting a value for unit + * + * @param unit desired value to be set + * @return Builder object with new value for unit + */ + public B unit(String unit) { + getBuildingInstance().setUnit(unit); + return getSelf(); + } + + /** + * This function allows setting a value for unitId + * + * @param unitId desired value to be set + * @return Builder object with new value for unitId + */ + public B unitId(Reference unitId) { + getBuildingInstance().setUnitId(unitId); + return getSelf(); + } + /** * This function allows setting a value for sourceOfDefinition * @@ -134,35 +112,35 @@ public B symbol(String symbol) { } /** - * This function allows setting a value for unit + * This function allows setting a value for dataType * - * @param unit desired value to be set - * @return Builder object with new value for unit + * @param dataType desired value to be set + * @return Builder object with new value for dataType */ - public B unit(String unit) { - getBuildingInstance().setUnit(unit); + public B dataType(DataTypeIec61360 dataType) { + getBuildingInstance().setDataType(dataType); return getSelf(); } /** - * This function allows setting a value for unitId + * This function allows setting a value for definition * - * @param unitId desired value to be set - * @return Builder object with new value for unitId + * @param definitions desired value to be set + * @return Builder object with new value for definition */ - public B unitId(Reference unitId) { - getBuildingInstance().setUnitId(unitId); + public B definition(List definitions) { + getBuildingInstance().setDefinition(definitions); return getSelf(); } /** - * This function allows setting a value for value + * This function allows adding a value to the List definition * - * @param value desired value to be set - * @return Builder object with new value for value + * @param definition desired value to be added + * @return Builder object with new value for definition */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B definition(LangStringDefinitionTypeIec61360 definition) { + getBuildingInstance().getDefinition().add(definition); return getSelf(); } @@ -188,4 +166,26 @@ public B valueList(ValueList valueList) { return getSelf(); } + /** + * This function allows setting a value for value + * + * @param value desired value to be set + * @return Builder object with new value for value + */ + public B value(String value) { + getBuildingInstance().setValue(value); + return getSelf(); + } + + /** + * This function allows setting a value for levelType + * + * @param levelType desired value to be set + * @return Builder object with new value for levelType + */ + public B levelType(LevelType levelType) { + getBuildingInstance().setLevelType(levelType); + return getSelf(); + } + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java deleted file mode 100644 index 75998a955..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -import java.util.List; - - -public abstract class DataSpecificationPhysicalUnitBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for conversionFactor - * - * @param conversionFactor desired value to be set - * @return Builder object with new value for conversionFactor - */ - public B conversionFactor(String conversionFactor) { - getBuildingInstance().setConversionFactor(conversionFactor); - return getSelf(); - } - - /** - * This function allows setting a value for definition - * - * @param definition desired value to be set - * @return Builder object with new value for definition - */ - public B definition(List definition) { - getBuildingInstance().setDefinition(definition); - return getSelf(); - } - - /** - * This function allows adding a value to the List definition - * - * @param definition desired value to be added - * @return Builder object with new value for definition - */ - public B definition(LangString definition) { - getBuildingInstance().getDefinition().add(definition); - return getSelf(); - } - - /** - * This function allows setting a value for dinNotation - * - * @param dinNotation desired value to be set - * @return Builder object with new value for dinNotation - */ - public B dinNotation(String dinNotation) { - getBuildingInstance().setDinNotation(dinNotation); - return getSelf(); - } - - /** - * This function allows setting a value for eceCode - * - * @param eceCode desired value to be set - * @return Builder object with new value for eceCode - */ - public B eceCode(String eceCode) { - getBuildingInstance().setEceCode(eceCode); - return getSelf(); - } - - /** - * This function allows setting a value for eceName - * - * @param eceName desired value to be set - * @return Builder object with new value for eceName - */ - public B eceName(String eceName) { - getBuildingInstance().setEceName(eceName); - return getSelf(); - } - - /** - * This function allows setting a value for nistName - * - * @param nistName desired value to be set - * @return Builder object with new value for nistName - */ - public B nistName(String nistName) { - getBuildingInstance().setNistName(nistName); - return getSelf(); - } - - /** - * This function allows setting a value for registrationAuthorityId - * - * @param registrationAuthorityId desired value to be set - * @return Builder object with new value for registrationAuthorityId - */ - public B registrationAuthorityId(String registrationAuthorityId) { - getBuildingInstance().setRegistrationAuthorityId(registrationAuthorityId); - return getSelf(); - } - - /** - * This function allows setting a value for siName - * - * @param siName desired value to be set - * @return Builder object with new value for siName - */ - public B siName(String siName) { - getBuildingInstance().setSiName(siName); - return getSelf(); - } - - /** - * This function allows setting a value for siNotation - * - * @param siNotation desired value to be set - * @return Builder object with new value for siNotation - */ - public B siNotation(String siNotation) { - getBuildingInstance().setSiNotation(siNotation); - return getSelf(); - } - - /** - * This function allows setting a value for sourceOfDefinition - * - * @param sourceOfDefinition desired value to be set - * @return Builder object with new value for sourceOfDefinition - */ - public B sourceOfDefinition(String sourceOfDefinition) { - getBuildingInstance().setSourceOfDefinition(sourceOfDefinition); - return getSelf(); - } - - /** - * This function allows setting a value for supplier - * - * @param supplier desired value to be set - * @return Builder object with new value for supplier - */ - public B supplier(String supplier) { - getBuildingInstance().setSupplier(supplier); - return getSelf(); - } - - /** - * This function allows setting a value for unitName - * - * @param unitName desired value to be set - * @return Builder object with new value for unitName - */ - public B unitName(String unitName) { - getBuildingInstance().setUnitName(unitName); - return getSelf(); - } - - /** - * This function allows setting a value for unitSymbol - * - * @param unitSymbol desired value to be set - * @return Builder object with new value for unitSymbol - */ - public B unitSymbol(String unitSymbol) { - getBuildingInstance().setUnitSymbol(unitSymbol); - return getSelf(); - } - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java index 68e175a75..f92f45fe4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java index 5758ff9b0..fda9f062c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,6 +22,28 @@ public abstract class EntityBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for statements + * + * @param statements desired value to be set + * @return Builder object with new value for statements + */ + public B statements(List statements) { + getBuildingInstance().setStatements(statements); + return getSelf(); + } + + /** + * This function allows adding a value to the List statements + * + * @param statements desired value to be added + * @return Builder object with new value for statements + */ + public B statements(SubmodelElement statements) { + getBuildingInstance().getStatements().add(statements); + return getSelf(); + } + /** * This function allows setting a value for entityType * @@ -45,35 +67,24 @@ public B globalAssetId(String globalAssetId) { } /** - * This function allows setting a value for specificAssetId + * This function allows setting a value for specificAssetIds * - * @param specificAssetId desired value to be set - * @return Builder object with new value for specificAssetId + * @param specificAssetIds desired value to be set + * @return Builder object with new value for specificAssetIds */ - public B specificAssetId(SpecificAssetId specificAssetId) { - getBuildingInstance().setSpecificAssetId(specificAssetId); + public B specificAssetIds(List specificAssetIds) { + getBuildingInstance().setSpecificAssetIds(specificAssetIds); return getSelf(); } /** - * This function allows setting a value for statements + * This function allows adding a value to the List specificAssetIds * - * @param statements desired value to be set - * @return Builder object with new value for statements + * @param specificAssetIds desired value to be added + * @return Builder object with new value for specificAssetIds */ - public B statements(List statements) { - getBuildingInstance().setStatements(statements); - return getSelf(); - } - - /** - * This function allows adding a value to the List statements - * - * @param statements desired value to be added - * @return Builder object with new value for statements - */ - public B statements(SubmodelElement statements) { - getBuildingInstance().getStatements().add(statements); + public B specificAssetIds(SpecificAssetId specificAssetIds) { + getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); return getSelf(); } @@ -133,68 +144,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -210,13 +210,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -241,26 +252,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java index 0c10eab94..60288ffc2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -48,46 +48,46 @@ public B assetAdministrationShells(AssetAdministrationShell assetAdministrationS } /** - * This function allows setting a value for conceptDescriptions + * This function allows setting a value for submodels * - * @param conceptDescriptions desired value to be set - * @return Builder object with new value for conceptDescriptions + * @param submodels desired value to be set + * @return Builder object with new value for submodels */ - public B conceptDescriptions(List conceptDescriptions) { - getBuildingInstance().setConceptDescriptions(conceptDescriptions); + public B submodels(List submodels) { + getBuildingInstance().setSubmodels(submodels); return getSelf(); } /** - * This function allows adding a value to the List conceptDescriptions + * This function allows adding a value to the List submodels * - * @param conceptDescriptions desired value to be added - * @return Builder object with new value for conceptDescriptions + * @param submodels desired value to be added + * @return Builder object with new value for submodels */ - public B conceptDescriptions(ConceptDescription conceptDescriptions) { - getBuildingInstance().getConceptDescriptions().add(conceptDescriptions); + public B submodels(Submodel submodels) { + getBuildingInstance().getSubmodels().add(submodels); return getSelf(); } /** - * This function allows setting a value for submodels + * This function allows setting a value for conceptDescriptions * - * @param submodels desired value to be set - * @return Builder object with new value for submodels + * @param conceptDescriptions desired value to be set + * @return Builder object with new value for conceptDescriptions */ - public B submodels(List submodels) { - getBuildingInstance().setSubmodels(submodels); + public B conceptDescriptions(List conceptDescriptions) { + getBuildingInstance().setConceptDescriptions(conceptDescriptions); return getSelf(); } /** - * This function allows adding a value to the List submodels + * This function allows adding a value to the List conceptDescriptions * - * @param submodels desired value to be added - * @return Builder object with new value for submodels + * @param conceptDescriptions desired value to be added + * @return Builder object with new value for conceptDescriptions */ - public B submodels(Submodel submodels) { - getBuildingInstance().getSubmodels().add(submodels); + public B conceptDescriptions(ConceptDescription conceptDescriptions) { + getBuildingInstance().getConceptDescriptions().add(conceptDescriptions); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java index 64012e1fb..b3e691032 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,57 +23,57 @@ public abstract class EventPayloadBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for observableReference + * This function allows setting a value for source * - * @param observableReference desired value to be set - * @return Builder object with new value for observableReference + * @param source desired value to be set + * @return Builder object with new value for source */ - public B observableReference(Reference observableReference) { - getBuildingInstance().setObservableReference(observableReference); + public B source(Reference source) { + getBuildingInstance().setSource(source); return getSelf(); } /** - * This function allows setting a value for observableSemanticId + * This function allows setting a value for sourceSemanticId * - * @param observableSemanticId desired value to be set - * @return Builder object with new value for observableSemanticId + * @param sourceSemanticId desired value to be set + * @return Builder object with new value for sourceSemanticId */ - public B observableSemanticId(Reference observableSemanticId) { - getBuildingInstance().setObservableSemanticId(observableSemanticId); + public B sourceSemanticId(Reference sourceSemanticId) { + getBuildingInstance().setSourceSemanticId(sourceSemanticId); return getSelf(); } /** - * This function allows setting a value for payload + * This function allows setting a value for observableReference * - * @param payload desired value to be set - * @return Builder object with new value for payload + * @param observableReference desired value to be set + * @return Builder object with new value for observableReference */ - public B payload(String payload) { - getBuildingInstance().setPayload(payload); + public B observableReference(Reference observableReference) { + getBuildingInstance().setObservableReference(observableReference); return getSelf(); } /** - * This function allows setting a value for source + * This function allows setting a value for observableSemanticId * - * @param source desired value to be set - * @return Builder object with new value for source + * @param observableSemanticId desired value to be set + * @return Builder object with new value for observableSemanticId */ - public B source(Reference source) { - getBuildingInstance().setSource(source); + public B observableSemanticId(Reference observableSemanticId) { + getBuildingInstance().setObservableSemanticId(observableSemanticId); return getSelf(); } /** - * This function allows setting a value for sourceSemanticId + * This function allows setting a value for topic * - * @param sourceSemanticId desired value to be set - * @return Builder object with new value for sourceSemanticId + * @param topic desired value to be set + * @return Builder object with new value for topic */ - public B sourceSemanticId(Reference sourceSemanticId) { - getBuildingInstance().setSourceSemanticId(sourceSemanticId); + public B topic(String topic) { + getBuildingInstance().setTopic(topic); return getSelf(); } @@ -100,13 +100,13 @@ public B timeStamp(String timeStamp) { } /** - * This function allows setting a value for topic + * This function allows setting a value for payload * - * @param topic desired value to be set - * @return Builder object with new value for topic + * @param payload desired value to be set + * @return Builder object with new value for payload */ - public B topic(String topic) { - getBuildingInstance().setTopic(topic); + public B payload(byte[] payload) { + getBuildingInstance().setPayload(payload); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java index 801912796..f11f39f72 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java index 624c24af8..d6dc6f4b4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -36,13 +36,13 @@ public B name(String name) { } /** - * This function allows setting a value for refersTo + * This function allows setting a value for valueType * - * @param refersTo desired value to be set - * @return Builder object with new value for refersTo + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B refersTo(Reference refersTo) { - getBuildingInstance().setRefersTo(refersTo); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } @@ -58,13 +58,24 @@ public B value(String value) { } /** - * This function allows setting a value for valueType + * This function allows setting a value for refersTo * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param refersTos desired value to be set + * @return Builder object with new value for refersTo */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); + public B refersTo(List refersTos) { + getBuildingInstance().setRefersTo(refersTos); + return getSelf(); + } + + /** + * This function allows adding a value to the List refersTo + * + * @param refersTo desired value to be added + * @return Builder object with new value for refersTo + */ + public B refersTo(Reference refersTo) { + getBuildingInstance().getRefersTo().add(refersTo); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java index 28fae5424..4bca2a16f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,24 +23,24 @@ public abstract class FileBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for contentType + * This function allows setting a value for value * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param value desired value to be set + * @return Builder object with new value for value */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for value + * This function allows setting a value for contentType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } @@ -100,68 +100,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -177,13 +166,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -208,26 +208,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java index 1b9ca58d6..131e0ee5d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java deleted file mode 100644 index 6b0c50df8..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - - -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - - -public abstract class LangStringBuilder> extends ExtendableBuilder { - - /** - * - * This function allows setting a value for text - * - * @param text desired value to be set - * - * @return Builder object with new value for text - * - */ - - public B text(String text) { - getBuildingInstance().setText(text); - return getSelf(); - } - - /** - * - * This function allows setting a value for language - * - * @param language desired value to be set - * - * @return Builder object with new value for language - * - */ - - public B language(String language) { - getBuildingInstance().setLanguage(language); - return getSelf(); - } - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java index 1cde475ec..b6d43e28e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java index daf8ebf61..2df57ae9c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java index ad320aab3..685de3530 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java index c15ba46bd..2b37bb3d5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java index 5ce64c49e..55e927566 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java index 4e763ab8d..47bc13d6c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java index 0a6a178fc..706314092 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -26,11 +26,11 @@ public abstract class MultiLanguagePropertyBuilder value) { - getBuildingInstance().setValue(value); + public B value(List values) { + getBuildingInstance().setValue(values); return getSelf(); } @@ -112,68 +112,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -189,13 +178,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -220,26 +220,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java index d54a79149..8c8b23f59 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,28 +22,6 @@ public abstract class OperationBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for inoutputVariables - * - * @param inoutputVariables desired value to be set - * @return Builder object with new value for inoutputVariables - */ - public B inoutputVariables(List inoutputVariables) { - getBuildingInstance().setInoutputVariables(inoutputVariables); - return getSelf(); - } - - /** - * This function allows adding a value to the List inoutputVariables - * - * @param inoutputVariables desired value to be added - * @return Builder object with new value for inoutputVariables - */ - public B inoutputVariables(OperationVariable inoutputVariables) { - getBuildingInstance().getInoutputVariables().add(inoutputVariables); - return getSelf(); - } - /** * This function allows setting a value for inputVariables * @@ -88,6 +66,28 @@ public B outputVariables(OperationVariable outputVariables) { return getSelf(); } + /** + * This function allows setting a value for inoutputVariables + * + * @param inoutputVariables desired value to be set + * @return Builder object with new value for inoutputVariables + */ + public B inoutputVariables(List inoutputVariables) { + getBuildingInstance().setInoutputVariables(inoutputVariables); + return getSelf(); + } + + /** + * This function allows adding a value to the List inoutputVariables + * + * @param inoutputVariables desired value to be added + * @return Builder object with new value for inoutputVariables + */ + public B inoutputVariables(OperationVariable inoutputVariables) { + getBuildingInstance().getInoutputVariables().add(inoutputVariables); + return getSelf(); + } + /** * This function allows setting a value for embeddedDataSpecifications * @@ -144,68 +144,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -221,13 +210,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -252,26 +252,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java index 6f429d8d8..cddb89a47 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java index de36ed0dd..9ceee2daa 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,6 +22,17 @@ public abstract class PropertyBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for valueType + * + * @param valueType desired value to be set + * @return Builder object with new value for valueType + */ + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); + return getSelf(); + } + /** * This function allows setting a value for value * @@ -44,17 +55,6 @@ public B valueId(Reference valueId) { return getSelf(); } - /** - * This function allows setting a value for valueType - * - * @param valueType desired value to be set - * @return Builder object with new value for valueType - */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); - return getSelf(); - } - /** * This function allows setting a value for embeddedDataSpecifications * @@ -111,68 +111,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -188,13 +177,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -219,26 +219,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java index 8e7d7b74d..24427c217 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -47,6 +47,17 @@ public B type(String type) { return getSelf(); } + /** + * This function allows setting a value for valueType + * + * @param valueType desired value to be set + * @return Builder object with new value for valueType + */ + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); + return getSelf(); + } + /** * This function allows setting a value for value * @@ -69,17 +80,6 @@ public B valueId(Reference valueId) { return getSelf(); } - /** - * This function allows setting a value for valueType - * - * @param valueType desired value to be set - * @return Builder object with new value for valueType - */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); - return getSelf(); - } - /** * This function allows setting a value for semanticId * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java index 35a2a059a..e9bae46c4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,13 +23,13 @@ public abstract class RangeBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for max + * This function allows setting a value for valueType * - * @param max desired value to be set - * @return Builder object with new value for max + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B max(String max) { - getBuildingInstance().setMax(max); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } @@ -45,13 +45,13 @@ public B min(String min) { } /** - * This function allows setting a value for valueType + * This function allows setting a value for max * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param max desired value to be set + * @return Builder object with new value for max */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); + public B max(String max) { + getBuildingInstance().setMax(max); return getSelf(); } @@ -111,68 +111,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -188,13 +177,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -219,26 +219,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java index 0af106b32..afec436d6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -25,46 +25,46 @@ public abstract class ReferenceBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for keys + * This function allows setting a value for type * - * @param keys desired value to be set - * @return Builder object with new value for keys + * @param type desired value to be set + * @return Builder object with new value for type */ - public B keys(List keys) { - getBuildingInstance().setKeys(keys); + public B type(ReferenceTypes type) { + getBuildingInstance().setType(type); return getSelf(); } /** - * This function allows adding a value to the List keys + * This function allows setting a value for referredSemanticId * - * @param keys desired value to be added - * @return Builder object with new value for keys + * @param referredSemanticId desired value to be set + * @return Builder object with new value for referredSemanticId */ - public B keys(Key keys) { - getBuildingInstance().getKeys().add(keys); + public B referredSemanticId(Reference referredSemanticId) { + getBuildingInstance().setReferredSemanticId(referredSemanticId); return getSelf(); } /** - * This function allows setting a value for referredSemanticId + * This function allows setting a value for keys * - * @param referredSemanticId desired value to be set - * @return Builder object with new value for referredSemanticId + * @param keys desired value to be set + * @return Builder object with new value for keys */ - public B referredSemanticId(Reference referredSemanticId) { - getBuildingInstance().setReferredSemanticId(referredSemanticId); + public B keys(List keys) { + getBuildingInstance().setKeys(keys); return getSelf(); } /** - * This function allows setting a value for type + * This function allows adding a value to the List keys * - * @param type desired value to be set - * @return Builder object with new value for type + * @param keys desired value to be added + * @return Builder object with new value for keys */ - public B type(ReferenceTypes type) { - getBuildingInstance().setType(type); + public B keys(Key keys) { + getBuildingInstance().getKeys().add(keys); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java index 04c10f8e4..a34e8526f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -90,68 +90,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -167,13 +156,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -198,26 +198,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java index 90dc6d0b1..1d6208913 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -101,68 +101,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -178,13 +167,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -209,26 +209,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java index 6bd878ef7..9fd9b7d69 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,24 +22,24 @@ public abstract class ResourceBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for contentType + * This function allows setting a value for path * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param path desired value to be set + * @return Builder object with new value for path */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B path(String path) { + getBuildingInstance().setPath(path); return getSelf(); } /** - * This function allows setting a value for path + * This function allows setting a value for contentType * - * @param path desired value to be set - * @return Builder object with new value for path + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B path(String path) { - getBuildingInstance().setPath(path); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java index 188a7a8f2..508446f79 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,17 +24,6 @@ public abstract class SpecificAssetIdBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for externalSubjectId - * - * @param externalSubjectId desired value to be set - * @return Builder object with new value for externalSubjectId - */ - public B externalSubjectId(Reference externalSubjectId) { - getBuildingInstance().setExternalSubjectId(externalSubjectId); - return getSelf(); - } - /** * This function allows setting a value for name * @@ -57,6 +46,17 @@ public B value(String value) { return getSelf(); } + /** + * This function allows setting a value for externalSubjectId + * + * @param externalSubjectId desired value to be set + * @return Builder object with new value for externalSubjectId + */ + public B externalSubjectId(Reference externalSubjectId) { + getBuildingInstance().setExternalSubjectId(externalSubjectId); + return getSelf(); + } + /** * This function allows setting a value for semanticId * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java index 1bc4b9a66..9b5b784b5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -67,90 +67,79 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for administration - * - * @param administration desired value to be set - * @return Builder object with new value for administration - */ - public B administration(AdministrativeInformation administration) { - getBuildingInstance().setAdministration(administration); - return getSelf(); - } - - /** - * This function allows setting a value for id + * This function allows setting a value for kind * - * @param id desired value to be set - * @return Builder object with new value for id + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B id(String id) { - getBuildingInstance().setId(id); + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for semanticId * - * @param category desired value to be set - * @return Builder object with new value for category + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows setting a value for supplementalSemanticIds * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); return getSelf(); } /** - * This function allows setting a value for description + * This function allows adding a value to the List supplementalSemanticIds * - * @param description desired value to be set - * @return Builder object with new value for description + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for administration * - * @param description desired value to be added - * @return Builder object with new value for description + * @param administration desired value to be set + * @return Builder object with new value for administration */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows setting a value for id * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param id desired value to be set + * @return Builder object with new value for id */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B id(String id) { + getBuildingInstance().setId(id); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for category * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param category desired value to be set + * @return Builder object with new value for category */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } @@ -166,68 +155,68 @@ public B idShort(String idShort) { } /** - * This function allows setting a value for extensions + * This function allows setting a value for displayName * - * @param extensions desired value to be set - * @return Builder object with new value for extensions + * @param displayNames desired value to be set + * @return Builder object with new value for displayName */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } /** - * This function allows adding a value to the List extensions + * This function allows adding a value to the List displayName * - * @param extensions desired value to be added - * @return Builder object with new value for extensions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows setting a value for semanticId + * This function allows setting a value for description * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); return getSelf(); } /** - * This function allows setting a value for supplementalSemanticIds + * This function allows adding a value to the List description * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds + * @param description desired value to be added + * @return Builder object with new value for description */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List supplementalSemanticIds + * This function allows setting a value for extensions * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds + * @param extensions desired value to be set + * @return Builder object with new value for extensions */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); return getSelf(); } /** - * This function allows setting a value for kind + * This function allows adding a value to the List extensions * - * @param kind desired value to be set - * @return Builder object with new value for kind + * @param extensions desired value to be added + * @return Builder object with new value for extensions */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java index fb37809e6..b13efa3e8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,7 +17,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.*; -import java.util.Collection; import java.util.List; @@ -27,11 +26,11 @@ public abstract class SubmodelElementCollectionBuilder value) { - getBuildingInstance().setValue(value); + public B value(List values) { + getBuildingInstance().setValue(values); return getSelf(); } @@ -102,68 +101,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -179,13 +167,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -210,26 +209,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java index cabcd023c..f52ed9b36 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -57,35 +57,35 @@ public B typeValueListElement(AasSubmodelElements typeValueListElement) { } /** - * This function allows setting a value for value + * This function allows setting a value for valueTypeListElement * - * @param value desired value to be set - * @return Builder object with new value for value + * @param valueTypeListElement desired value to be set + * @return Builder object with new value for valueTypeListElement */ - public B value(List value) { - getBuildingInstance().setValue(value); + public B valueTypeListElement(DataTypeDefXsd valueTypeListElement) { + getBuildingInstance().setValueTypeListElement(valueTypeListElement); return getSelf(); } /** - * This function allows adding a value to the List value + * This function allows setting a value for value * - * @param value desired value to be added + * @param values desired value to be set * @return Builder object with new value for value */ - public B value(SubmodelElement value) { - getBuildingInstance().getValue().add(value); + public B value(List values) { + getBuildingInstance().setValue(values); return getSelf(); } /** - * This function allows setting a value for valueTypeListElement + * This function allows adding a value to the List value * - * @param valueTypeListElement desired value to be set - * @return Builder object with new value for valueTypeListElement + * @param value desired value to be added + * @return Builder object with new value for value */ - public B valueTypeListElement(DataTypeDefXsd valueTypeListElement) { - getBuildingInstance().setValueTypeListElement(valueTypeListElement); + public B value(SubmodelElement value) { + getBuildingInstance().getValue().add(value); return getSelf(); } @@ -145,68 +145,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -222,13 +211,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -253,26 +253,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java index 524a25820..5050fe0a7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java index bd24f1053..8dfb746d3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java index 9a86cd699..e13dbd853 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,6 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.AdministrativeInformationBuilder; @@ -35,23 +36,29 @@ @IRI("aas:AdministrativeInformation") public class DefaultAdministrativeInformation implements AdministrativeInformation { - @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/creator") + protected Reference creator; + + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/revision") protected String revision; - @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId") + protected String templateId; + + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") protected String version; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - public DefaultAdministrativeInformation() { - - } + public DefaultAdministrativeInformation() {} @Override public int hashCode() { - return Objects.hash(this.revision, - this.version, + return Objects.hash(this.version, + this.revision, + this.creator, + this.templateId, this.embeddedDataSpecifications); } @@ -65,12 +72,24 @@ public boolean equals(Object obj) { return false; } else { DefaultAdministrativeInformation other = (DefaultAdministrativeInformation) obj; - return Objects.equals(this.revision, other.revision) && - Objects.equals(this.version, other.version) && + return Objects.equals(this.version, other.version) && + Objects.equals(this.revision, other.revision) && + Objects.equals(this.creator, other.creator) && + Objects.equals(this.templateId, other.templateId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); } } + @Override + public String getVersion() { + return version; + } + + @Override + public void setVersion(String version) { + this.version = version; + } + @Override public String getRevision() { return revision; @@ -82,13 +101,23 @@ public void setRevision(String revision) { } @Override - public String getVersion() { - return version; + public Reference getCreator() { + return creator; } @Override - public void setVersion(String version) { - this.version = version; + public void setCreator(Reference creator) { + this.creator = creator; + } + + @Override + public String getTemplateId() { + return templateId; + } + + @Override + public void setTemplateId(String templateId) { + this.templateId = templateId; } @Override @@ -101,6 +130,16 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } + public String toString() { + return String.format( + "DefaultAdministrativeInformation (" + "version=%s," + + "revision=%s," + + "creator=%s," + + "templateId=%s," + + ")", + this.version, this.revision, this.creator, this.templateId); + } + /** * This builder class can be used to construct a DefaultAdministrativeInformation bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java index 902dac60a..7e8ed7c90 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,53 +35,43 @@ @IRI("aas:AnnotatedRelationshipElement") public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshipElement { - @IRI("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations") + @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations") protected List annotations = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") + @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/first") protected Reference first; - @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") + @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") protected Reference second; - public DefaultAnnotatedRelationshipElement() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultAnnotatedRelationshipElement() {} @Override public int hashCode() { @@ -91,14 +81,12 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -117,14 +105,12 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @@ -189,13 +175,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -209,23 +195,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -234,18 +210,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -258,14 +234,11 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultAnnotatedRelationshipElement (" + "annotations=%s," + + ")", + this.annotations); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java index cd4830dff..1cc73cb62 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,59 +33,53 @@ @IRI("aas:AssetAdministrationShell") public class DefaultAssetAdministrationShell implements AssetAdministrationShell { - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation") protected AssetInformation assetInformation; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom") protected Reference derivedFrom; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels") protected List submodels = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultAssetAdministrationShell() { - - } + public DefaultAssetAdministrationShell() {} @Override public int hashCode() { - return Objects.hash(this.assetInformation, - this.derivedFrom, + return Objects.hash(this.derivedFrom, + this.assetInformation, this.submodels, this.embeddedDataSpecifications, this.administration, this.id, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, + this.displayName, + this.description, this.extensions); } @@ -99,39 +93,38 @@ public boolean equals(Object obj) { return false; } else { DefaultAssetAdministrationShell other = (DefaultAssetAdministrationShell) obj; - return Objects.equals(this.assetInformation, other.assetInformation) && - Objects.equals(this.derivedFrom, other.derivedFrom) && + return Objects.equals(this.derivedFrom, other.derivedFrom) && + Objects.equals(this.assetInformation, other.assetInformation) && Objects.equals(this.submodels, other.submodels) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && Objects.equals(this.extensions, other.extensions); } } @Override - public AssetInformation getAssetInformation() { - return assetInformation; + public Reference getDerivedFrom() { + return derivedFrom; } @Override - public void setAssetInformation(AssetInformation assetInformation) { - this.assetInformation = assetInformation; + public void setDerivedFrom(Reference derivedFrom) { + this.derivedFrom = derivedFrom; } @Override - public Reference getDerivedFrom() { - return derivedFrom; + public AssetInformation getAssetInformation() { + return assetInformation; } @Override - public void setDerivedFrom(Reference derivedFrom) { - this.derivedFrom = derivedFrom; + public void setAssetInformation(AssetInformation assetInformation) { + this.assetInformation = assetInformation; } @Override @@ -185,23 +178,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -210,18 +193,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -234,6 +217,15 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + public String toString() { + return String.format( + "DefaultAssetAdministrationShell (" + "derivedFrom=%s," + + "assetInformation=%s," + + "submodels=%s," + + ")", + this.derivedFrom, this.assetInformation, this.submodels); + } + /** * This builder class can be used to construct a DefaultAssetAdministrationShell bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java index a3f9112aa..0dbc4be34 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,7 +15,10 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.Resource; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetInformationBuilder; @@ -34,28 +37,30 @@ @IRI("aas:AssetInformation") public class DefaultAssetInformation implements AssetInformation { - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetKind") protected AssetKind assetKind; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetType") + protected String assetType; + + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") protected Resource defaultThumbnail; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId") protected String globalAssetId; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") protected List specificAssetIds = new ArrayList<>(); - public DefaultAssetInformation() { - - } + public DefaultAssetInformation() {} @Override public int hashCode() { return Objects.hash(this.assetKind, - this.defaultThumbnail, this.globalAssetId, - this.specificAssetIds); + this.specificAssetIds, + this.assetType, + this.defaultThumbnail); } @Override @@ -69,9 +74,10 @@ public boolean equals(Object obj) { } else { DefaultAssetInformation other = (DefaultAssetInformation) obj; return Objects.equals(this.assetKind, other.assetKind) && - Objects.equals(this.defaultThumbnail, other.defaultThumbnail) && Objects.equals(this.globalAssetId, other.globalAssetId) && - Objects.equals(this.specificAssetIds, other.specificAssetIds); + Objects.equals(this.specificAssetIds, other.specificAssetIds) && + Objects.equals(this.assetType, other.assetType) && + Objects.equals(this.defaultThumbnail, other.defaultThumbnail); } } @@ -85,16 +91,6 @@ public void setAssetKind(AssetKind assetKind) { this.assetKind = assetKind; } - @Override - public Resource getDefaultThumbnail() { - return defaultThumbnail; - } - - @Override - public void setDefaultThumbnail(Resource defaultThumbnail) { - this.defaultThumbnail = defaultThumbnail; - } - @Override public String getGlobalAssetId() { return globalAssetId; @@ -115,6 +111,37 @@ public void setSpecificAssetIds(List specificAssetIds) { this.specificAssetIds = specificAssetIds; } + @Override + public String getAssetType() { + return assetType; + } + + @Override + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + @Override + public Resource getDefaultThumbnail() { + return defaultThumbnail; + } + + @Override + public void setDefaultThumbnail(Resource defaultThumbnail) { + this.defaultThumbnail = defaultThumbnail; + } + + public String toString() { + return String.format( + "DefaultAssetInformation (" + "assetKind=%s," + + "globalAssetId=%s," + + "specificAssetIds=%s," + + "assetType=%s," + + "defaultThumbnail=%s," + + ")", + this.assetKind, this.globalAssetId, this.specificAssetIds, this.assetType, this.defaultThumbnail); + } + /** * This builder class can be used to construct a DefaultAssetInformation bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java index 25616f747..c83be01c2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,90 +33,78 @@ @IRI("aas:BasicEventElement") public class DefaultBasicEventElement implements BasicEventElement { - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/direction") protected Direction direction; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate") protected String lastUpdate; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval") protected String maxInterval; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker") protected Reference messageBroker; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic") protected String messageTopic; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/minInterval") protected String minInterval; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/observed") protected Reference observed; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/state") protected StateOfEvent state; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultBasicEventElement() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultBasicEventElement() {} @Override public int hashCode() { - return Objects.hash(this.direction, - this.lastUpdate, - this.maxInterval, - this.messageBroker, + return Objects.hash(this.observed, + this.direction, + this.state, this.messageTopic, + this.messageBroker, + this.lastUpdate, this.minInterval, - this.observed, - this.state, + this.maxInterval, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -129,28 +117,36 @@ public boolean equals(Object obj) { return false; } else { DefaultBasicEventElement other = (DefaultBasicEventElement) obj; - return Objects.equals(this.direction, other.direction) && - Objects.equals(this.lastUpdate, other.lastUpdate) && - Objects.equals(this.maxInterval, other.maxInterval) && - Objects.equals(this.messageBroker, other.messageBroker) && + return Objects.equals(this.observed, other.observed) && + Objects.equals(this.direction, other.direction) && + Objects.equals(this.state, other.state) && Objects.equals(this.messageTopic, other.messageTopic) && + Objects.equals(this.messageBroker, other.messageBroker) && + Objects.equals(this.lastUpdate, other.lastUpdate) && Objects.equals(this.minInterval, other.minInterval) && - Objects.equals(this.observed, other.observed) && - Objects.equals(this.state, other.state) && + Objects.equals(this.maxInterval, other.maxInterval) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } + @Override + public Reference getObserved() { + return observed; + } + + @Override + public void setObserved(Reference observed) { + this.observed = observed; + } + @Override public Direction getDirection() { return direction; @@ -162,23 +158,23 @@ public void setDirection(Direction direction) { } @Override - public String getLastUpdate() { - return lastUpdate; + public StateOfEvent getState() { + return state; } @Override - public void setLastUpdate(String lastUpdate) { - this.lastUpdate = lastUpdate; + public void setState(StateOfEvent state) { + this.state = state; } @Override - public String getMaxInterval() { - return maxInterval; + public String getMessageTopic() { + return messageTopic; } @Override - public void setMaxInterval(String maxInterval) { - this.maxInterval = maxInterval; + public void setMessageTopic(String messageTopic) { + this.messageTopic = messageTopic; } @Override @@ -192,13 +188,13 @@ public void setMessageBroker(Reference messageBroker) { } @Override - public String getMessageTopic() { - return messageTopic; + public String getLastUpdate() { + return lastUpdate; } @Override - public void setMessageTopic(String messageTopic) { - this.messageTopic = messageTopic; + public void setLastUpdate(String lastUpdate) { + this.lastUpdate = lastUpdate; } @Override @@ -212,23 +208,13 @@ public void setMinInterval(String minInterval) { } @Override - public Reference getObserved() { - return observed; - } - - @Override - public void setObserved(Reference observed) { - this.observed = observed; - } - - @Override - public StateOfEvent getState() { - return state; + public String getMaxInterval() { + return maxInterval; } @Override - public void setState(StateOfEvent state) { - this.state = state; + public void setMaxInterval(String maxInterval) { + this.maxInterval = maxInterval; } @Override @@ -262,13 +248,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -282,23 +268,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -307,18 +283,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -331,14 +307,19 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultBasicEventElement (" + "observed=%s," + + "direction=%s," + + "state=%s," + + "messageTopic=%s," + + "messageBroker=%s," + + "lastUpdate=%s," + + "minInterval=%s," + + "maxInterval=%s," + + ")", + this.observed, this.direction, this.state, this.messageTopic, this.messageBroker, this.lastUpdate, this.minInterval, + this.maxInterval); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index 47e6fca08..f0e59a60d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,68 +35,54 @@ @IRI("aas:Blob") public class DefaultBlob implements Blob { - @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") + @IRI("https://admin-shell.io/aas/3/0/Blob/contentType") protected String contentType; - @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/value") + @IRI("https://admin-shell.io/aas/3/0/Blob/value") protected byte[] value; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultBlob() { - - this.category = "VARIABLE"; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultBlob() {} @Override public int hashCode() { - return Objects.hash(this.contentType, - Arrays.hashCode(this.value), + return Objects.hash(Arrays.hashCode(this.value), + this.contentType, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -109,40 +95,38 @@ public boolean equals(Object obj) { return false; } else { DefaultBlob other = (DefaultBlob) obj; - return Objects.equals(this.contentType, other.contentType) && - Arrays.equals(this.value, other.value) && + return Arrays.equals(this.value, other.value) && + Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getContentType() { - return contentType; + public byte[] getValue() { + return value; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setValue(byte[] value) { + this.value = value; } @Override - public byte[] getValue() { - return value; + public String getContentType() { + return contentType; } @Override - public void setValue(byte[] value) { - this.value = value; + public void setContentType(String contentType) { + this.contentType = contentType; } @Override @@ -176,13 +160,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -196,23 +180,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -221,18 +195,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -245,14 +219,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultBlob (" + "value=%s," + + "contentType=%s," + + ")", + this.value, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java index 2201e9b54..6ca35f6bf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,58 +34,46 @@ @IRI("aas:Capability") public class DefaultCapability implements Capability { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultCapability() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultCapability() {} @Override public int hashCode() { return Objects.hash(this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -101,14 +89,12 @@ public boolean equals(Object obj) { return Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @@ -143,13 +129,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -163,23 +149,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -188,18 +164,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -212,14 +188,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } + public String toString() { + return String.format( + "DefaultCapability (" + + ")" - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + ); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java index cbf4079e2..51949170b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,41 +34,34 @@ @IRI("aas:ConceptDescription") public class DefaultConceptDescription implements ConceptDescription { - @IRI("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") + @IRI("https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf") protected List isCaseOf = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultConceptDescription() { - - this.category = "PROPERTY"; - - } + public DefaultConceptDescription() {} @Override public int hashCode() { @@ -77,10 +70,9 @@ public int hashCode() { this.administration, this.id, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, + this.displayName, + this.description, this.extensions); } @@ -99,10 +91,9 @@ public boolean equals(Object obj) { Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && Objects.equals(this.extensions, other.extensions); } } @@ -113,8 +104,8 @@ public List getIsCaseOf() { } @Override - public void setIsCaseOf(List isCaseOf) { - this.isCaseOf = isCaseOf; + public void setIsCaseOf(List isCaseOfs) { + this.isCaseOf = isCaseOfs; } @Override @@ -158,23 +149,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -183,18 +164,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -207,6 +188,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + public String toString() { + return String.format( + "DefaultConceptDescription (" + "isCaseOf=%s," + + ")", + this.isCaseOf); + } + /** * This builder class can be used to construct a DefaultConceptDescription bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java index 4b97ea5e2..b772cd0a6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,60 +35,58 @@ @IRI("aas:DataSpecificationIec61360") public class DefaultDataSpecificationIec61360 implements DataSpecificationIec61360 { - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType") protected DataTypeIec61360 dataType; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition") - protected List definition = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition") + protected List definition = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType") protected LevelType levelType; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName") - protected List preferredName = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName") + protected List preferredName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName") - protected List shortName = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName") + protected List shortName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition") protected String sourceOfDefinition; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol") protected String symbol; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit") protected String unit; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId") protected Reference unitId; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat") protected String valueFormat; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList") protected ValueList valueList; - public DefaultDataSpecificationIec61360() { - - } + public DefaultDataSpecificationIec61360() {} @Override public int hashCode() { - return Objects.hash(this.dataType, - this.definition, - this.levelType, - this.preferredName, + return Objects.hash(this.preferredName, this.shortName, - this.sourceOfDefinition, - this.symbol, this.unit, this.unitId, - this.value, + this.sourceOfDefinition, + this.symbol, + this.dataType, + this.definition, this.valueFormat, - this.valueList); + this.valueList, + this.value, + this.levelType); } @Override @@ -101,69 +99,59 @@ public boolean equals(Object obj) { return false; } else { DefaultDataSpecificationIec61360 other = (DefaultDataSpecificationIec61360) obj; - return Objects.equals(this.dataType, other.dataType) && - Objects.equals(this.definition, other.definition) && - Objects.equals(this.levelType, other.levelType) && - Objects.equals(this.preferredName, other.preferredName) && + return Objects.equals(this.preferredName, other.preferredName) && Objects.equals(this.shortName, other.shortName) && - Objects.equals(this.sourceOfDefinition, other.sourceOfDefinition) && - Objects.equals(this.symbol, other.symbol) && Objects.equals(this.unit, other.unit) && Objects.equals(this.unitId, other.unitId) && - Objects.equals(this.value, other.value) && + Objects.equals(this.sourceOfDefinition, other.sourceOfDefinition) && + Objects.equals(this.symbol, other.symbol) && + Objects.equals(this.dataType, other.dataType) && + Objects.equals(this.definition, other.definition) && Objects.equals(this.valueFormat, other.valueFormat) && - Objects.equals(this.valueList, other.valueList); + Objects.equals(this.valueList, other.valueList) && + Objects.equals(this.value, other.value) && + Objects.equals(this.levelType, other.levelType); } } @Override - public DataTypeIec61360 getDataType() { - return dataType; - } - - @Override - public void setDataType(DataTypeIec61360 dataType) { - this.dataType = dataType; + public List getPreferredName() { + return preferredName; } @Override - public List getDefinition() { - return definition; + public void setPreferredName(List preferredNames) { + this.preferredName = preferredNames; } @Override - public void setDefinition(List definition) { - this.definition = definition; + public List getShortName() { + return shortName; } @Override - public LevelType getLevelType() { - return levelType; + public void setShortName(List shortNames) { + this.shortName = shortNames; } @Override - public void setLevelType(LevelType levelType) { - this.levelType = levelType; - } - - @Override - public List getPreferredName() { - return preferredName; + public String getUnit() { + return unit; } @Override - public void setPreferredName(List preferredName) { - this.preferredName = preferredName; + public void setUnit(String unit) { + this.unit = unit; } @Override - public List getShortName() { - return shortName; + public Reference getUnitId() { + return unitId; } @Override - public void setShortName(List shortName) { - this.shortName = shortName; + public void setUnitId(Reference unitId) { + this.unitId = unitId; } @Override @@ -187,33 +175,23 @@ public void setSymbol(String symbol) { } @Override - public String getUnit() { - return unit; - } - - @Override - public void setUnit(String unit) { - this.unit = unit; - } - - @Override - public Reference getUnitId() { - return unitId; + public DataTypeIec61360 getDataType() { + return dataType; } @Override - public void setUnitId(Reference unitId) { - this.unitId = unitId; + public void setDataType(DataTypeIec61360 dataType) { + this.dataType = dataType; } @Override - public String getValue() { - return value; + public List getDefinition() { + return definition; } @Override - public void setValue(String value) { - this.value = value; + public void setDefinition(List definitions) { + this.definition = definitions; } @Override @@ -236,6 +214,45 @@ public void setValueList(ValueList valueList) { this.valueList = valueList; } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + + @Override + public LevelType getLevelType() { + return levelType; + } + + @Override + public void setLevelType(LevelType levelType) { + this.levelType = levelType; + } + + public String toString() { + return String.format( + "DefaultDataSpecificationIec61360 (" + "preferredName=%s," + + "shortName=%s," + + "unit=%s," + + "unitId=%s," + + "sourceOfDefinition=%s," + + "symbol=%s," + + "dataType=%s," + + "definition=%s," + + "valueFormat=%s," + + "valueList=%s," + + "value=%s," + + "levelType=%s," + + ")", + this.preferredName, this.shortName, this.unit, this.unitId, this.sourceOfDefinition, this.symbol, this.dataType, + this.definition, this.valueFormat, this.valueList, this.value, this.levelType); + } + /** * This builder class can be used to construct a DefaultDataSpecificationIec61360 bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java deleted file mode 100644 index 5abc284d3..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationPhysicalUnitBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit - * - */ - -@IRI("aas:DataSpecificationPhysicalUnit") -public class DefaultDataSpecificationPhysicalUnit implements DataSpecificationPhysicalUnit { - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") - protected String conversionFactor; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition") - protected List definition = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") - protected String dinNotation; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") - protected String eceCode; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName") - protected String eceName; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName") - protected String nistName; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") - protected String registrationAuthorityId; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName") - protected String siName; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") - protected String siNotation; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition") - protected String sourceOfDefinition; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier") - protected String supplier; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName") - protected String unitName; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") - protected String unitSymbol; - - public DefaultDataSpecificationPhysicalUnit() { - - } - - @Override - public int hashCode() { - return Objects.hash(this.conversionFactor, - this.definition, - this.dinNotation, - this.eceCode, - this.eceName, - this.nistName, - this.registrationAuthorityId, - this.siName, - this.siNotation, - this.sourceOfDefinition, - this.supplier, - this.unitName, - this.unitSymbol); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultDataSpecificationPhysicalUnit other = (DefaultDataSpecificationPhysicalUnit) obj; - return Objects.equals(this.conversionFactor, other.conversionFactor) && - Objects.equals(this.definition, other.definition) && - Objects.equals(this.dinNotation, other.dinNotation) && - Objects.equals(this.eceCode, other.eceCode) && - Objects.equals(this.eceName, other.eceName) && - Objects.equals(this.nistName, other.nistName) && - Objects.equals(this.registrationAuthorityId, other.registrationAuthorityId) && - Objects.equals(this.siName, other.siName) && - Objects.equals(this.siNotation, other.siNotation) && - Objects.equals(this.sourceOfDefinition, other.sourceOfDefinition) && - Objects.equals(this.supplier, other.supplier) && - Objects.equals(this.unitName, other.unitName) && - Objects.equals(this.unitSymbol, other.unitSymbol); - } - } - - @Override - public String getConversionFactor() { - return conversionFactor; - } - - @Override - public void setConversionFactor(String conversionFactor) { - this.conversionFactor = conversionFactor; - } - - @Override - public List getDefinition() { - return definition; - } - - @Override - public void setDefinition(List definition) { - this.definition = definition; - } - - @Override - public String getDinNotation() { - return dinNotation; - } - - @Override - public void setDinNotation(String dinNotation) { - this.dinNotation = dinNotation; - } - - @Override - public String getEceCode() { - return eceCode; - } - - @Override - public void setEceCode(String eceCode) { - this.eceCode = eceCode; - } - - @Override - public String getEceName() { - return eceName; - } - - @Override - public void setEceName(String eceName) { - this.eceName = eceName; - } - - @Override - public String getNistName() { - return nistName; - } - - @Override - public void setNistName(String nistName) { - this.nistName = nistName; - } - - @Override - public String getRegistrationAuthorityId() { - return registrationAuthorityId; - } - - @Override - public void setRegistrationAuthorityId(String registrationAuthorityId) { - this.registrationAuthorityId = registrationAuthorityId; - } - - @Override - public String getSiName() { - return siName; - } - - @Override - public void setSiName(String siName) { - this.siName = siName; - } - - @Override - public String getSiNotation() { - return siNotation; - } - - @Override - public void setSiNotation(String siNotation) { - this.siNotation = siNotation; - } - - @Override - public String getSourceOfDefinition() { - return sourceOfDefinition; - } - - @Override - public void setSourceOfDefinition(String sourceOfDefinition) { - this.sourceOfDefinition = sourceOfDefinition; - } - - @Override - public String getSupplier() { - return supplier; - } - - @Override - public void setSupplier(String supplier) { - this.supplier = supplier; - } - - @Override - public String getUnitName() { - return unitName; - } - - @Override - public void setUnitName(String unitName) { - this.unitName = unitName; - } - - @Override - public String getUnitSymbol() { - return unitSymbol; - } - - @Override - public void setUnitSymbol(String unitSymbol) { - this.unitSymbol = unitSymbol; - } - - /** - * This builder class can be used to construct a DefaultDataSpecificationPhysicalUnit bean. - */ - public static class Builder extends DataSpecificationPhysicalUnitBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultDataSpecificationPhysicalUnit newBuildingInstance() { - return new DefaultDataSpecificationPhysicalUnit(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java index 16d9fe711..0235e810d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,15 +34,13 @@ @IRI("aas:EmbeddedDataSpecification") public class DefaultEmbeddedDataSpecification implements EmbeddedDataSpecification { - @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") + @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification") protected Reference dataSpecification; - @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") + @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent") protected DataSpecificationContent dataSpecificationContent; - public DefaultEmbeddedDataSpecification() { - - } + public DefaultEmbeddedDataSpecification() {} @Override public int hashCode() { @@ -85,6 +83,14 @@ public void setDataSpecificationContent(DataSpecificationContent dataSpecificati this.dataSpecificationContent = dataSpecificationContent; } + public String toString() { + return String.format( + "DefaultEmbeddedDataSpecification (" + "dataSpecification=%s," + + "dataSpecificationContent=%s," + + ")", + this.dataSpecification, this.dataSpecificationContent); + } + /** * This builder class can be used to construct a DefaultEmbeddedDataSpecification bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java index 7c50e9497..2b38425b8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,74 +33,62 @@ @IRI("aas:Entity") public class DefaultEntity implements Entity { - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") + @IRI("https://admin-shell.io/aas/3/0/Entity/entityType") protected EntityType entityType; - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") + @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetId") protected String globalAssetId; - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") - protected SpecificAssetId specificAssetId; + @IRI("https://admin-shell.io/aas/3/0/Entity/specificAssetIds") + protected List specificAssetIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/statements") + @IRI("https://admin-shell.io/aas/3/0/Entity/statements") protected List statements = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultEntity() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultEntity() {} @Override public int hashCode() { - return Objects.hash(this.entityType, + return Objects.hash(this.statements, + this.entityType, this.globalAssetId, - this.specificAssetId, - this.statements, + this.specificAssetIds, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -113,24 +101,32 @@ public boolean equals(Object obj) { return false; } else { DefaultEntity other = (DefaultEntity) obj; - return Objects.equals(this.entityType, other.entityType) && + return Objects.equals(this.statements, other.statements) && + Objects.equals(this.entityType, other.entityType) && Objects.equals(this.globalAssetId, other.globalAssetId) && - Objects.equals(this.specificAssetId, other.specificAssetId) && - Objects.equals(this.statements, other.statements) && + Objects.equals(this.specificAssetIds, other.specificAssetIds) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } + @Override + public List getStatements() { + return statements; + } + + @Override + public void setStatements(List statements) { + this.statements = statements; + } + @Override public EntityType getEntityType() { return entityType; @@ -152,23 +148,13 @@ public void setGlobalAssetId(String globalAssetId) { } @Override - public SpecificAssetId getSpecificAssetId() { - return specificAssetId; - } - - @Override - public void setSpecificAssetId(SpecificAssetId specificAssetId) { - this.specificAssetId = specificAssetId; - } - - @Override - public List getStatements() { - return statements; + public List getSpecificAssetIds() { + return specificAssetIds; } @Override - public void setStatements(List statements) { - this.statements = statements; + public void setSpecificAssetIds(List specificAssetIds) { + this.specificAssetIds = specificAssetIds; } @Override @@ -202,13 +188,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -222,23 +208,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -247,18 +223,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -271,14 +247,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultEntity (" + "statements=%s," + + "entityType=%s," + + "globalAssetId=%s," + + "specificAssetIds=%s," + + ")", + this.statements, this.entityType, this.globalAssetId, this.specificAssetIds); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java index 012b4aca8..30d5f6377 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -36,24 +36,22 @@ @IRI("aas:Environment") public class DefaultEnvironment implements Environment { - @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") + @IRI("https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells") protected List assetAdministrationShells = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") + @IRI("https://admin-shell.io/aas/3/0/Environment/conceptDescriptions") protected List conceptDescriptions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") + @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") protected List submodels = new ArrayList<>(); - public DefaultEnvironment() { - - } + public DefaultEnvironment() {} @Override public int hashCode() { return Objects.hash(this.assetAdministrationShells, - this.conceptDescriptions, - this.submodels); + this.submodels, + this.conceptDescriptions); } @Override @@ -67,8 +65,8 @@ public boolean equals(Object obj) { } else { DefaultEnvironment other = (DefaultEnvironment) obj; return Objects.equals(this.assetAdministrationShells, other.assetAdministrationShells) && - Objects.equals(this.conceptDescriptions, other.conceptDescriptions) && - Objects.equals(this.submodels, other.submodels); + Objects.equals(this.submodels, other.submodels) && + Objects.equals(this.conceptDescriptions, other.conceptDescriptions); } } @@ -83,23 +81,32 @@ public void setAssetAdministrationShells(List assetAdm } @Override - public List getConceptDescriptions() { - return conceptDescriptions; + public List getSubmodels() { + return submodels; } @Override - public void setConceptDescriptions(List conceptDescriptions) { - this.conceptDescriptions = conceptDescriptions; + public void setSubmodels(List submodels) { + this.submodels = submodels; } @Override - public List getSubmodels() { - return submodels; + public List getConceptDescriptions() { + return conceptDescriptions; } @Override - public void setSubmodels(List submodels) { - this.submodels = submodels; + public void setConceptDescriptions(List conceptDescriptions) { + this.conceptDescriptions = conceptDescriptions; + } + + public String toString() { + return String.format( + "DefaultEnvironment (" + "assetAdministrationShells=%s," + + "submodels=%s," + + "conceptDescriptions=%s," + + ")", + this.assetAdministrationShells, this.submodels, this.conceptDescriptions); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java index ff4ffe345..750f1c5ff 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,6 +20,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.EventPayloadBuilder; +import java.util.Arrays; import java.util.Objects; @@ -32,44 +33,42 @@ @IRI("aas:EventPayload") public class DefaultEventPayload implements EventPayload { - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") protected Reference observableReference; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId") protected Reference observableSemanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/payload") - protected String payload; + @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") + protected byte[] payload; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/source") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") protected Reference source; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId") protected Reference sourceSemanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectId") protected Reference subjectId; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/timeStamp") protected String timeStamp; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/topic") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") protected String topic; - public DefaultEventPayload() { - - } + public DefaultEventPayload() {} @Override public int hashCode() { - return Objects.hash(this.observableReference, - this.observableSemanticId, - this.payload, - this.source, + return Objects.hash(this.source, this.sourceSemanticId, + this.observableReference, + this.observableSemanticId, + this.topic, this.subjectId, this.timeStamp, - this.topic); + Arrays.hashCode(this.payload)); } @Override @@ -82,65 +81,65 @@ public boolean equals(Object obj) { return false; } else { DefaultEventPayload other = (DefaultEventPayload) obj; - return Objects.equals(this.observableReference, other.observableReference) && - Objects.equals(this.observableSemanticId, other.observableSemanticId) && - Objects.equals(this.payload, other.payload) && - Objects.equals(this.source, other.source) && + return Objects.equals(this.source, other.source) && Objects.equals(this.sourceSemanticId, other.sourceSemanticId) && + Objects.equals(this.observableReference, other.observableReference) && + Objects.equals(this.observableSemanticId, other.observableSemanticId) && + Objects.equals(this.topic, other.topic) && Objects.equals(this.subjectId, other.subjectId) && Objects.equals(this.timeStamp, other.timeStamp) && - Objects.equals(this.topic, other.topic); + Arrays.equals(this.payload, other.payload); } } @Override - public Reference getObservableReference() { - return observableReference; + public Reference getSource() { + return source; } @Override - public void setObservableReference(Reference observableReference) { - this.observableReference = observableReference; + public void setSource(Reference source) { + this.source = source; } @Override - public Reference getObservableSemanticId() { - return observableSemanticId; + public Reference getSourceSemanticId() { + return sourceSemanticId; } @Override - public void setObservableSemanticId(Reference observableSemanticId) { - this.observableSemanticId = observableSemanticId; + public void setSourceSemanticId(Reference sourceSemanticId) { + this.sourceSemanticId = sourceSemanticId; } @Override - public String getPayload() { - return payload; + public Reference getObservableReference() { + return observableReference; } @Override - public void setPayload(String payload) { - this.payload = payload; + public void setObservableReference(Reference observableReference) { + this.observableReference = observableReference; } @Override - public Reference getSource() { - return source; + public Reference getObservableSemanticId() { + return observableSemanticId; } @Override - public void setSource(Reference source) { - this.source = source; + public void setObservableSemanticId(Reference observableSemanticId) { + this.observableSemanticId = observableSemanticId; } @Override - public Reference getSourceSemanticId() { - return sourceSemanticId; + public String getTopic() { + return topic; } @Override - public void setSourceSemanticId(Reference sourceSemanticId) { - this.sourceSemanticId = sourceSemanticId; + public void setTopic(String topic) { + this.topic = topic; } @Override @@ -164,13 +163,28 @@ public void setTimeStamp(String timeStamp) { } @Override - public String getTopic() { - return topic; + public byte[] getPayload() { + return payload; } @Override - public void setTopic(String topic) { - this.topic = topic; + public void setPayload(byte[] payload) { + this.payload = payload; + } + + public String toString() { + return String.format( + "DefaultEventPayload (" + "source=%s," + + "sourceSemanticId=%s," + + "observableReference=%s," + + "observableSemanticId=%s," + + "topic=%s," + + "subjectId=%s," + + "timeStamp=%s," + + "payload=%s," + + ")", + this.source, this.sourceSemanticId, this.observableReference, this.observableSemanticId, this.topic, this.subjectId, + this.timeStamp, this.payload); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java index ffe3224de..eb013ed1f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,36 +35,32 @@ @IRI("aas:Extension") public class DefaultExtension implements Extension { - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/name") + @IRI("https://admin-shell.io/aas/3/0/Extension/name") protected String name; - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") - protected Reference refersTo; + @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") + protected List refersTo = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/value") + @IRI("https://admin-shell.io/aas/3/0/Extension/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") + @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - public DefaultExtension() { - - this.valueType = DataTypeDefXsd.STRING; - - } + public DefaultExtension() {} @Override public int hashCode() { return Objects.hash(this.name, - this.refersTo, - this.value, this.valueType, + this.value, + this.refersTo, this.semanticId, this.supplementalSemanticIds); } @@ -80,9 +76,9 @@ public boolean equals(Object obj) { } else { DefaultExtension other = (DefaultExtension) obj; return Objects.equals(this.name, other.name) && - Objects.equals(this.refersTo, other.refersTo) && - Objects.equals(this.value, other.value) && Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.value, other.value) && + Objects.equals(this.refersTo, other.refersTo) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } @@ -99,13 +95,13 @@ public void setName(String name) { } @Override - public Reference getRefersTo() { - return refersTo; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setRefersTo(Reference refersTo) { - this.refersTo = refersTo; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override @@ -119,13 +115,13 @@ public void setValue(String value) { } @Override - public DataTypeDefXsd getValueType() { - return valueType; + public List getRefersTo() { + return refersTo; } @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; + public void setRefersTo(List refersTos) { + this.refersTo = refersTos; } @Override @@ -148,6 +144,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + public String toString() { + return String.format( + "DefaultExtension (" + "name=%s," + + "valueType=%s," + + "value=%s," + + "refersTo=%s," + + ")", + this.name, this.valueType, this.value, this.refersTo); + } + /** * This builder class can be used to construct a DefaultExtension bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java index 07fbdc6ae..52f767e6e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,68 +33,54 @@ @IRI("aas:File") public class DefaultFile implements File { - @IRI("https://admin-shell.io/aas/3/0/RC02/File/contentType") + @IRI("https://admin-shell.io/aas/3/0/File/contentType") protected String contentType; - @IRI("https://admin-shell.io/aas/3/0/RC02/File/value") + @IRI("https://admin-shell.io/aas/3/0/File/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultFile() { - - this.category = "VARIABLE"; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultFile() {} @Override public int hashCode() { - return Objects.hash(this.contentType, - this.value, + return Objects.hash(this.value, + this.contentType, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -107,40 +93,38 @@ public boolean equals(Object obj) { return false; } else { DefaultFile other = (DefaultFile) obj; - return Objects.equals(this.contentType, other.contentType) && - Objects.equals(this.value, other.value) && + return Objects.equals(this.value, other.value) && + Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getContentType() { - return contentType; + public String getValue() { + return value; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setValue(String value) { + this.value = value; } @Override - public String getValue() { - return value; + public String getContentType() { + return contentType; } @Override - public void setValue(String value) { - this.value = value; + public void setContentType(String contentType) { + this.contentType = contentType; } @Override @@ -174,13 +158,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -194,23 +178,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -219,18 +193,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -243,14 +217,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultFile (" + "value=%s," + + "contentType=%s," + + ")", + this.value, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java index ad4f10f7f..45d6d6f7e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,15 +32,13 @@ @IRI("aas:Key") public class DefaultKey implements Key { - @IRI("https://admin-shell.io/aas/3/0/RC02/Key/type") + @IRI("https://admin-shell.io/aas/3/0/Key/type") protected KeyTypes type; - @IRI("https://admin-shell.io/aas/3/0/RC02/Key/value") + @IRI("https://admin-shell.io/aas/3/0/Key/value") protected String value; - public DefaultKey() { - - } + public DefaultKey() {} @Override public int hashCode() { @@ -83,6 +81,14 @@ public void setValue(String value) { this.value = value; } + public String toString() { + return String.format( + "DefaultKey (" + "type=%s," + + "value=%s," + + ")", + this.type, this.value); + } + /** * This builder class can be used to construct a DefaultKey bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java deleted file mode 100644 index 30b2300cf..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringBuilder; - -import java.util.Objects; - - -@IRI("rdf:langString") -public class DefaultLangString implements LangString { - - protected String language = null; - protected String text = null; - - public DefaultLangString() { - super(); - } - - public DefaultLangString(String textAndLanguage) { - if (textAndLanguage.contains("@")) { - String[] splitString = textAndLanguage.split("@"); - this.text = splitString[0]; - this.language = splitString[1]; - } else { - this.text = textAndLanguage; - } - } - - public DefaultLangString(String text, String language) { - this.text = text; - this.language = language; - } - - @Override - public String getLanguage() { - return language; - } - - @Override - public void setLanguage(String language) { - this.language = language; - } - - @Override - public String getText() { - return text; - } - - @Override - public void setText(String text) { - this.text = text; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultLangString other = (DefaultLangString) obj; - return Objects.equals(this.language, other.language) && Objects.equals(this.text, other.text); - } - } - - @Override - public int hashCode() { - return Objects.hash(this.language, this.text); - } - - @Override - public String toString() { - String result = this.text; - if (this.language != null && !this.language.isEmpty()) { - return "\"" + result + "\"@" + this.language; - } - return result; - } - - /** - * This builder class can be used to construct a DefaultLangString bean. - */ - public static class Builder extends LangStringBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultLangString newBuildingInstance() { - return new DefaultLangString(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java index da15bb1e0..4c8a473b9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java index 39f6e1fe3..cf01867c5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java index 8e62a44e0..40be9c6fc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java index 9b718f90e..f33fc73ee 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java index ef6a0b75a..196784d6e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java index 667fa1098..5cf2b4ecd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java index f145a7e5d..16705fbb2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,52 +33,40 @@ @IRI("aas:MultiLanguageProperty") public class DefaultMultiLanguageProperty implements MultiLanguageProperty { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") + @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/value") protected List value = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") + @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId") protected Reference valueId; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultMultiLanguageProperty() { - - this.category = "VARIABLE"; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultMultiLanguageProperty() {} @Override public int hashCode() { @@ -87,14 +75,12 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -112,14 +98,12 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @@ -129,8 +113,8 @@ public List getValue() { } @Override - public void setValue(List value) { - this.value = value; + public void setValue(List values) { + this.value = values; } @Override @@ -174,13 +158,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -194,23 +178,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -219,18 +193,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -243,14 +217,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultMultiLanguageProperty (" + "value=%s," + + "valueId=%s," + + ")", + this.value, this.valueId); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java index 570604091..eb713de68 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,70 +33,58 @@ @IRI("aas:Operation") public class DefaultOperation implements Operation { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables") + @IRI("https://admin-shell.io/aas/3/0/Operation/inoutputVariables") protected List inoutputVariables = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables") + @IRI("https://admin-shell.io/aas/3/0/Operation/inputVariables") protected List inputVariables = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables") + @IRI("https://admin-shell.io/aas/3/0/Operation/outputVariables") protected List outputVariables = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultOperation() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultOperation() {} @Override public int hashCode() { - return Objects.hash(this.inoutputVariables, - this.inputVariables, + return Objects.hash(this.inputVariables, this.outputVariables, + this.inoutputVariables, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -109,33 +97,21 @@ public boolean equals(Object obj) { return false; } else { DefaultOperation other = (DefaultOperation) obj; - return Objects.equals(this.inoutputVariables, other.inoutputVariables) && - Objects.equals(this.inputVariables, other.inputVariables) && + return Objects.equals(this.inputVariables, other.inputVariables) && Objects.equals(this.outputVariables, other.outputVariables) && + Objects.equals(this.inoutputVariables, other.inoutputVariables) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } - @Override - public List getInoutputVariables() { - return inoutputVariables; - } - - @Override - public void setInoutputVariables(List inoutputVariables) { - this.inoutputVariables = inoutputVariables; - } - @Override public List getInputVariables() { return inputVariables; @@ -156,6 +132,16 @@ public void setOutputVariables(List outputVariables) { this.outputVariables = outputVariables; } + @Override + public List getInoutputVariables() { + return inoutputVariables; + } + + @Override + public void setInoutputVariables(List inoutputVariables) { + this.inoutputVariables = inoutputVariables; + } + @Override public List getEmbeddedDataSpecifications() { return embeddedDataSpecifications; @@ -187,13 +173,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -207,23 +193,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -232,18 +208,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -256,14 +232,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultOperation (" + "inputVariables=%s," + + "outputVariables=%s," + + "inoutputVariables=%s," + + ")", + this.inputVariables, this.outputVariables, this.inoutputVariables); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java index a559f8ac1..17f42b008 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,7 +33,7 @@ @IRI("aas:OperationVariable") public class DefaultOperationVariable implements OperationVariable { - @IRI("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") + @IRI("https://admin-shell.io/aas/3/0/OperationVariable/value") protected SubmodelElement value; public DefaultOperationVariable() {} @@ -67,6 +67,13 @@ public void setValue(SubmodelElement value) { this.value = value; } + public String toString() { + return String.format( + "DefaultOperationVariable (" + "value=%s," + + ")", + this.value); + } + /** * This builder class can be used to construct a DefaultOperationVariable bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java index 29a8c7c06..7917d7d94 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,72 +33,58 @@ @IRI("aas:Property") public class DefaultProperty implements Property { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Property/value") + @IRI("https://admin-shell.io/aas/3/0/Property/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueId") + @IRI("https://admin-shell.io/aas/3/0/Property/valueId") protected Reference valueId; - @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueType") + @IRI("https://admin-shell.io/aas/3/0/Property/valueType") protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultProperty() { - - this.category = "VARIABLE"; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultProperty() {} @Override public int hashCode() { - return Objects.hash(this.value, + return Objects.hash(this.valueType, + this.value, this.valueId, - this.valueType, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -111,23 +97,31 @@ public boolean equals(Object obj) { return false; } else { DefaultProperty other = (DefaultProperty) obj; - return Objects.equals(this.value, other.value) && + return Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && - Objects.equals(this.valueType, other.valueType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } + @Override + public DataTypeDefXsd getValueType() { + return valueType; + } + + @Override + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; + } + @Override public String getValue() { return value; @@ -148,16 +142,6 @@ public void setValueId(Reference valueId) { this.valueId = valueId; } - @Override - public DataTypeDefXsd getValueType() { - return valueType; - } - - @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; - } - @Override public List getEmbeddedDataSpecifications() { return embeddedDataSpecifications; @@ -189,13 +173,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -209,23 +193,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -234,18 +208,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -258,14 +232,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultProperty (" + "valueType=%s," + + "value=%s," + + "valueId=%s," + + ")", + this.valueType, this.value, this.valueId); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java index 659a522bd..4a3447a43 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -37,39 +37,36 @@ @IRI("aas:Qualifier") public class DefaultQualifier implements Qualifier { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/kind") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/kind") protected QualifierKind kind; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/type") protected String type; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueId") protected Reference valueId; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") protected DataTypeDefXsd valueType; - public DefaultQualifier() { - this.kind = QualifierKind.CONCEPT_QUALIFIER; - - } + public DefaultQualifier() {} @Override public int hashCode() { return Objects.hash(this.kind, this.type, + this.valueType, this.value, this.valueId, - this.valueType, this.semanticId, this.supplementalSemanticIds); } @@ -86,9 +83,9 @@ public boolean equals(Object obj) { DefaultQualifier other = (DefaultQualifier) obj; return Objects.equals(this.kind, other.kind) && Objects.equals(this.type, other.type) && + Objects.equals(this.valueType, other.valueType) && Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && - Objects.equals(this.valueType, other.valueType) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } @@ -114,6 +111,16 @@ public void setType(String type) { this.type = type; } + @Override + public DataTypeDefXsd getValueType() { + return valueType; + } + + @Override + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; + } + @Override public String getValue() { return value; @@ -134,16 +141,6 @@ public void setValueId(Reference valueId) { this.valueId = valueId; } - @Override - public DataTypeDefXsd getValueType() { - return valueType; - } - - @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; - } - @Override public Reference getSemanticId() { return semanticId; @@ -164,6 +161,17 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + public String toString() { + return String.format( + "DefaultQualifier (" + "kind=%s," + + "type=%s," + + "valueType=%s," + + "value=%s," + + "valueId=%s," + + ")", + this.kind, this.type, this.valueType, this.value, this.valueId); + } + /** * This builder class can be used to construct a DefaultQualifier bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java index ce1dcb808..475339717 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,72 +33,58 @@ @IRI("aas:Range") public class DefaultRange implements Range { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Range/max") + @IRI("https://admin-shell.io/aas/3/0/Range/max") protected String max; - @IRI("https://admin-shell.io/aas/3/0/RC02/Range/min") + @IRI("https://admin-shell.io/aas/3/0/Range/min") protected String min; - @IRI("https://admin-shell.io/aas/3/0/RC02/Range/valueType") + @IRI("https://admin-shell.io/aas/3/0/Range/valueType") protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultRange() { - - this.category = "VARIABLE"; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultRange() {} @Override public int hashCode() { - return Objects.hash(this.max, + return Objects.hash(this.valueType, this.min, - this.valueType, + this.max, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -111,31 +97,29 @@ public boolean equals(Object obj) { return false; } else { DefaultRange other = (DefaultRange) obj; - return Objects.equals(this.max, other.max) && + return Objects.equals(this.valueType, other.valueType) && Objects.equals(this.min, other.min) && - Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.max, other.max) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getMax() { - return max; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setMax(String max) { - this.max = max; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override @@ -149,13 +133,13 @@ public void setMin(String min) { } @Override - public DataTypeDefXsd getValueType() { - return valueType; + public String getMax() { + return max; } @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; + public void setMax(String max) { + this.max = max; } @Override @@ -189,13 +173,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -209,23 +193,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -234,18 +208,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -258,14 +232,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultRange (" + "valueType=%s," + + "min=%s," + + "max=%s," + + ")", + this.valueType, this.min, this.max); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java index be3e718f9..ceed8d70d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,24 +35,22 @@ @IRI("aas:Reference") public class DefaultReference implements Reference { - @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/keys") + @IRI("https://admin-shell.io/aas/3/0/Reference/keys") protected List keys = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId") + @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticId") protected Reference referredSemanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/type") + @IRI("https://admin-shell.io/aas/3/0/Reference/type") protected ReferenceTypes type; - public DefaultReference() { - - } + public DefaultReference() {} @Override public int hashCode() { - return Objects.hash(this.keys, + return Objects.hash(this.type, this.referredSemanticId, - this.type); + this.keys); } @Override @@ -65,20 +63,20 @@ public boolean equals(Object obj) { return false; } else { DefaultReference other = (DefaultReference) obj; - return Objects.equals(this.keys, other.keys) && + return Objects.equals(this.type, other.type) && Objects.equals(this.referredSemanticId, other.referredSemanticId) && - Objects.equals(this.type, other.type); + Objects.equals(this.keys, other.keys); } } @Override - public List getKeys() { - return keys; + public ReferenceTypes getType() { + return type; } @Override - public void setKeys(List keys) { - this.keys = keys; + public void setType(ReferenceTypes type) { + this.type = type; } @Override @@ -92,13 +90,22 @@ public void setReferredSemanticId(Reference referredSemanticId) { } @Override - public ReferenceTypes getType() { - return type; + public List getKeys() { + return keys; } @Override - public void setType(ReferenceTypes type) { - this.type = type; + public void setKeys(List keys) { + this.keys = keys; + } + + public String toString() { + return String.format( + "DefaultReference (" + "type=%s," + + "referredSemanticId=%s," + + "keys=%s," + + ")", + this.type, this.referredSemanticId, this.keys); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java index 730521770..da64e65ec 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,49 +34,37 @@ @IRI("aas:ReferenceElement") public class DefaultReferenceElement implements ReferenceElement { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") + @IRI("https://admin-shell.io/aas/3/0/ReferenceElement/value") protected Reference value; - public DefaultReferenceElement() { - - this.category = "VARIABLE"; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultReferenceElement() {} @Override public int hashCode() { @@ -84,14 +72,12 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -108,14 +94,12 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @@ -160,13 +144,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -180,23 +164,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -205,18 +179,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -229,14 +203,11 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultReferenceElement (" + "value=%s," + + ")", + this.value); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java index 31ce95a0c..d151659c5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,50 +34,40 @@ @IRI("aas:RelationshipElement") public class DefaultRelationshipElement implements RelationshipElement { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") + @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/first") protected Reference first; - @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") + @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") protected Reference second; - public DefaultRelationshipElement() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultRelationshipElement() {} @Override public int hashCode() { @@ -86,14 +76,12 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -111,14 +99,12 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @@ -173,13 +159,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -193,23 +179,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -218,18 +194,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -242,14 +218,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultRelationshipElement (" + "first=%s," + + "second=%s," + + ")", + this.first, this.second); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java index ae673a6b6..068c2ad83 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,20 +32,18 @@ @IRI("aas:Resource") public class DefaultResource implements Resource { - @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") + @IRI("https://admin-shell.io/aas/3/0/Resource/contentType") protected String contentType; - @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/path") + @IRI("https://admin-shell.io/aas/3/0/Resource/path") protected String path; - public DefaultResource() { - - } + public DefaultResource() {} @Override public int hashCode() { - return Objects.hash(this.contentType, - this.path); + return Objects.hash(this.path, + this.contentType); } @Override @@ -58,29 +56,37 @@ public boolean equals(Object obj) { return false; } else { DefaultResource other = (DefaultResource) obj; - return Objects.equals(this.contentType, other.contentType) && - Objects.equals(this.path, other.path); + return Objects.equals(this.path, other.path) && + Objects.equals(this.contentType, other.contentType); } } @Override - public String getContentType() { - return contentType; + public String getPath() { + return path; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setPath(String path) { + this.path = path; } @Override - public String getPath() { - return path; + public String getContentType() { + return contentType; } @Override - public void setPath(String path) { - this.path = path; + public void setContentType(String contentType) { + this.contentType = contentType; + } + + public String toString() { + return String.format( + "DefaultResource (" + "path=%s," + + "contentType=%s," + + ")", + this.path, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java index a7ecb4299..53122fe0c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,30 +34,28 @@ @IRI("aas:SpecificAssetId") public class DefaultSpecificAssetId implements SpecificAssetId { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") + @IRI("https://admin-shell.io/aas/3/0/SpecificAssetId/externalSubjectId") protected Reference externalSubjectId; - @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") + @IRI("https://admin-shell.io/aas/3/0/SpecificAssetId/name") protected String name; - @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") + @IRI("https://admin-shell.io/aas/3/0/SpecificAssetId/value") protected String value; - public DefaultSpecificAssetId() { - - } + public DefaultSpecificAssetId() {} @Override public int hashCode() { - return Objects.hash(this.externalSubjectId, - this.name, + return Objects.hash(this.name, this.value, + this.externalSubjectId, this.semanticId, this.supplementalSemanticIds); } @@ -72,24 +70,14 @@ public boolean equals(Object obj) { return false; } else { DefaultSpecificAssetId other = (DefaultSpecificAssetId) obj; - return Objects.equals(this.externalSubjectId, other.externalSubjectId) && - Objects.equals(this.name, other.name) && + return Objects.equals(this.name, other.name) && Objects.equals(this.value, other.value) && + Objects.equals(this.externalSubjectId, other.externalSubjectId) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } } - @Override - public Reference getExternalSubjectId() { - return externalSubjectId; - } - - @Override - public void setExternalSubjectId(Reference externalSubjectId) { - this.externalSubjectId = externalSubjectId; - } - @Override public String getName() { return name; @@ -110,6 +98,16 @@ public void setValue(String value) { this.value = value; } + @Override + public Reference getExternalSubjectId() { + return externalSubjectId; + } + + @Override + public void setExternalSubjectId(Reference externalSubjectId) { + this.externalSubjectId = externalSubjectId; + } + @Override public Reference getSemanticId() { return semanticId; @@ -130,6 +128,15 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + public String toString() { + return String.format( + "DefaultSpecificAssetId (" + "name=%s," + + "value=%s," + + "externalSubjectId=%s," + + ")", + this.name, this.value, this.externalSubjectId); + } + /** * This builder class can be used to construct a DefaultSpecificAssetId bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java index 1eb569d42..b5697a48f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,69 +33,61 @@ @IRI("aas:Submodel") public class DefaultSubmodel implements Submodel { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; + @IRI("https://admin-shell.io/aas/3/0/HasKind/kind") + protected ModellingKind kind; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements") + @IRI("https://admin-shell.io/aas/3/0/Submodel/submodelElements") protected List submodelElements = new ArrayList<>(); - public DefaultSubmodel() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultSubmodel() {} @Override public int hashCode() { return Objects.hash(this.submodelElements, this.embeddedDataSpecifications, + this.kind, + this.semanticId, + this.supplementalSemanticIds, this.administration, this.id, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, + this.displayName, + this.description, this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.kind, this.qualifiers); } @@ -111,17 +103,16 @@ public boolean equals(Object obj) { DefaultSubmodel other = (DefaultSubmodel) obj; return Objects.equals(this.submodelElements, other.submodelElements) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.kind, other.kind) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && Objects.equals(this.qualifiers, other.qualifiers); } } @@ -147,63 +138,63 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public AdministrativeInformation getAdministration() { - return administration; + public ModellingKind getKind() { + return kind; } @Override - public void setAdministration(AdministrativeInformation administration) { - this.administration = administration; + public void setKind(ModellingKind kind) { + this.kind = kind; } @Override - public String getId() { - return id; + public Reference getSemanticId() { + return semanticId; } @Override - public void setId(String id) { - this.id = id; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override - public String getCategory() { - return category; + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; } @Override - public void setCategory(String category) { - this.category = category; + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; } @Override - public String getChecksum() { - return checksum; + public AdministrativeInformation getAdministration() { + return administration; } @Override - public void setChecksum(String checksum) { - this.checksum = checksum; + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; } @Override - public List getDescription() { - return description; + public String getId() { + return id; } @Override - public void setDescription(List description) { - this.description = description; + public void setId(String id) { + this.id = id; } @Override - public List getDisplayName() { - return displayName; + public String getCategory() { + return category; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setCategory(String category) { + this.category = category; } @Override @@ -217,43 +208,33 @@ public void setIdShort(String idShort) { } @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; + public List getDisplayName() { + return displayName; } @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; + public List getDescription() { + return description; } @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override - public ModelingKind getKind() { - return kind; + public List getExtensions() { + return extensions; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setExtensions(List extensions) { + this.extensions = extensions; } @Override @@ -266,6 +247,13 @@ public void setQualifiers(List qualifiers) { this.qualifiers = qualifiers; } + public String toString() { + return String.format( + "DefaultSubmodel (" + "submodelElements=%s," + + ")", + this.submodelElements); + } + /** * This builder class can be used to construct a DefaultSubmodel bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java index 9db7dacce..a81775b3b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,7 +20,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelElementCollectionBuilder; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Objects; @@ -36,47 +35,37 @@ @IRI("aas:SubmodelElementCollection") public class DefaultSubmodelElementCollection implements SubmodelElementCollection { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") - protected Collection value = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementCollection/value") + protected List value = new ArrayList<>(); - public DefaultSubmodelElementCollection() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultSubmodelElementCollection() {} @Override public int hashCode() { @@ -84,14 +73,12 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -108,25 +95,23 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @Override - public Collection getValue() { + public List getValue() { return value; } @Override - public void setValue(Collection value) { - this.value = value; + public void setValue(List values) { + this.value = values; } @Override @@ -160,13 +145,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -180,23 +165,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -205,18 +180,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -229,14 +204,11 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultSubmodelElementCollection (" + "value=%s," + + ")", + this.value); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java index 631726d88..221b3fd75 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,79 +33,66 @@ @IRI("aas:SubmodelElementList") public class DefaultSubmodelElementList implements SubmodelElementList { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant") protected boolean orderRelevant; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement") protected Reference semanticIdListElement; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement") protected AasSubmodelElements typeValueListElement; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") protected List value = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") protected DataTypeDefXsd valueTypeListElement; - public DefaultSubmodelElementList() { - this.orderRelevant = Boolean.TRUE; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultSubmodelElementList() {} @Override public int hashCode() { return Objects.hash(this.orderRelevant, this.semanticIdListElement, this.typeValueListElement, - this.value, this.valueTypeListElement, + this.value, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -121,19 +108,17 @@ public boolean equals(Object obj) { return Objects.equals(this.orderRelevant, other.orderRelevant) && Objects.equals(this.semanticIdListElement, other.semanticIdListElement) && Objects.equals(this.typeValueListElement, other.typeValueListElement) && - Objects.equals(this.value, other.value) && Objects.equals(this.valueTypeListElement, other.valueTypeListElement) && + Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @@ -168,23 +153,23 @@ public void setTypeValueListElement(AasSubmodelElements typeValueListElement) { } @Override - public List getValue() { - return value; + public DataTypeDefXsd getValueTypeListElement() { + return valueTypeListElement; } @Override - public void setValue(List value) { - this.value = value; + public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement) { + this.valueTypeListElement = valueTypeListElement; } @Override - public DataTypeDefXsd getValueTypeListElement() { - return valueTypeListElement; + public List getValue() { + return value; } @Override - public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement) { - this.valueTypeListElement = valueTypeListElement; + public void setValue(List values) { + this.value = values; } @Override @@ -218,13 +203,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -238,23 +223,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -263,18 +238,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -287,14 +262,15 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultSubmodelElementList (" + "orderRelevant=%s," + + "semanticIdListElement=%s," + + "typeValueListElement=%s," + + "valueTypeListElement=%s," + + "value=%s," + + ")", + this.orderRelevant, this.semanticIdListElement, this.typeValueListElement, this.valueTypeListElement, this.value); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java index d9a5cba53..95df776d9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,7 +34,7 @@ @IRI("aas:ValueList") public class DefaultValueList implements ValueList { - @IRI("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") + @IRI("https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs") protected List valueReferencePairs = new ArrayList<>(); public DefaultValueList() {} @@ -68,6 +68,13 @@ public void setValueReferencePairs(List valueReferencePairs) this.valueReferencePairs = valueReferencePairs; } + public String toString() { + return String.format( + "DefaultValueList (" + "valueReferencePairs=%s," + + ")", + this.valueReferencePairs); + } + /** * This builder class can be used to construct a DefaultValueList bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java index af589cd39..752281744 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,15 +33,13 @@ @IRI("aas:ValueReferencePair") public class DefaultValueReferencePair implements ValueReferencePair { - @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") + @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") + @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueId") protected Reference valueId; - public DefaultValueReferencePair() { - - } + public DefaultValueReferencePair() {} @Override public int hashCode() { @@ -84,6 +82,14 @@ public void setValueId(Reference valueId) { this.valueId = valueId; } + public String toString() { + return String.format( + "DefaultValueReferencePair (" + "value=%s," + + "valueId=%s," + + ")", + this.value, this.valueId); + } + /** * This builder class can be used to construct a DefaultValueReferencePair bean. */ From 49e6e230d924e5a533688f146a9c206978e703d6 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 4 Jul 2023 10:02:23 +0200 Subject: [PATCH 18/59] Fix the tests in dataformat-core --- .../digitaltwin/aas4j/v3/dataformat/core/AASFull.java | 1 - .../aas4j/v3/dataformat/core/EnumSerializerTest.java | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 527b0f4c3..71900b150 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -18,7 +18,6 @@ import java.util.Arrays; import java.util.Base64; -import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 29a67e198..c080e8cf6 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,14 +70,14 @@ public void whenSerializingEnum_usingDataTypeIec61360_shouldReturnUpperCase() { @Test public void whenSerializingEnum_usingDirection_shouldReturnUpperCase() { - assertSerialization(Direction.INPUT, "INPUT"); - assertSerialization(Direction.OUTPUT, "OUTPUT"); + assertSerialization(Direction.INPUT, "input"); + assertSerialization(Direction.OUTPUT, "output"); } @Test public void whenSerializingEnum_usingStateOfEvent_shouldReturnUpperCase() { - assertSerialization(StateOfEvent.ON, "ON"); - assertSerialization(StateOfEvent.OFF, "OFF"); + assertSerialization(StateOfEvent.ON, "on"); + assertSerialization(StateOfEvent.OFF, "off"); } @Test From 3678a6e791b9735a01aa60801ca3cc5dad6d030c Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 4 Jul 2023 11:04:14 +0200 Subject: [PATCH 19/59] Fix the compilation errors in XML-Serializer Project --- .../xml/AasXmlNamespaceContext.java | 52 ----------- .../xml/SubmodelElementManager.java | 60 ------------- .../XmlDataformatAnnotationIntrospector.java | 89 ------------------- .../LangStringNodeDeserializer.java | 34 ------- .../LangStringsDeserializer.java | 25 ------ .../xml/mixins/HasSemanticsMixin.java | 2 +- .../xml/mixins/LangStringMixin.java | 33 ------- .../dataformat/xml/mixins/PropertyMixin.java | 2 +- ...IDMixin.java => SpecificAssetIdMixin.java} | 13 ++- .../xml/mixins/SubmodelElementListMixin.java | 2 +- .../serialization/LangStringSerializer.java | 67 -------------- .../LangStringsNameTypeSerializer.java | 2 +- .../serialization/LangStringsSerializer.java | 52 ----------- 13 files changed, 10 insertions(+), 423 deletions(-) delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/{SpecificAssetIDMixin.java => SpecificAssetIdMixin.java} (84%) delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java deleted file mode 100644 index de2b6cd89..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; - -import java.util.HashMap; -import java.util.Map; - - -public class AasXmlNamespaceContext { - - public static final String AAS_PREFERRED_PREFIX = "aas"; - public static final String AAS_URI = "https://admin-shell.io/aas/3/0/RC02"; - - public static final String ABAC_PREFERRED_PREFIX = "abac"; - public static final String ABAC_URI = "http://www.admin-shell.io/aas/abac/3/0"; - - public static final String COMMON_PREFERRED_PREFIX = "aas_common"; - public static final String COMMON_URI = "http://www.admin-shell.io/aas_common/3/0"; - - public static final String IEC61360_PREFERRED_PREFIX = "IEC61360"; - public static final String IEC61360_URI = "http://www.admin-shell.io/IEC61360/3/0"; - - public static final String XSI_PREFERRED_PREFIX = "xsi"; - public static final String XSI_URI = "http://www.w3.org/2001/XMLSchema-instance"; - - public static final Map PREFERRED_PREFIX_CONTEXT = new HashMap<>(); - - static { - PREFERRED_PREFIX_CONTEXT.put(AAS_PREFERRED_PREFIX, AAS_URI); - PREFERRED_PREFIX_CONTEXT.put(ABAC_PREFERRED_PREFIX, ABAC_URI); - PREFERRED_PREFIX_CONTEXT.put(COMMON_PREFERRED_PREFIX, COMMON_URI); - PREFERRED_PREFIX_CONTEXT.put(IEC61360_PREFERRED_PREFIX, IEC61360_URI); - PREFERRED_PREFIX_CONTEXT.put(XSI_PREFERRED_PREFIX, XSI_URI); - } - - private AasXmlNamespaceContext() { - } -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java deleted file mode 100644 index e1b22bc93..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; - -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; - -import java.util.HashMap; -import java.util.Map; -import java.util.stream.Collectors; - -public class SubmodelElementManager { - - public static Map, String> CLASS_TO_NAME = new HashMap<>(); - public static Map> NAME_TO_CLASS = new HashMap<>(); - - static { - CLASS_TO_NAME.put(DefaultAnnotatedRelationshipElement.class, "annotatedRelationshipElement"); - CLASS_TO_NAME.put(DefaultRelationshipElement.class, "relationshipElement"); - CLASS_TO_NAME.put(DefaultReferenceElement.class, "referenceElement"); - CLASS_TO_NAME.put(DefaultProperty.class, "property"); - CLASS_TO_NAME.put(DefaultFile.class, "file"); - CLASS_TO_NAME.put(DefaultBlob.class, "blob"); - CLASS_TO_NAME.put(DefaultRange.class, "range"); - CLASS_TO_NAME.put(DefaultMultiLanguageProperty.class, "multiLanguageProperty"); - CLASS_TO_NAME.put(DefaultCapability.class, "capability"); - CLASS_TO_NAME.put(DefaultEntity.class, "entity"); - CLASS_TO_NAME.put(DefaultBasicEventElement.class, "basicEventElement"); - CLASS_TO_NAME.put(DefaultEventPayload.class, "eventPayload"); - CLASS_TO_NAME.put(DefaultOperation.class, "operation"); - CLASS_TO_NAME.put(DefaultOperationVariable.class, "operationVariable"); - CLASS_TO_NAME.put(DefaultLangString.class, "langString"); - CLASS_TO_NAME.put(DefaultSubmodelElementCollection.class, "submodelElementCollection"); - NAME_TO_CLASS = CLASS_TO_NAME.entrySet().stream().collect(Collectors.toMap(x -> x.getValue(), x -> x.getKey())); - } - - public static String getXmlName(Class type) { - return CLASS_TO_NAME.get(type); - } - - public static Class getClassByXmlName(String xmlName) { - return NAME_TO_CLASS.get(xmlName); - } - - private SubmodelElementManager() { - } -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java deleted file mode 100644 index 6c8bc20ee..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; - -import java.util.Collection; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.cfg.MapperConfig; -import com.fasterxml.jackson.databind.introspect.Annotated; -import com.fasterxml.jackson.databind.introspect.AnnotatedClass; -import com.fasterxml.jackson.databind.introspect.AnnotatedMethod; -import com.fasterxml.jackson.dataformat.xml.JacksonXmlAnnotationIntrospector; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; - -/** - * This class helps to dynamically decide how to de-/serialize classes and - * properties defined in the AAS model library. It will automatically add a default namespace - * to property names and set a default property order for contained elements. - * - * Will also add @JsonInclude(JsonInclude.Include.NON_EMPTY) to all getter methods returning any type of - * Collection<?> defined in the AAS model - */ -public class XmlDataformatAnnotationIntrospector extends JacksonXmlAnnotationIntrospector { - private static final long serialVersionUID = 1L; - - private static final String GETTER_PREFIX = "get"; - protected String myDefaultNamespace = ""; - - public XmlDataformatAnnotationIntrospector() { - super(); - myDefaultNamespace = AasXmlNamespaceContext.AAS_URI; - } - - public String findNamespace(MapperConfig config, Annotated ann) { - String ns = super.findNamespace(config, ann); - if (ns == null) { - return myDefaultNamespace; - } else { - return ns; - } - } - - @Override - public String[] findSerializationPropertyOrder(AnnotatedClass ac) { - String[] order = super.findSerializationPropertyOrder(ac); - if (order == null) { - order = new String[] { - "extensions", "idShort", "displayNames", "category", "descriptions", "administration", "identification", "kind", "semanticId", - "qualifiers", "embeddedDataSpecification", "dataSpecifications", "isCaseOf", "security", "derivedFrom", "submodels", "assetInformation", "views", "externalSubjectId", "key", "allowDuplicates", "ordered", "valueId", "value", - "max", "min", "type", "valueType", "mimeType", "first", "second", "annotations", "revision", "version", "defaultThumbnail", "globalAssetId", "externalAssetId", "entityType", "statements", "assetKind", "billOfMaterials", - "specificAssetIds", "observed", "inoutputVariables", "inputVariables", "outputVariables", "submodelElements", "containedElements" - }; - } - return order; - } - - @Override - public JsonInclude.Value findPropertyInclusion(Annotated a) { - JsonInclude.Value result = super.findPropertyInclusion(a); - if (result != JsonInclude.Value.empty()) { - return result; - } - if (AnnotatedMethod.class.isAssignableFrom(a.getClass())) { - AnnotatedMethod method = (AnnotatedMethod) a; - if (method.getParameterCount() == 0 - && method.getName().startsWith(GETTER_PREFIX) - && Collection.class.isAssignableFrom(method.getRawReturnType()) - && ReflectionHelper.isModelInterfaceOrDefaultImplementation(method.getDeclaringClass())) { - return result.withValueInclusion(JsonInclude.Include.NON_EMPTY); - } - } - return result; - } -} \ No newline at end of file diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java deleted file mode 100644 index cb2dfaa88..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; - -import java.io.IOException; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.JsonNode; - -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangString; - -public class LangStringNodeDeserializer implements CustomJsonNodeDeserializer { - @Override - public LangString readValue(JsonNode node, JsonParser parser) throws IOException { - String lang = node.get("language").asText(); - String text = node.get("text").asText(); - return new DefaultLangString.Builder().text(text).language(lang).build(); - } -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java deleted file mode 100644 index eaee8aa90..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; - -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -public class LangStringsDeserializer extends NoEntryWrapperListDeserializer { - public LangStringsDeserializer() { - super("langString", new LangStringNodeDeserializer()); - } -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java index 5766c9532..9bf5216df 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java @@ -18,7 +18,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.ReferencesDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java deleted file mode 100644 index ec348ca41..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; - - -@JsonPropertyOrder({"language", "text"}) -public interface LangStringMixin { - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "language") - public String getLanguage(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "text") - public String getText(); -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java index 7f9211a17..385e36446 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java @@ -15,7 +15,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIdMixin.java similarity index 84% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIdMixin.java index 2e815400d..54463ac98 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIdMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,15 +15,15 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - @JsonPropertyOrder({"hasSemantics", "name", "value", "externalSubjectId"}) -public interface SpecificAssetIDMixin { - +public interface SpecificAssetIdMixin { + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "name") public String getName(); @@ -32,5 +31,5 @@ public interface SpecificAssetIDMixin { public String getValue(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "externalSubjectId") - public Reference getExternalSubjectId(); + public Reference getExternalSubjectId(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java index cc25e2ef6..cbad40cc0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java @@ -19,7 +19,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java deleted file mode 100644 index 3f7a25fe4..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; - -import java.io.IOException; -import java.lang.reflect.Field; - -import javax.xml.namespace.QName; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -public class LangStringSerializer extends JsonSerializer { - - - @Override - public void serialize(LangString langString, JsonGenerator gen, SerializerProvider serializers) throws IOException { - - ToXmlGenerator xgen = (ToXmlGenerator) gen; - try { - Field nextName = xgen.getClass().getDeclaredField("_nextName"); - nextName.setAccessible(true); - QName next = (QName) nextName.get(xgen); - - xgen.setNextName(new QName(AasXmlNamespaceContext.AAS_URI, "langString")); - - serializeLangString(xgen, langString); - - } catch (NoSuchFieldException | IllegalAccessException e) { - // serialize it without changing the namespaces - serializeLangString(xgen, langString); - } - - } - - private void serializeLangString(ToXmlGenerator xgen, LangString langString) throws IOException { - - - xgen.writeStartObject(); - xgen.writeFieldName("language"); - xgen.writeString(langString.getLanguage()); - - xgen.writeFieldName("text"); - xgen.writeString(langString.getValue()); - - xgen.writeEndObject(); - } -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java index 5b2659d1a..b2ef9cc4a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java @@ -19,7 +19,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java deleted file mode 100644 index 0b75bb518..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -import java.io.IOException; -import java.util.List; - -public class LangStringsSerializer extends NoEntryWrapperListSerializer { - - private LangStringSerializer ser = new LangStringSerializer(); - - @Override - public void serialize(List langStrings, JsonGenerator gen, SerializerProvider serializers) throws IOException { - - ToXmlGenerator xgen = (ToXmlGenerator) gen; - xgen.writeStartObject(); - for (LangString element : langStrings) { - ReflectionHelper.setEmptyListsToNull(element); // call is needed to prevent empty tags (e.g. statements.size=0 leads to , which is not allowed according to the schema - xgen.writeFieldName(SubmodelElementManager.getXmlName(element.getClass())); - ser.serialize(element, xgen, serializers); - } - xgen.writeEndObject(); - - } - - @Override - public Class> handledType() { - return (Class>)(Object)List.class; - } - -} \ No newline at end of file From b1ddf4bcf09484e0b51cebb868b8e1e56fe661e0 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 4 Jul 2023 14:20:16 +0200 Subject: [PATCH 20/59] Fix Some XML Serialization Tests --- .../aas4j/v3/dataformat/core/AASSimple.java | 2 +- .../test/resources/xmlExampleWithModifiedPrefix.xml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index 158b8eb36..4234ea749 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -328,7 +328,7 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .idShort(MAX_ROTATION_SPEED).category(PROPERTY) .administration(new DefaultAdministrativeInformation.Builder() .version("2") - .revision("2.1") + .revision("1") .build()) .id(_0173_1_02_BAA120_008) .embeddedDataSpecifications( diff --git a/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml b/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml index 2db066ec3..f0b3b70b5 100644 --- a/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml +++ b/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml @@ -187,7 +187,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -237,7 +237,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -292,7 +292,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -346,7 +346,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -369,7 +369,7 @@ EN - ActRotationSpeed + ActualRotationSpeed 1/min @@ -409,7 +409,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 From 1d8e1925de0629a06d5adf89e2a74e9d47de9449 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 4 Jul 2023 15:02:05 +0200 Subject: [PATCH 21/59] Fix some XML Serialization Tests --- .../aas4j/v3/dataformat/core/AASFull.java | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 71900b150..87ae37db4 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -52,8 +52,8 @@ public static AssetAdministrationShell createAAS1() { )) .id("https://acplt.org/Test_AssetAdministrationShell") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .derivedFrom(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -141,8 +141,8 @@ public static AssetAdministrationShell createAAS4() { )) .id("https://acplt.org/Test_AssetAdministrationShell_Missing") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) @@ -167,8 +167,8 @@ public static Submodel createSubmodel1() { )) .id("http://acplt.org/Submodels/Assets/TestAsset/Identification") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() @@ -248,7 +248,7 @@ public static Submodel createSubmodel2() { )) .id("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") + .version("0") .build()) .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() @@ -349,8 +349,8 @@ public static Submodel createSubmodel3() { )) .id("https://acplt.org/Test_Submodel") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() @@ -917,8 +917,8 @@ public static Submodel createSubmodel6() { .id("https://acplt.org/Test_Submodel_Missing") .kind(ModellingKind.INSTANCE) .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0").build()) + .version("0") + .revision("9").build()) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) @@ -1320,8 +1320,8 @@ public static Submodel createSubmodel7() { .id("https://acplt.org/Test_Submodel_Template") .kind(ModellingKind.TEMPLATE) .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1715,8 +1715,8 @@ public static ConceptDescription createConceptDescription1() { )) .id("https://acplt.org/Test_ConceptDescription") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1744,8 +1744,8 @@ public static ConceptDescription createConceptDescription3() { )) .id("https://acplt.org/Test_ConceptDescription_Missing") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .build(); } @@ -1755,8 +1755,8 @@ public static ConceptDescription createConceptDescription4() { .idShort("TestSpec_01") .id("http://acplt.org/DataSpecifciations/Example/Identification") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() From 30ee6730e8190cf2f7a7d2199e319535b8b83c88 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Wed, 5 Jul 2023 16:38:37 +0200 Subject: [PATCH 22/59] Fix the dataformat-xml project --- .../aas4j/v3/dataformat/core/AASFull.java | 135 +++++++++--------- .../xml/mixins/HasSemanticsMixin.java | 5 +- .../dataformat/xml/mixins/LevelTypeMixin.java | 50 +++++++ .../dataformat/xml/mixins/PropertyMixin.java | 58 +++++++- .../dataformat/xml/mixins/ReferableMixin.java | 10 +- .../v3/dataformat/xml/XmlSerializerTest.java | 2 - .../test/resources/test_demo_full_example.xml | 8 +- .../src/test/resources/xmlExample.xml | 13 +- 8 files changed, 200 insertions(+), 81 deletions(-) create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LevelTypeMixin.java diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 87ae37db4..9133944d1 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -180,6 +180,7 @@ public static Submodel createSubmodel1() { .build()) .submodelElements(new DefaultProperty.Builder() .idShort("ManufacturerName") + .displayName(new DefaultLangStringNameType.Builder().language("en-us").text("Manufacturer Name").build()) .description(Arrays.asList( new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() @@ -213,6 +214,7 @@ public static Submodel createSubmodel1() { .build()) .build()) .submodelElements(new DefaultProperty.Builder() + .category("VARIABLE") .idShort("InstanceId") .description(Arrays.asList( new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), @@ -226,6 +228,12 @@ public static Submodel createSubmodel1() { ) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) + .supplementalSemanticIds(new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value("something_random_e14ad770").build()) + .build()) + .supplementalSemanticIds(new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value("something_random_bd061acd").build()) + .build()) .value("978-8234-234-342") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() @@ -1743,6 +1751,7 @@ public static ConceptDescription createConceptDescription3() { new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_ConceptDescription_Missing") + .category("PROPERTY") .administration(new DefaultAdministrativeInformation.Builder() .version("0") .revision("9") @@ -1752,79 +1761,75 @@ public static ConceptDescription createConceptDescription3() { public static ConceptDescription createConceptDescription4() { return new DefaultConceptDescription.Builder() - .idShort("TestSpec_01") - .id("http://acplt.org/DataSpecifciations/Example/Identification") - .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .idShort("TestSpec_01") + .id("http://acplt.org/DataSpecifciations/Example/Identification") + .administration(new DefaultAdministrativeInformation.Builder() + .version("0") + .revision("9") + .build()) + .isCaseOf(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build()) + .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() + .dataSpecification(new DefaultReference.Builder() + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .isCaseOf(new DefaultReference.Builder() + .build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName(Arrays.asList( + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() + )) + .dataType(DataTypeIec61360.REAL_MEASURE) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) + .unit("SpaceUnit") + .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") - .build()) + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/Units/SpaceUnit") + .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() - .dataSpecification(new DefaultReference.Builder() + .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") + .symbol("SU") + .valueFormat("string") + .value("TEST") + .levelType(new DefaultLevelType.Builder().max(true).build()) + .valueList(new DefaultValueList.Builder() + .valueReferencePairs(new DefaultValueReferencePair.Builder() + .value("http://acplt.org/ValueId/ExampleValueId") + .valueId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) - .build()) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(Arrays.asList( - new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), - new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() - )) - .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) - .unit("SpaceUnit") - .unitId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - - .value("http://acplt.org/Units/SpaceUnit") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) - .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") - .symbol("SU") - .valueFormat("string") - .value("TEST") -// .levelType(LevelType.MIN) - .levelType(new DefaultLevelType.Builder().max(true).build()) - .valueList(new DefaultValueList.Builder() - .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId") - .valueId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) - // TODO valueType? - .build()) - .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId2") - .valueId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId2") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) - // TODO valueType? - .build()) - .build()) + .build()) + .valueReferencePairs(new DefaultValueReferencePair.Builder() + .value("http://acplt.org/ValueId/ExampleValueId2") + .valueId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/ValueId/ExampleValueId2") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) + .build()) .build()) - .build(); + .build()) + .build()) + .build(); } public static Environment createEnvironment() { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java index 9bf5216df..f16b528f3 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java @@ -17,6 +17,7 @@ import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.ReferencesDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -25,9 +26,11 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +@JsonPropertyOrder("semanticId, supplementalSemanticIds") public interface HasSemanticsMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "semanticId") - void setSemanticID(Reference semanticID); + void setSemanticId(Reference semanticId); @JsonDeserialize(using = ReferencesDeserializer.class) void setSupplementalSemanticIds(List supplementalSemanticIds); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LevelTypeMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LevelTypeMixin.java new file mode 100644 index 000000000..db54e96eb --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LevelTypeMixin.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; + +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; + + +@JsonPropertyOrder({"min", "nom", "typ", "max"}) +public interface LevelTypeMixin { + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "min") + public boolean getMin(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "min") + void setMin(boolean min); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "nom") + public boolean getNom(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "nom") + void setNom(boolean nom); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "typ") + public boolean getTyp(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "typ") + void setTyp(boolean typ); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "max") + public boolean getMax(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "max") + void setMax(boolean max); +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java index 385e36446..6f4d57d08 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java @@ -15,17 +15,73 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsNameTypeDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsNameTypeSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsTextTypeSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import java.util.List; + /** * * @author schnicke * */ +//@JsonPropertyOrder({"category", "idShort", "displayName", "description", "checksum", "valueId", "valueType", "value" }) +@JsonPropertyOrder({ + "hasExtensions", "category", "idShort", "displayName", "description", "checksum", // --> Referable + "kind", // --> HasKind + "semanticId", "supplementalSemanticIds", "reference", // --> HasSemantics + "qualifier", // --> Qualifiable + "dataSpecifications", "embeddedDataSpecifications", // --> HasDataSpecifications + "orderRelevant", "semanticIdListElement", "typeValueListElement", "valueTypeListElement", // --> SME-List + "valueType", "value", "valueId" // --> Property + , "statements", "entityType", "globalAssetId", "specificAssetId" // --> Entity + , "first", "second", "annotations" // --> (Annotated)RelationsShipElement + , "inputVariables", "outputVariables", "inoutputVariables" // --> Operation + , "observed","direction","state","messageTopic","messageBroker","lastUpdate","minInterval","maxInterval" // --> BasicEventElement + , "min", "max" // Range +}) public interface PropertyMixin { + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") + void setCategory(String category); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") + String getCategory(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "idShort") + void setIdShort(String idShort); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "idShort") + String getIdShort(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") + @JsonDeserialize(using = LangStringsNameTypeDeserializer.class) + List getDisplayName(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") + @JsonSerialize(using = LangStringsNameTypeSerializer.class) + void setDisplayName(List displayNames); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") + @JsonSerialize(using = LangStringsTextTypeSerializer.class) + List getDescription(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") + @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) + void setDescription(List descriptions); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") + void setValueId(Reference valueId); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") - void setValueID(Reference valueID); + Reference getValueId(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java index 552eb1d3e..d7badcca7 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java @@ -35,19 +35,19 @@ public interface ReferableMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") @JsonSerialize(using = LangStringsTextTypeSerializer.class) - public List getDescription(); + List getDescription(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) - public void setDescription(List descriptions); + void setDescription(List descriptions); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") @JsonDeserialize(using = LangStringsNameTypeDeserializer.class) - public List getDisplayName(); + List getDisplayName(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") @JsonSerialize(using = LangStringsNameTypeSerializer.class) - public void setDisplayName(List displayNames); + void setDisplayName(List displayNames); - public String getIdShort(); + String getIdShort(); } diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java index 6ca6b6c65..994a4e648 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java @@ -162,8 +162,6 @@ public void testIsCaseOfAgainstXsdSchema() throws SerializationException, SAXExc assertTrue(errors.isEmpty()); } - - private Set validateAgainstXsdSchema(String xml) throws SAXException { return new XmlSchemaValidator().validateSchema(xml); } diff --git a/dataformat-xml/src/test/resources/test_demo_full_example.xml b/dataformat-xml/src/test/resources/test_demo_full_example.xml index 26fbaefe4..404d23319 100644 --- a/dataformat-xml/src/test/resources/test_demo_full_example.xml +++ b/dataformat-xml/src/test/resources/test_demo_full_example.xml @@ -2386,7 +2386,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -2465,6 +2465,12 @@ TEST + + false + false + false + true + diff --git a/dataformat-xml/src/test/resources/xmlExample.xml b/dataformat-xml/src/test/resources/xmlExample.xml index 5e37d5016..57e811b6f 100644 --- a/dataformat-xml/src/test/resources/xmlExample.xml +++ b/dataformat-xml/src/test/resources/xmlExample.xml @@ -77,6 +77,7 @@ TechnicalData http://i40.customer.com/type/1/1/7A7104BDAB57E184 + Instance ExternalReference @@ -187,7 +188,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -237,7 +238,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -292,7 +293,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -346,7 +347,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -369,7 +370,7 @@ EN - ActRotationSpeed + ActualRotationSpeed 1/min @@ -409,7 +410,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 From 18decbf733a7f646e279ae153445adebabe7e5d7 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 6 Jul 2023 16:09:25 +0200 Subject: [PATCH 23/59] Fix the dataformat-json project --- .../v3/dataformat/json/JsonDeserializer.java | 22 ++++ .../v3/dataformat/json/JsonSerializer.java | 2 +- .../json/ReferableDeserializer.java | 26 +++++ ...setAdministrationShellDescriptorMixin.java | 13 +-- .../DataSpecificationPhysicalUnitMixin.java | 101 ----------------- .../json/mixins/LangStringMixin.java | 33 ------ ...IDMixin.java => SpecificAssetIdMixin.java} | 2 +- .../json/mixins/SubmodelDescriptorMixin.java | 12 +- .../dataformat/json/mixins/SubmodelMixin.java | 13 +-- dataformat-json/src/main/resources/aas.json | 2 +- ...strationShellDescriptorSerializerTest.java | 2 +- .../json/JsonReferableDeserializerTest.java | 105 ++++++------------ .../dataformat/json/JsonSerializerTest.java | 2 +- .../v3/dataformat/json/TestDataHelper.java | 7 -- .../src/test/resources/Example-Full.json | 8 +- .../src/test/resources/Example-Simple.json | 13 ++- .../assetAdministrationShellDescriptor.json | 12 +- .../assetAdministrationShellList.json | 16 +-- .../test/resources/submodelDescriptor.json | 6 +- 19 files changed, 137 insertions(+), 260 deletions(-) delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/{SpecificAssetIDMixin.java => SpecificAssetIdMixin.java} (93%) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index e5e77c90b..d57a622c1 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -15,8 +15,12 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; @@ -117,6 +121,15 @@ public T readReferable(String referable, Class outputCl } } + @Override + public T readReferable(InputStream src, Class outputClass) throws DeserializationException { + return readReferable(new BufferedReader( + new InputStreamReader(src, DEFAULT_CHARSET)) + .lines() + .collect(Collectors.joining(System.lineSeparator())), + outputClass); + } + @Override public List readReferables(String referables, Class outputClass) throws DeserializationException { try { @@ -129,6 +142,15 @@ public List readReferables(String referables, Class } } + @Override + public List readReferables(InputStream src, Class outputClass) throws DeserializationException { + return readReferables(new BufferedReader( + new InputStreamReader(src, DEFAULT_CHARSET)) + .lines() + .collect(Collectors.joining(System.lineSeparator())), + outputClass); + } + @Override public Reference readReference(String reference) throws DeserializationException { try { diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 6e7ceef7c..7ee80bb9d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -92,7 +92,7 @@ public String writeReferable(Referable referable) throws SerializationException @Override public String writeReferables(List referables) throws SerializationException { if(referables.isEmpty()){ - return null; + return "[]"; } try { diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java index 36c6ffb26..ef6e787a7 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java @@ -19,7 +19,11 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; import java.util.List; +import java.util.stream.Collectors; /** * Deserializer Interface for deserialization of referables @@ -39,6 +43,17 @@ public interface ReferableDeserializer { */ T readReferable(String referable, Class outputClass) throws DeserializationException; + /** + * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET + * + * @param src a input stream representing a Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ + T readReferable(InputStream src, Class outputClass) throws DeserializationException; + /** * Deserializes a given string into an instance of * a list of the given Referables @@ -52,4 +67,15 @@ public interface ReferableDeserializer { */ List readReferables(String referables, Class outputClass) throws DeserializationException; + /** + * Deserializes a given input stream into an instance of a list of the given Referable + * + * @param src a input stream representing a Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ + public List readReferables(InputStream src, Class outputClass) throws DeserializationException; + } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java index 4d589447f..3fe313526 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java @@ -16,10 +16,9 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; @@ -34,16 +33,16 @@ public interface AssetAdministrationShellDescriptorMixin { public void setIdShort(String idShort); @JsonProperty("descriptions") - public List getDescription(); + public List getDescription(); @JsonProperty("descriptions") - public void setDescription(List description); + public void setDescription(List description); @JsonProperty("displayNames") - public List getDisplayName(); + public List getDisplayName(); @JsonProperty("displayNames") - public void setDisplayName(List displayName); + public void setDisplayName(List displayName); @JsonProperty("submodelDescriptors") public List getSubmodelDescriptor(); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java deleted file mode 100644 index ee87e0d54..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -import java.util.List; - -public interface DataSpecificationPhysicalUnitMixin { - - @JsonProperty("conversionFactor") - public List getConversionFactors(); - - @JsonProperty("conversionFactor") - public void setConversionFactors(List conversionFactors); - - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("definition") - public List getDefinition(); - - @JsonProperty("definition") - public void setDefinition(List definition); - - @JsonProperty("dinNotation") - public List getDinNotations(); - - @JsonProperty("dinNotation") - public void setDinNotations(List dinNotations); - - @JsonProperty("eceCode") - public List getEceCodes(); - - @JsonProperty("eceCode") - public void setEceCodes(List eceCodes); - - @JsonProperty("eceName") - public List getEceNames(); - - @JsonProperty("eceName") - public void setEceNames(List eceNames); - - @JsonProperty("nistName") - public List getNistNames(); - - @JsonProperty("nistName") - public void setNistNames(List nistNames); - - @JsonProperty("siName") - public List getSiNames(); - - @JsonProperty("siName") - public void setSiNames(List siNames); - - @JsonProperty("siNotation") - public List getSiNotations(); - - @JsonProperty("siNotation") - public void setSiNotations(List siNotations); - - @JsonProperty("registrationAuthorityId") - public List getRegistrationAuthorityIds(); - - @JsonProperty("registrationAuthorityId") - public void setRegistrationAuthorityIds(List registrationAuthorityIds); - - @JsonProperty("supplier") - public List getSuppliers(); - - @JsonProperty("supplier") - public void setSuppliers(List suppliers); - - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("unitName") - public List getUnitNames(); - - @JsonProperty("unitName") - public void setUnitNames(List unitNames); - - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("unitSymbol") - public List getUnitSymbols(); - - @JsonProperty("unitSymbol") - public void setUnitSymbols(List unitSymbols); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java deleted file mode 100644 index 5a874c713..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -public interface LangStringMixin { - - @JsonProperty("text") - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getText(); - - @JsonProperty("text") - public void setText(String value); - - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getLanguage(); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIDMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java similarity index 93% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIDMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java index a6a59f46f..94f435137 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIDMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -public interface SpecificAssetIDMixin { +public interface SpecificAssetIdMixin { @JsonProperty("externalSubjectId") public Reference getExternalSubjectID(); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java index 2dc8b5891..faf4b909a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java @@ -17,25 +17,25 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import java.util.List; public interface SubmodelDescriptorMixin { @JsonProperty("descriptions") - public List getDescription(); + public List getDescription(); @JsonProperty("descriptions") - public void setDescription(List description); + public void setDescription(List description); @JsonProperty("displayNames") - public List getDisplayName(); + public List getDisplayName(); @JsonProperty("displayNames") - public void setDisplayName(List displayName); + public void setDisplayName(List displayName); @JsonProperty("specificAssetIds") public SpecificAssetId getSpecificAssetId(); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java index e7a2458c9..d1a7f64a3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java @@ -17,10 +17,9 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import java.util.Collection; import java.util.List; public interface SubmodelMixin { @@ -32,14 +31,14 @@ public interface SubmodelMixin { public void setIdShort(String idShort); @JsonProperty("description") - public List getDescription(); + public List getDescription(); @JsonProperty("description") - public void setDescription(List description); + public void setDescription(List description); @JsonProperty("displayName") - public List getDisplayName(); + public List getDisplayName(); @JsonProperty("displayName") - public void setDisplayName(List displayName); + public void setDisplayName(List displayName); } diff --git a/dataformat-json/src/main/resources/aas.json b/dataformat-json/src/main/resources/aas.json index 496811106..2fe18a193 100644 --- a/dataformat-json/src/main/resources/aas.json +++ b/dataformat-json/src/main/resources/aas.json @@ -879,7 +879,7 @@ { "properties": { "text": { - "maxLength": 18 + "maxLength": 64 } } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java index bef8fd2da..c1af7a607 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java @@ -49,7 +49,7 @@ public void testReadAssetAdministrationShellDescriptor() throws IOException, Ser private void validateAndCompare(File expectedFile, AssetAdministrationShellDescriptor descriptor) throws IOException, SerializationException, JSONException { String expected = Files.readString(expectedFile.toPath()); String actual = new JsonSerializer().writeAssetAdministrationShellDescriptor(descriptor); - logger.info(actual); + logger.debug(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); assertTrue(errors.isEmpty()); JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java index f2edff15d..68ef1d473 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java @@ -17,119 +17,84 @@ import static org.junit.Assert.assertEquals; -import java.io.File; import java.io.IOException; -import java.nio.file.Files; -import java.util.Arrays; +import java.util.Collections; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; - import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; public class JsonReferableDeserializerTest { - private static final Logger logger = LoggerFactory.getLogger(JsonReferableDeserializerTest.class); - @Test public void testReadAAS() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/assetAdministrationShell.json"); - String expected = Files.readString(fileExpected.toPath()); - AssetAdministrationShell aas = new JsonDeserializer().readReferable(expected, AssetAdministrationShell.class); - Environment environment = AASFull.ENVIRONMENT; - AssetAdministrationShell aasExpected = environment.getAssetAdministrationShells().get(0); - - assertEquals(aasExpected, aas); + AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); + AssetAdministrationShell actual = new JsonDeserializer().readReferable(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); + assertEquals(expected, actual); } @Test public void testReadAASs() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/assetAdministrationShellList.json"); - String expected = Files.readString(fileExpected.toPath()); - List aas = new JsonDeserializer().readReferables(expected, AssetAdministrationShell.class); - Environment environment = AASFull.ENVIRONMENT; - List aasExpected = Arrays.asList(environment.getAssetAdministrationShells().get(0) - ,environment.getAssetAdministrationShells().get(1)) ; - - assertEquals(aasExpected, aas); + List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); + assertEquals(expected, actual); } @Test public void testReadSubmodel() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodel.json"); - String expected = Files.readString(fileExpected.toPath()); - Submodel submodel = new JsonDeserializer().readReferable(expected, Submodel.class); - Environment environment = AASFull.ENVIRONMENT; - Submodel submodelExpected = environment.getSubmodels().get(0); - - assertEquals(submodelExpected, submodel); + Submodel expected = Examples.SUBMODEL.getModel(); + Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); + assertEquals(expected, actual); } @Test public void testReadSubmodels() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelList.json"); - String expected = Files.readString(fileExpected.toPath()); - List submodels = new JsonDeserializer().readReferables(expected,Submodel.class); - Environment environment = AASFull.ENVIRONMENT; - List submodelsExpected = Arrays.asList(environment.getSubmodels().get(0),environment.getSubmodels().get(1)); - - assertEquals(submodelsExpected, submodels); + List expected = Examples.SUBMODEL_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElement() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelElement.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelElement submodelElement = new JsonDeserializer().readReferable(expected,SubmodelElement.class); - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElementExpected = environment.getSubmodels().get(0).getSubmodelElements().get(0); - - assertEquals(submodelElementExpected, submodelElement); + SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); + SubmodelElement actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElements() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/listOfSubmodelElements.json"); - String expected = Files.readString(fileExpected.toPath()); - List submodelElements = new JsonDeserializer().readReferables(expected,SubmodelElement.class); - Environment environment = AASFull.ENVIRONMENT; - List submodelElementsExpected = Arrays.asList( - environment.getSubmodels().get(0).getSubmodelElements().get(0), - environment.getSubmodels().get(0).getSubmodelElements().get(1)); ; - - assertEquals(submodelElementsExpected, submodelElements); + List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables( + Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElementList() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelElementList.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelElementList submodelElementList = new JsonDeserializer().readReferable(expected, SubmodelElementList.class); - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElementListExpected = environment.getSubmodels().get(6).getSubmodelElements().get(5); ; - - assertEquals(submodelElementListExpected, submodelElementList); + SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); + SubmodelElementList actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElementCollection() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelElementCollection.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelElementCollection submodelElementCollection = new JsonDeserializer().readReferable(expected, SubmodelElementCollection.class); - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElementCollectionExpected = environment.getSubmodels().get(6).getSubmodelElements().get(6); ; - - assertEquals(submodelElementCollectionExpected, submodelElementCollection); + SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); + SubmodelElementCollection actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); + assertEquals(expected, actual); } -} \ No newline at end of file + @Test + public void testReadEmptyReferableList() throws DeserializationException { + List emptyList = Collections.emptyList(); + List deserialized = new JsonDeserializer().readReferables("[]", Referable.class); + assertEquals(emptyList, deserialized); + } +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 21c4b2e77..e0208f0a6 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -85,7 +85,7 @@ public void testSerializeEmptyReferableList() throws SerializationException { private void validateAndCompare(ExampleData exampleData) throws IOException, SerializationException, JSONException { String expected = exampleData.fileContent(); String actual = new JsonSerializer().write(exampleData.getModel()); - logger.info(actual); + logger.debug(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); assertTrue(errors.isEmpty()); JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java index a6d6d9c3f..8f1ab22d8 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -33,13 +33,6 @@ public class TestDataHelper { public static final String DEFAULT_ID_SHORT = "defaultIdShort"; - - - - public static LangString createLangString(String langCode, String text) { - return new DefaultLangString.Builder().language(langCode).text(text).build(); - } - public static LangStringTextType createLangStringTextType(String langCode, String text) { return new DefaultLangStringTextType.Builder().language(langCode).text(text).build(); } diff --git a/dataformat-json/src/test/resources/Example-Full.json b/dataformat-json/src/test/resources/Example-Full.json index d805d2c41..1e3cf3770 100644 --- a/dataformat-json/src/test/resources/Example-Full.json +++ b/dataformat-json/src/test/resources/Example-Full.json @@ -215,7 +215,7 @@ "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" } ], "type": "ExternalReference" @@ -235,6 +235,12 @@ ], "type": "ExternalReference" }, + "levelType": { + "max": true, + "min": false, + "nom": false, + "typ": false + }, "value": "TEST", "valueFormat": "string", "valueList": { diff --git a/dataformat-json/src/test/resources/Example-Simple.json b/dataformat-json/src/test/resources/Example-Simple.json index c6e66ec23..6b9f78c2d 100644 --- a/dataformat-json/src/test/resources/Example-Simple.json +++ b/dataformat-json/src/test/resources/Example-Simple.json @@ -84,7 +84,7 @@ "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" } ], "type": "ExternalReference" @@ -135,7 +135,7 @@ "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" } ], "type": "ExternalReference" @@ -186,7 +186,7 @@ "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" } ], "type": "ExternalReference" @@ -247,7 +247,7 @@ "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" } ], "type": "ExternalReference" @@ -295,7 +295,7 @@ }, { "language": "EN", - "text": "ActRotationSpeed" + "text": "ActualRotationSpeed" } ] } @@ -313,7 +313,7 @@ "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" } ], "type": "ExternalReference" @@ -368,6 +368,7 @@ }, "id": "http://i40.customer.com/type/1/1/7A7104BDAB57E184", "idShort": "TechnicalData", + "kind": "Instance", "submodelElements": [ { "modelType": "Property", diff --git a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json index 17183b3dc..059daa7b0 100644 --- a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json +++ b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json @@ -19,10 +19,10 @@ "type" : "GlobalReference", "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" } ], - "type" : "GlobalReference" + "type" : "ExternalReference" }, "dataSpecificationContent" : { - "modelType" : "DataSpecificationIEC61360", + "modelType" : "DataSpecificationIec61360", "preferredName" : [ ] } } ] @@ -50,7 +50,7 @@ "type" : "GlobalReference", "value" : "eClassDefaultSemanticId" } ], - "type" : "GlobalReference" + "type" : "ExternalReference" }, "externalSubjectId" : { "keys" : [ { @@ -83,10 +83,10 @@ "type" : "GlobalReference", "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" } ], - "type" : "GlobalReference" + "type" : "ExternalReference" }, "dataSpecificationContent" : { - "modelType" : "DataSpecificationIEC61360", + "modelType" : "DataSpecificationIec61360", "preferredName" : [ ] } } ] @@ -106,7 +106,7 @@ "type" : "GlobalReference", "value" : "eClassDefaultSemanticId" } ], - "type" : "GlobalReference" + "type" : "ExternalReference" } } ] } \ No newline at end of file diff --git a/dataformat-json/src/test/resources/assetAdministrationShellList.json b/dataformat-json/src/test/resources/assetAdministrationShellList.json index bca2ea576..d28d05007 100644 --- a/dataformat-json/src/test/resources/assetAdministrationShellList.json +++ b/dataformat-json/src/test/resources/assetAdministrationShellList.json @@ -24,7 +24,7 @@ "value": "https://acplt.org/TestAssetAdministrationShell2" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "assetInformation": { "assetKind": "Instance", @@ -35,7 +35,7 @@ "value": "https://acplt.org/Test_Asset" } ], - "type": "GlobalReference" + "type": "ExternalReference" } }, "submodels": [ @@ -46,7 +46,7 @@ "value": "https://acplt.org/Test_Submodel" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, { "keys": [ @@ -55,7 +55,7 @@ "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, { "keys": [ @@ -64,7 +64,7 @@ "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" } ], - "type": "GlobalReference" + "type": "ExternalReference" } ] }, @@ -81,7 +81,7 @@ "value": "https://acplt.org/Test_Asset_Mandatory" } ], - "type": "GlobalReference" + "type": "ExternalReference" } }, "submodels": [ @@ -92,7 +92,7 @@ "value": "https://acplt.org/Test_Submodel_Mandatory" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, { "keys": [ @@ -101,7 +101,7 @@ "value": "https://acplt.org/Test_Submodel2_Mandatory" } ], - "type": "GlobalReference" + "type": "ExternalReference" } ] } diff --git a/dataformat-json/src/test/resources/submodelDescriptor.json b/dataformat-json/src/test/resources/submodelDescriptor.json index d518b60e1..164daa569 100644 --- a/dataformat-json/src/test/resources/submodelDescriptor.json +++ b/dataformat-json/src/test/resources/submodelDescriptor.json @@ -19,10 +19,10 @@ "type" : "GlobalReference", "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" } ], - "type" : "GlobalReference" + "type" : "ExternalReference" }, "dataSpecificationContent" : { - "modelType" : "DataSpecificationIEC61360", + "modelType" : "DataSpecificationIec61360", "preferredName" : [ ] } } ] @@ -42,6 +42,6 @@ "type" : "GlobalReference", "value" : "eClassDefaultSemanticId" } ], - "type" : "GlobalReference" + "type" : "ExternalReference" } } \ No newline at end of file From b0c17e60f84e1e9c79f3a766cbaa76b7b34c14b4 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 7 Jul 2023 10:09:32 +0200 Subject: [PATCH 24/59] Adapt the mixins --- .../AnnotatedRelationshipElementMixin.java | 4 ++-- ...setAdministrationShellDescriptorMixin.java | 20 +++++++++--------- .../mixins/AssetAdministrationShellMixin.java | 2 +- .../json/mixins/AssetInformationMixin.java | 6 +++--- .../v3/dataformat/json/mixins/BlobMixin.java | 2 +- .../json/mixins/ConceptDescriptionMixin.java | 4 ++-- .../DataSpecificationIec61360Mixin.java | 12 +++++------ .../dataformat/json/mixins/EntityMixin.java | 6 +++--- .../json/mixins/EnvironmentMixin.java | 6 +++--- .../json/mixins/ExtensionMixin.java | 2 +- .../v3/dataformat/json/mixins/FileMixin.java | 2 +- .../mixins/HasDataSpecificationMixin.java | 8 +++---- .../json/mixins/HasExtensionsMixin.java | 4 ++-- .../json/mixins/HasSemanticsMixin.java | 6 +++--- .../json/mixins/IdentifiableMixin.java | 2 +- .../v3/dataformat/json/mixins/KeyMixin.java | 4 ++-- .../mixins/MultiLanguagePropertyMixin.java | 4 ++-- .../json/mixins/OperationMixin.java | 12 +++++------ .../json/mixins/OperationVariableMixin.java | 2 +- .../dataformat/json/mixins/PropertyMixin.java | 5 ++--- .../json/mixins/QualifierMixin.java | 7 +++---- .../v3/dataformat/json/mixins/RangeMixin.java | 3 +-- .../json/mixins/ReferableMixin.java | 9 ++++---- .../json/mixins/ReferenceMixin.java | 7 +++---- .../json/mixins/RelationshipElementMixin.java | 5 ++--- .../json/mixins/SpecificAssetIdMixin.java | 5 ++--- .../json/mixins/SubmodelDescriptorMixin.java | 13 ++++++------ .../SubmodelElementCollectionMixin.java | 5 ++--- .../json/mixins/SubmodelElementListMixin.java | 21 +++++++++---------- .../dataformat/json/mixins/SubmodelMixin.java | 13 ++++++------ .../json/mixins/ValueReferencePairMixin.java | 5 ++--- 31 files changed, 97 insertions(+), 109 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java index 59f49b8de..0cdc361b3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java @@ -22,8 +22,8 @@ public interface AnnotatedRelationshipElementMixin { @JsonProperty("annotations") - public List getAnnotations(); + List getAnnotations(); @JsonProperty("annotations") - public void setAnnotations(List annotations); + void setAnnotations(List annotations); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java index 3fe313526..8e18c7d83 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java @@ -27,32 +27,32 @@ public interface AssetAdministrationShellDescriptorMixin { @JsonProperty("idShort") - public String getIdShort(); + String getIdShort(); @JsonProperty("idShort") - public void setIdShort(String idShort); + void setIdShort(String idShort); @JsonProperty("descriptions") - public List getDescription(); + List getDescription(); @JsonProperty("descriptions") - public void setDescription(List description); + void setDescription(List description); @JsonProperty("displayNames") - public List getDisplayName(); + List getDisplayName(); @JsonProperty("displayNames") - public void setDisplayName(List displayName); + void setDisplayName(List displayName); @JsonProperty("submodelDescriptors") - public List getSubmodelDescriptor(); + List getSubmodelDescriptor(); @JsonProperty("submodelDescriptors") - public void setSubmodelDescriptor(List submodelDescriptor); + void setSubmodelDescriptor(List submodelDescriptor); @JsonProperty("specificAssetIds") - public SpecificAssetId getSpecificAssetId(); + SpecificAssetId getSpecificAssetId(); @JsonProperty("specificAssetIds") - public void setSpecificAssetId(SpecificAssetId specificAssetId); + void setSpecificAssetId(SpecificAssetId specificAssetId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java index 9d5e8c215..9975805ad 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java @@ -22,5 +22,5 @@ public interface AssetAdministrationShellMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public AssetInformation getAssetInformation(); + AssetInformation getAssetInformation(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java index 1e88c6d7f..a86d56503 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java @@ -23,11 +23,11 @@ public interface AssetInformationMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public AssetKind getAssetKind(); + AssetKind getAssetKind(); @JsonProperty("globalAssetId") - public String getGlobalAssetID(); + String getGlobalAssetId(); @JsonProperty("globalAssetId") - public void setGlobalAssetID(String globalAssetID); + void setGlobalAssetId(String globalAssetId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java index 7dec06cbe..e64dff105 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java @@ -20,5 +20,5 @@ public interface BlobMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public String getMimeType(); + String getMimeType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java index f5aadcd1b..529a7aeb4 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java @@ -22,8 +22,8 @@ public interface ConceptDescriptionMixin { @JsonProperty("isCaseOf") - public List getIsCaseOf(); + List getIsCaseOf(); @JsonProperty("isCaseOf") - public void setIsCaseOfs(List isCaseOf); + void setIsCaseOfs(List isCaseOf); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java index 88ec3908d..b3bf5113a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java @@ -26,21 +26,21 @@ public interface DataSpecificationIec61360Mixin { @JsonProperty("levelType") - public List getLevelTypes(); + List getLevelTypes(); @JsonProperty("levelType") - public void setLevelTypes(List levelTypes); + void setLevelTypes(List levelTypes); @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("preferredName") - public List getPreferredName(); + List getPreferredName(); @JsonProperty("preferredName") - public void setPreferredName(List preferredName); + void setPreferredName(List preferredName); @JsonProperty("unitId") - public Reference getUnitID(); + Reference getUnitId(); public @JsonProperty("unitId") - void setUnitID(Reference unitID); + void setUnitId(Reference unitId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java index c6d9a89ef..1c1a2753e 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java @@ -22,11 +22,11 @@ public interface EntityMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public EntityType getEntityType(); + EntityType getEntityType(); @JsonProperty("globalAssetId") - public String getGlobalAssetID(); + String getGlobalAssetId(); @JsonProperty("globalAssetId") - public void setGlobalAssetID(String globalAssetID); + void setGlobalAssetId(String globalAssetId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java index 878589f67..7b337e051 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java @@ -27,11 +27,11 @@ public interface EnvironmentMixin { @JsonInclude(JsonInclude.Include.NON_EMPTY) - public Set getAssetAdministrationShells(); + Set getAssetAdministrationShells(); @JsonInclude(JsonInclude.Include.NON_EMPTY) - public List getSubmodels(); + List getSubmodels(); @JsonInclude(JsonInclude.Include.NON_EMPTY) - public List getConceptDescriptions(); + List getConceptDescriptions(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java index f169a29ed..9c84906bd 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java @@ -20,5 +20,5 @@ public interface ExtensionMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public String getName(); + String getName(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java index 91b903b08..b5780799d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java @@ -20,5 +20,5 @@ public interface FileMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public String getContentType(); + String getContentType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java index ddf50345a..c1fa34770 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java @@ -24,14 +24,14 @@ public interface HasDataSpecificationMixin { @JsonProperty("embeddedDataSpecifications") - public List getEmbeddedDataSpecifications(); + List getEmbeddedDataSpecifications(); @JsonProperty("embeddedDataSpecifications") - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications); + void setEmbeddedDataSpecifications(List embeddedDataSpecifications); @JsonProperty("dataSpecifications") - public List getDataSpecifications(); + List getDataSpecifications(); @JsonProperty("dataSpecifications") - public void setDataSpecifications(List dataSpecifications); + void setDataSpecifications(List dataSpecifications); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java index d97c658e3..9f58ad830 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java @@ -24,8 +24,8 @@ public interface HasExtensionsMixin { @JsonProperty("extension") - public List getExtensions(); + List getExtensions(); @JsonProperty("extension") - public void setExtensions(List extensions); + void setExtensions(List extensions); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java index 6398cc152..c5f02fe74 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java @@ -20,8 +20,8 @@ public interface HasSemanticsMixin { @JsonProperty("semanticId") - public Reference getSemanticID(); + Reference getSemanticId(); - @JsonProperty("semanticId") - public void setSemanticID(Reference semanticID); + @JsonProperty("semanticId") + void setSemanticId(Reference semanticId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java index 301a31bc6..2d203c018 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java @@ -20,5 +20,5 @@ public interface IdentifiableMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public String getId(); + String getId(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java index fbbe1f0e2..a600b260c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java @@ -21,8 +21,8 @@ public interface KeyMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public KeyTypes getType(); + KeyTypes getType(); @JsonInclude(JsonInclude.Include.ALWAYS) - public String getValue(); + String getValue(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java index cacb010eb..c27011087 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java @@ -30,8 +30,8 @@ public interface MultiLanguagePropertyMixin { public void setValue(LangStringTextType value); @JsonProperty("valueId") - public Reference getValueID(); + public Reference getValueId(); @JsonProperty("valueId") - public void setValueID(Reference valueID); + public void setValueId(Reference valueId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java index 26aefde1d..a62ed8397 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java @@ -22,20 +22,20 @@ public interface OperationMixin { @JsonProperty("inputVariables") - public List getInputVariables(); + List getInputVariables(); @JsonProperty("inputVariables") - public void setInputVariables(List inputVariables); + void setInputVariables(List inputVariables); @JsonProperty("inoutputVariables") - public List getInoutputVariables(); + List getInoutputVariables(); @JsonProperty("inoutputVariables") - public void setInoutputVariables(List inoutputVariables); + void setInoutputVariables(List inoutputVariables); @JsonProperty("outputVariables") - public List getOutputVariables(); + List getOutputVariables(); @JsonProperty("outputVariables") - public void setOutputVariables(List outputVariables); + void setOutputVariables(List outputVariables); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java index 33ca567e1..608df9adb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java @@ -21,5 +21,5 @@ public interface OperationVariableMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public SubmodelElement getValue(); + SubmodelElement getValue(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java index 7321e805f..f4fbb6943 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java @@ -19,10 +19,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface PropertyMixin { - @JsonProperty("valueId") - public Reference getValueID(); + Reference getValueId(); @JsonProperty("valueId") - void setValueID(Reference valueID); + void setValueId(Reference valueId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java index 6cdd8c2a3..a0cea9c50 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java @@ -20,13 +20,12 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface QualifierMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getType(); + String getType(); @JsonProperty("valueId") - public Reference getValueID(); + Reference getValueId(); @JsonProperty("valueId") - void setValueID(Reference valueID); + void setValueId(Reference valueId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java index 49fdef609..d7b609ac4 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; public interface RangeMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getValueType(); + String getValueType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java index d93eb2c17..9131120f1 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java @@ -22,16 +22,15 @@ import java.util.List; public interface ReferableMixin { - @JsonProperty("description") - public List getDescription(); + List getDescription(); @JsonProperty("description") - public void setDescription(List description); + void setDescription(List description); @JsonProperty("displayName") - public List getDisplayName(); + List getDisplayName(); @JsonProperty("displayName") - public void setDisplayName(List displayNames); + void setDisplayName(List displayNames); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java index 9105bc8bf..b9be2c816 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java @@ -23,15 +23,14 @@ import java.util.List; public interface ReferenceMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("keys") - public List getKeys(); + List getKeys(); @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("type") - public ReferenceTypes getType(); + ReferenceTypes getType(); @JsonProperty("type") - public void setType(ReferenceTypes type); + void setType(ReferenceTypes type); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java index 04abbe3a3..5bbd6c537 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java @@ -19,10 +19,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface RelationshipElementMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public Reference getFirst(); + Reference getFirst(); @JsonInclude(JsonInclude.Include.ALWAYS) - public Reference getSecond(); + Reference getSecond(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java index 94f435137..6571976b8 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java @@ -19,10 +19,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface SpecificAssetIdMixin { - @JsonProperty("externalSubjectId") - public Reference getExternalSubjectID(); + Reference getExternalSubjectId(); @JsonProperty("externalSubjectId") - public void setExternalSubjectID(Reference reference); + void setExternalSubjectId(Reference reference); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java index faf4b909a..27fe07f07 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java @@ -24,22 +24,21 @@ import java.util.List; public interface SubmodelDescriptorMixin { - @JsonProperty("descriptions") - public List getDescription(); + List getDescription(); @JsonProperty("descriptions") - public void setDescription(List description); + void setDescription(List description); @JsonProperty("displayNames") - public List getDisplayName(); + List getDisplayName(); @JsonProperty("displayNames") - public void setDisplayName(List displayName); + void setDisplayName(List displayName); @JsonProperty("specificAssetIds") - public SpecificAssetId getSpecificAssetId(); + SpecificAssetId getSpecificAssetId(); @JsonProperty("specificAssetIds") - public void setSpecificAssetId(SpecificAssetId specificAssetId); + void setSpecificAssetId(SpecificAssetId specificAssetId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java index 95cfa1469..bcd6ef9ea 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java @@ -20,10 +20,9 @@ import java.util.Collection; public interface SubmodelElementCollectionMixin { - @JsonProperty("value") - public Collection getValues(); + Collection getValues(); @JsonProperty("value") - public void setValues(Collection values); + void setValues(Collection values); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java index 5ca0161db..d1f78dd72 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -26,36 +26,35 @@ import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; public interface SubmodelElementListMixin { - @JsonInclude(JsonInclude.Include.NON_DEFAULT) @JsonProperty("orderRelevant") - public boolean getOrdered(); + boolean getOrdered(); @JsonInclude(JsonInclude.Include.NON_DEFAULT) @JsonProperty("orderRelevant") - public void setOrdered(boolean orderRelevant); + void setOrdered(boolean orderRelevant); @JsonProperty("semanticIdListElement") - public Reference getSemanticIdListElement(); + Reference getSemanticIdListElement(); @JsonProperty("semanticIdListElement") - public void setSemanticIdListElement(Reference semanticIdListElement); + void setSemanticIdListElement(Reference semanticIdListElement); @JsonProperty("typeValueListElement") - public AasSubmodelElements getTypeValueListElement(); + AasSubmodelElements getTypeValueListElement(); @JsonProperty("typeValueListElement") - public void setTypeValueListElement(AasSubmodelElements typeValueListElement); + void setTypeValueListElement(AasSubmodelElements typeValueListElement); @JsonProperty("valueTypeListElement") - public DataTypeDefXsd getValueTypeListElement(); + DataTypeDefXsd getValueTypeListElement(); @JsonProperty("valueTypeListElement") - public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); + void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); @JsonProperty("value") - public Collection getValues(); + Collection getValues(); @JsonProperty("value") - public void setValues(Collection values); + void setValues(Collection values); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java index d1a7f64a3..f39588dc4 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java @@ -23,22 +23,21 @@ import java.util.List; public interface SubmodelMixin { - @JsonProperty("idShort") - public String getIdShort(); + String getIdShort(); @JsonProperty("idShort") - public void setIdShort(String idShort); + void setIdShort(String idShort); @JsonProperty("description") - public List getDescription(); + List getDescription(); @JsonProperty("description") - public void setDescription(List description); + void setDescription(List description); @JsonProperty("displayName") - public List getDisplayName(); + List getDisplayName(); @JsonProperty("displayName") - public void setDisplayName(List displayName); + void setDisplayName(List displayName); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java index 163467672..bc5873f14 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java @@ -19,10 +19,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface ValueReferencePairMixin { - @JsonProperty("valueId") - public Reference getValueID(); + Reference getValueId(); @JsonProperty("valueId") - public void setValueID(Reference valueID); + void setValueId(Reference valueId); } From 6326daebb74dd7cde5630d7eb53feab023f0cf90 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 7 Jul 2023 10:25:17 +0200 Subject: [PATCH 25/59] Revert some changes in the comments --- .../digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java | 1 - .../digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java | 1 - 2 files changed, 2 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index 0b0aa33d9..d2ce12523 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index f0456b2ee..095c964e2 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 74811fb816e1a546528cdc352f19359d33c905fa Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 7 Jul 2023 11:30:04 +0200 Subject: [PATCH 26/59] Adapt dataformat-core --- .../v3/dataformat/core/util/AasUtils.java | 1 - .../aas4j/v3/dataformat/core/AASFull.java | 173 +++++++++++------- .../aas4j/v3/dataformat/core/AASSimple.java | 44 ++++- .../v3/dataformat/core/CustomProperty.java | 17 +- .../dataformat/core/EnumDeserializerTest.java | 28 ++- .../dataformat/core/EnumSerializerTest.java | 5 +- 6 files changed, 180 insertions(+), 88 deletions(-) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index a4ba8d154..a7d12cd1a 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 9133944d1..5a8e8536a 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -19,9 +19,54 @@ import java.util.Arrays; import java.util.Base64; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; - +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.Direction; +import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultCapability; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLevelType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultQualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueReferencePair; public class AASFull { @@ -1761,75 +1806,75 @@ public static ConceptDescription createConceptDescription3() { public static ConceptDescription createConceptDescription4() { return new DefaultConceptDescription.Builder() - .idShort("TestSpec_01") - .id("http://acplt.org/DataSpecifciations/Example/Identification") - .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") - .build()) - .isCaseOf(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) - .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() - .dataSpecification(new DefaultReference.Builder() - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) + .idShort("TestSpec_01") + .id("http://acplt.org/DataSpecifciations/Example/Identification") + .administration(new DefaultAdministrativeInformation.Builder() + .version("0") + .revision("9") .build()) - .build()) - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(Arrays.asList( - new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), - new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() - )) - .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) - .unit("SpaceUnit") - .unitId(new DefaultReference.Builder() + .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/Units/SpaceUnit") - .build()) + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") + .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") - .symbol("SU") - .valueFormat("string") - .value("TEST") - .levelType(new DefaultLevelType.Builder().max(true).build()) - .valueList(new DefaultValueList.Builder() - .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId") - .valueId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) + .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() + .dataSpecification(new DefaultReference.Builder() .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) - .build()) - .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId2") - .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId2") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(KeyTypes.GLOBAL_REFERENCE) + .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) + .build()) + .build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName(Arrays.asList( + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() + )) + .dataType(DataTypeIec61360.REAL_MEASURE) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) + .unit("SpaceUnit") + .unitId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/Units/SpaceUnit") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build()) + .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") + .symbol("SU") + .valueFormat("string") + .value("TEST") + .levelType(new DefaultLevelType.Builder().max(true).build()) + .valueList(new DefaultValueList.Builder() + .valueReferencePairs(new DefaultValueReferencePair.Builder() + .value("http://acplt.org/ValueId/ExampleValueId") + .valueId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build()) + .build()) + .valueReferencePairs(new DefaultValueReferencePair.Builder() + .value("http://acplt.org/ValueId/ExampleValueId2") + .valueId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/ValueId/ExampleValueId2") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build()) + .build()) + .build()) .build()) - .build()) .build()) - .build()) - .build()) - .build(); + .build(); } public static Environment createEnvironment() { diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index 4234ea749..340261457 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +15,36 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; - import java.util.Arrays; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResource; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; public class AASSimple { @@ -167,12 +191,12 @@ public static AssetAdministrationShell createAAS() { .build()) .submodels( new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.SUBMODEL) - .value(SUBMODEL_DOCUMENTATION_ID) - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL) + .value(SUBMODEL_DOCUMENTATION_ID) + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build()) .build(); } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java index 055ba67ba..8f4230cb3 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java @@ -28,6 +28,8 @@ public class CustomProperty implements Property { protected List dataSpecifications; + protected ModellingKind kind; + protected Reference semanticId; protected String value; @@ -56,7 +58,7 @@ protected CustomProperty() { @Override public int hashCode() { return Objects.hash(new Object[] { this.valueType, this.value, this.valueId, this.category, this.description, - this.displayName, this.idShort, this.qualifiers, /* this.embeddedDataSpecifications, this.kind,*/ + this.displayName, this.idShort, this.qualifiers, /* this.embeddedDataSpecifications,*/ this.kind, this.semanticId }); } @@ -70,13 +72,16 @@ public boolean equals(Object obj) { return false; } else { CustomProperty other = (CustomProperty) obj; - return Objects.equals(this.valueType, other.valueType) && Objects.equals(this.value, other.value) - && Objects.equals(this.valueId, other.valueId) && Objects.equals(this.category, other.category) + return Objects.equals(this.valueType, other.valueType) + && Objects.equals(this.value, other.value) + && Objects.equals(this.valueId, other.valueId) + && Objects.equals(this.category, other.category) && Objects.equals(this.description, other.description) && Objects.equals(this.displayName, other.displayName) - && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.qualifiers, other.qualifiers) - // TODO && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) - //&& Objects.equals(this.kind, other.kind) + && Objects.equals(this.idShort, other.idShort) + && Objects.equals(this.qualifiers, other.qualifiers) + && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) + && Objects.equals(this.kind, other.kind) && Objects.equals(this.semanticId, other.semanticId); } } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java index 3ad801789..f5a6b5567 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java @@ -16,8 +16,8 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; +import java.io.IOException; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; @@ -27,7 +27,8 @@ import org.junit.Test; import org.mockito.Mockito; -import java.io.IOException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; public class EnumDeserializerTest { @@ -40,8 +41,24 @@ public void setUp() { deserializationContextMock = Mockito.mock(DeserializationContext.class); } + @Test + public void whenDeserializingEnumNames_withUpperCamelCase_shouldReturnScreamingSnakeCase() { + Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("AnyEnum")); + } + + @Test + public void whenDeserializingEnumNames_withLowerCamelCase_shouldReturnScreamingSnakeCase() { + Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("anyEnum")); + } + + @Test + public void whenDeserializingEnumNames_withScreamingSnakeCase_shouldReturnUnchanged() { + final String name = "ANY_ENUM"; + Assert.assertEquals(name, EnumDeserializer.deserializeEnumName(name)); + } + @Test - public void whenSerializingEnum_usingDataTypeIec61360_shouldReturnUpperCase() { + public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { assertDeserialization("BOOLEAN", DataTypeIec61360.BOOLEAN); assertDeserialization("DATE", DataTypeIec61360.DATE); assertDeserialization("INTEGER_CURRENCY", DataTypeIec61360.INTEGER_CURRENCY); @@ -70,7 +87,8 @@ public void whenSerializingEnum_usingStateOfEvent_shouldReturnLowerCase() { assertDeserialization("off", StateOfEvent.OFF); } - private void assertDeserialization(String value, Enum expected) { + @SuppressWarnings("rawtypes") + private void assertDeserialization(String value, Enum expected) { try { Mockito.doReturn(value).when(jsonParserMock).getText(); Class type = expected.getClass(); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index c080e8cf6..33cae0017 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -69,13 +69,13 @@ public void whenSerializingEnum_usingDataTypeIec61360_shouldReturnUpperCase() { } @Test - public void whenSerializingEnum_usingDirection_shouldReturnUpperCase() { + public void whenSerializingEnum_usingDirection_shouldReturnLowerCase() { assertSerialization(Direction.INPUT, "input"); assertSerialization(Direction.OUTPUT, "output"); } @Test - public void whenSerializingEnum_usingStateOfEvent_shouldReturnUpperCase() { + public void whenSerializingEnum_usingStateOfEvent_shouldReturnLowerCase() { assertSerialization(StateOfEvent.ON, "on"); assertSerialization(StateOfEvent.OFF, "off"); } @@ -85,6 +85,7 @@ public void whenSerializingEnum_usingModelingKind_shouldReturnCamelCase() { assertSerialization(ModellingKind.INSTANCE, "Instance"); assertSerialization(ModellingKind.TEMPLATE, "Template"); } + private void assertSerialization(Enum value, String expected) { this.serializationOutput.setLength(0); try { From 382fd3d3c6d45667b66391731181db63e101950f Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 7 Jul 2023 13:48:49 +0200 Subject: [PATCH 27/59] Adapt dataformat-json project --- .../v3/dataformat/json/mixins/ConceptDescriptionMixin.java | 2 +- .../dataformat/json/mixins/MultiLanguagePropertyMixin.java | 6 +++--- .../json/mixins/SubmodelElementCollectionMixin.java | 5 +++-- .../v3/dataformat/json/mixins/SubmodelElementListMixin.java | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java index 529a7aeb4..77e2b8f47 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java @@ -25,5 +25,5 @@ public interface ConceptDescriptionMixin { List getIsCaseOf(); @JsonProperty("isCaseOf") - void setIsCaseOfs(List isCaseOf); + void setIsCaseOf(List isCaseOf); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java index c27011087..a26009306 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java @@ -24,13 +24,13 @@ public interface MultiLanguagePropertyMixin { @JsonProperty("value") - public List getValue(); + List getValue(); @JsonProperty("value") - public void setValue(LangStringTextType value); + void setValue(LangStringTextType value); @JsonProperty("valueId") - public Reference getValueId(); + Reference getValueId(); @JsonProperty("valueId") public void setValueId(Reference valueId); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java index bcd6ef9ea..0b8cc0744 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java @@ -20,9 +20,10 @@ import java.util.Collection; public interface SubmodelElementCollectionMixin { + @JsonProperty("value") - Collection getValues(); + public Collection getValue(); @JsonProperty("value") - void setValues(Collection values); + public void setValue(Collection values); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java index d1f78dd72..931547130 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -53,8 +53,8 @@ public interface SubmodelElementListMixin { void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); @JsonProperty("value") - Collection getValues(); + Collection getValue(); @JsonProperty("value") - void setValues(Collection values); -} + void setValue(Collection value); +} \ No newline at end of file From 5c7bff07acaea8a15f043e8b09476109b705ec4e Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 7 Jul 2023 13:53:47 +0200 Subject: [PATCH 28/59] Update PropertyMixin.java --- .../dataformat/xml/mixins/PropertyMixin.java | 56 ------------------- 1 file changed, 56 deletions(-) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java index 6f4d57d08..f91d8340a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java @@ -15,73 +15,17 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsNameTypeDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsNameTypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsTextTypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import java.util.List; - /** * * @author schnicke * */ -//@JsonPropertyOrder({"category", "idShort", "displayName", "description", "checksum", "valueId", "valueType", "value" }) -@JsonPropertyOrder({ - "hasExtensions", "category", "idShort", "displayName", "description", "checksum", // --> Referable - "kind", // --> HasKind - "semanticId", "supplementalSemanticIds", "reference", // --> HasSemantics - "qualifier", // --> Qualifiable - "dataSpecifications", "embeddedDataSpecifications", // --> HasDataSpecifications - "orderRelevant", "semanticIdListElement", "typeValueListElement", "valueTypeListElement", // --> SME-List - "valueType", "value", "valueId" // --> Property - , "statements", "entityType", "globalAssetId", "specificAssetId" // --> Entity - , "first", "second", "annotations" // --> (Annotated)RelationsShipElement - , "inputVariables", "outputVariables", "inoutputVariables" // --> Operation - , "observed","direction","state","messageTopic","messageBroker","lastUpdate","minInterval","maxInterval" // --> BasicEventElement - , "min", "max" // Range -}) public interface PropertyMixin { - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") - void setCategory(String category); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") - String getCategory(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "idShort") - void setIdShort(String idShort); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "idShort") - String getIdShort(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") - @JsonDeserialize(using = LangStringsNameTypeDeserializer.class) - List getDisplayName(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") - @JsonSerialize(using = LangStringsNameTypeSerializer.class) - void setDisplayName(List displayNames); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") - @JsonSerialize(using = LangStringsTextTypeSerializer.class) - List getDescription(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") - @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) - void setDescription(List descriptions); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") void setValueId(Reference valueId); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") - Reference getValueId(); } From e5184d4de5ce14c7e9a53a7a27a3c2065ff285d8 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 13 Jul 2023 15:07:21 +0200 Subject: [PATCH 29/59] Create ValueOnlyJsonSerializer --- .../dataformat/json/valueonly/ValueOnlyJsonSerializer.java | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java new file mode 100644 index 000000000..f87ee2fa8 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java @@ -0,0 +1,5 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +public class ValueOnlyJsonSerializer { + +} From 30dfca87fdd87b79d32ad51381fb125c905e142a Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 17 Jul 2023 15:52:30 +0200 Subject: [PATCH 30/59] Implement the value-only serialization --- .../json/valueonly/AbstractSerializer.java | 30 ++++++ .../AnnotatedRelationshipSerializer.java | 34 +++++++ .../json/valueonly/BasicEventSerializer.java | 24 +++++ .../json/valueonly/BlobSerializer.java | 32 +++++++ .../ElementsCollectionSerializer.java | 93 +++++++++++++++++++ .../valueonly/ElementsListSerializer.java | 29 ++++++ .../json/valueonly/EntitySerializer.java | 49 ++++++++++ .../json/valueonly/FileSerializer.java | 30 ++++++ .../MultiLanguagePropertySerializer.java | 37 ++++++++ .../json/valueonly/PropertySerializer.java | 27 ++++++ .../json/valueonly/RangeSerializer.java | 33 +++++++ .../valueonly/ReferenceElementSerializer.java | 21 +++++ .../valueonly/RelationshipSerializer.java | 27 ++++++ .../json/valueonly/ValueConverter.java | 68 ++++++++++++++ .../valueonly/ValueOnlyJsonSerializer.java | 74 ++++++++++++++- .../ValueOnlySerializationException.java | 10 ++ .../test/resources/valueonly/submodel.json | 22 +++++ 17 files changed, 639 insertions(+), 1 deletion(-) create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertySerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertySerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueConverter.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java create mode 100644 dataformat-json/src/test/resources/valueonly/submodel.json diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java new file mode 100644 index 000000000..241282ba7 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java @@ -0,0 +1,30 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; + +/** + * The abstract base class for all value-only serializers. + * @param The type of the serialized elements. + */ +public abstract class AbstractSerializer { + protected T element; + protected String idShortPath; + + /** + * + * @param element the submodel element that has to be serialized. + * @param idShortPath the idShort path is a dot separated chain of idShorts, that can be used in case of + * troubleshooting. + */ + protected AbstractSerializer(T element, String idShortPath) { + this.element = element; + this.idShortPath = idShortPath; + } + + /** + * This method serializes the corresponding element. + * @return the corresponding JSON node. + * @throws ValueOnlySerializationException with information about the idShort path. + */ + public abstract JsonNode serialize() throws ValueOnlySerializationException; +} \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java new file mode 100644 index 000000000..182016a2b --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java @@ -0,0 +1,34 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; +import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.ArrayList; +import java.util.List; + +/** + * AnnotatedRelationshipElement is serialized according to the serialization of a ReleationshipElement. Additionally, a + * third named JSON object is introduced with "annotations" as the name of the containing JSON property. The value is + * ${AnnotatedRelationshipElement/annotations}. The values of the array items are serialized depending on the type of + * the annotation data element. + */ +public class AnnotatedRelationshipSerializer extends AbstractSerializer { + AnnotatedRelationshipSerializer(AnnotatedRelationshipElement relationship, String idShortPath) { + super(relationship, idShortPath); + } + + @Override + public JsonNode serialize() throws ValueOnlySerializationException { + ObjectNode node = JsonNodeFactory.instance.objectNode(); + node.set("first", JsonNodeFactory.instance.pojoNode(element.getFirst())); + node.set("second", JsonNodeFactory.instance.pojoNode(element.getSecond())); + List annotations = new ArrayList<>(element.getAnnotations()); + ElementsListSerializer listSerializer = new ElementsListSerializer( + annotations, idShortPath + ".annotations"); + node.set("annotations", listSerializer.serialize()); + return node; + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java new file mode 100644 index 000000000..6fd85fad8 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java @@ -0,0 +1,24 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; +import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; + +/** + * BasicEventElement is serialized as named JSON object with ${BasicEventElement/idShort} as the name of the containing + * JSON property. The JSON object contains one JSON property named “observed” with the corresponding value of + * ${BasicEventElement/observed} as the standard serialization of the Reference class. + */ +public class BasicEventSerializer extends AbstractSerializer { + BasicEventSerializer(BasicEventElement event, String idShortPath) { + super(event, idShortPath); + } + + @Override + public JsonNode serialize() throws ValueOnlySerializationException { + ObjectNode node = JsonNodeFactory.instance.objectNode(); + node.set("observed", JsonNodeFactory.instance.pojoNode(element.getObserved())); + return node; + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobSerializer.java new file mode 100644 index 000000000..6b186f33e --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobSerializer.java @@ -0,0 +1,32 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; +import org.eclipse.digitaltwin.aas4j.v3.model.Blob; + +import java.util.Base64; + +/** + * Blob is serialized as named JSON object with ${Blob/idShort} as the name of the containing JSON property. The JSON + * object contains two JSON properties. The first refers to the content type named "contentType" and value + * ${Blob/contentType}. The latter refers to the value named “value” and value ${Blob/value}. The resulting value-only + * object is indistinguishable whether it contains File or Blob attributes. Therefore, the receiver needs to take the + * type of the target resource into account. Since the receiver knows in advance if a File or a Blob SubmodelElement + * shall be manipulated, it can parse the transferred value-only object accordingly as a File or Blob object. + */ +class BlobSerializer extends AbstractSerializer { + BlobSerializer(Blob blob, String idShortPath) { + super(blob, idShortPath); + } + + @Override + public JsonNode serialize() throws ValueOnlySerializationException { + ObjectNode node = JsonNodeFactory.instance.objectNode(); + node.set("contentType", new TextNode(element.getContentType())); + node.set("value", new TextNode(Base64.getEncoder().encodeToString(element.getValue()))); + return node; + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java new file mode 100644 index 000000000..c66e8a434 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java @@ -0,0 +1,93 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.NullNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; +import org.eclipse.digitaltwin.aas4j.v3.model.Blob; +import org.eclipse.digitaltwin.aas4j.v3.model.Entity; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.Property; +import org.eclipse.digitaltwin.aas4j.v3.model.Range; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; + +import java.util.List; + +/** + * SubmodelElementCollection is serialized as named JSON object with ${SubmodelElementCollection/idShort} as the name of + * the containing JSON property. The elements contained within the struct are serialized according to their respective + * type with ${SubmodelElement/idShort} as the name of the containing JSON property. + */ +public class ElementsCollectionSerializer extends AbstractSerializer> { + ElementsCollectionSerializer(List elements, String idShortPath) { + super(elements, idShortPath); + } + + @Override + public JsonNode serialize() throws ValueOnlySerializationException { + ObjectNode node = JsonNodeFactory.instance.objectNode(); + for(SubmodelElement submodelElement : element) { + String idShort = submodelElement.getIdShort(); + JsonNode elementNode = serialize(submodelElement, idShortPath + "." + idShort); + if(elementNode.equals(NullNode.instance)) { + // This type of submodel elements are not serialized in value-only format. + continue; + } + if(node.has(idShort)) { + throw new ValueOnlySerializationException("Duplicated idShort name '" + idShort + + "' under idShort path '" + idShortPath + "'"); + } + node.set(idShort, elementNode); + } + return node; + } + + static JsonNode serialize(SubmodelElement element, String idShortPath) throws ValueOnlySerializationException { + if(element instanceof Blob) { + return new BlobSerializer((Blob) element, idShortPath).serialize(); + } + if(element instanceof File) { + return new FileSerializer((File) element, idShortPath).serialize(); + } + if(element instanceof MultiLanguageProperty) { + return new MultiLanguagePropertySerializer((MultiLanguageProperty)element, idShortPath).serialize(); + } + if(element instanceof Property) { + return new PropertySerializer((Property)element, idShortPath).serialize(); + } + if(element instanceof Range) { + return new RangeSerializer((Range) element, idShortPath).serialize(); + } + if(element instanceof ReferenceElement) { + return new ReferenceElementSerializer((ReferenceElement) element, idShortPath).serialize(); + } + if(element instanceof Entity) { + return new EntitySerializer((Entity) element, idShortPath).serialize(); + } + if(element instanceof BasicEventElement) { + return new BasicEventSerializer((BasicEventElement) element, idShortPath).serialize(); + } + if(element instanceof SubmodelElementCollection) { + return new ElementsCollectionSerializer(((SubmodelElementCollection)element).getValue(), idShortPath).serialize(); + } + if(element instanceof SubmodelElementList) { + return new ElementsListSerializer(((SubmodelElementCollection)element).getValue(), idShortPath).serialize(); + } + if(element instanceof AnnotatedRelationshipElement) { + return new AnnotatedRelationshipSerializer((AnnotatedRelationshipElement) element, idShortPath).serialize(); + } + if(element instanceof RelationshipElement) { + return new RelationshipSerializer((RelationshipElement) element, idShortPath).serialize(); + } + + // This type of submodel element should not be serialized. + return NullNode.instance; + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListSerializer.java new file mode 100644 index 000000000..f59ac2a05 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListSerializer.java @@ -0,0 +1,29 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; + +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.List; + +/** + * SubmodelElementList is serialized as a JSON array with the index of the contained SubmodelElement in the list as the + * position in the JSON array. The elements contained within the list are serialized according to their respective type. + */ +public class ElementsListSerializer extends ElementsCollectionSerializer { + ElementsListSerializer(List elements, String idShortPath) { + super(elements, idShortPath); + } + + @Override + public JsonNode serialize() throws ValueOnlySerializationException { + ArrayNode arrayNode = JsonNodeFactory.instance.arrayNode(); + for(int i = 0; i < element.size(); i++) { + SubmodelElement submodelElement = element.get(i); + arrayNode.add(serialize(submodelElement, idShortPath + "[" + i + "]")); + } + return arrayNode; + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java new file mode 100644 index 000000000..855da27e5 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java @@ -0,0 +1,49 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; +import org.eclipse.digitaltwin.aas4j.v3.model.Entity; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.List; + +/** + * Entity is serialized as named JSON object with ${Entity/idShort} as the name of the containing JSON property. The + * JSON object contains three JSON properties. The first is named “statements” ${Entity/statements} and contains an + * array of the serialized submodel elements according to their respective serialization mentioned in this clause. The + * second is named either “globalAssetId” or “specificAssetId” and contains either a Reference (see above) or a + * SpecificAssetId. SpecificAssetId is serialized as named JSON object with the values of the properties “name” for the + * JSON key and “value” for the JSON value. The third property is named “entityType” and contains a string + * representation of ${Entity/entityType}. + */ +public class EntitySerializer extends AbstractSerializer { + + EntitySerializer(Entity entity, String idShortPath) { + super(entity, idShortPath); + } + + @Override + public JsonNode serialize() throws ValueOnlySerializationException { + ObjectNode node = JsonNodeFactory.instance.objectNode(); + List elements = element.getStatements(); + ElementsListSerializer ecSerializer = new ElementsListSerializer(elements, idShortPath + ".statements"); + node.set("statements", ecSerializer.serialize()); + String globalAssetId = element.getGlobalAssetId(); + if(globalAssetId != null) { + node.set("globalAssetId", new TextNode(globalAssetId)); + } + List specificAssetIds = element.getSpecificAssetIds(); + if(specificAssetIds != null && specificAssetIds.size() > 0) { + ObjectNode assetIdNode = JsonNodeFactory.instance.objectNode(); + for (SpecificAssetId assetId : specificAssetIds) { + assetIdNode.set(assetId.getValue(), new TextNode(assetId.getName())); + } + node.set("specificAssetId", assetIdNode); + } + node.set("entityType", new TextNode(element.getEntityType().name())); + return node; + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileSerializer.java new file mode 100644 index 000000000..cbd7c170c --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileSerializer.java @@ -0,0 +1,30 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; +import org.eclipse.digitaltwin.aas4j.v3.model.File; + +/** + * File is serialized as named JSON object with ${File/idShort} as the name of the containing JSON property. The JSON + * object contains two JSON properties. The first refers to the content type named "contentType" and value + * ${File/contentType}. The latter refers to the value named “value” and value ${File/value}. The resulting value-only + * object is indistinguishable whether it contains File or Blob attributes. Therefore, the receiver needs to take the + * type of the target resource into account. Since the receiver knows in advance if a File or a Blob SubmodelElement + * shall be manipulated, it can parse the transferred value-only object accordingly as a File or Blob object. + */ +class FileSerializer extends AbstractSerializer { + + FileSerializer(File file, String idShortPath) { + super(file, idShortPath); + } + + @Override + public JsonNode serialize() throws ValueOnlySerializationException { + ObjectNode node = JsonNodeFactory.instance.objectNode(); + node.set("contentType", new TextNode(element.getContentType())); + node.set("value", new TextNode(element.getValue())); + return node; + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertySerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertySerializer.java new file mode 100644 index 000000000..151914e4d --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertySerializer.java @@ -0,0 +1,37 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.NullNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; + +import java.util.List; + +/** + * MultiLanguageProperty is serialized as named JSON object with ${MultiLanguageProperty/idShort} as the name of the + * containing JSON property. The JSON object contains an array of JSON objects for each language of the + * MultiLanguageProperty with the language as name and the corresponding localized string as value of the respective + * JSON property. The language name is defined as two chars according to ISO 639-1. + */ +public class MultiLanguagePropertySerializer extends AbstractSerializer { + + MultiLanguagePropertySerializer(MultiLanguageProperty property, String idShortPath) { + super(property, idShortPath); + } + + @Override + public JsonNode serialize() throws ValueOnlySerializationException { + List langTexts = element.getValue(); + if(langTexts == null || langTexts.size() == 0) { + return NullNode.instance; + } + ObjectNode node = JsonNodeFactory.instance.objectNode(); + for (LangStringTextType langText: langTexts) { + node.set(langText.getLanguage(), new TextNode(langText.getText())); + } + return node; + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertySerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertySerializer.java new file mode 100644 index 000000000..78ac83f27 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertySerializer.java @@ -0,0 +1,27 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.TextNode; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.Property; + +/** + * Property is serialized as ${Property/idShort}: ${Property/value} where ${Property/value} is the JSON serialization + * of the respective property’s value in accordance with the data type to value mapping. + * @see ValueConverter + */ +public class PropertySerializer extends AbstractSerializer { + PropertySerializer(Property property, String idShortPath) { + super(property, idShortPath); + } + + @Override + public JsonNode serialize() throws ValueOnlySerializationException { + try { + return ValueConverter.convert(element.getValueType(), element.getValue()); + } catch (NumberFormatException ex) { + throw new ValueOnlySerializationException("Cannot serialize the property with idShort path '" + + idShortPath + "': " + ex.getMessage()); + } + } +} \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeSerializer.java new file mode 100644 index 000000000..eb1466838 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeSerializer.java @@ -0,0 +1,33 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.Range; + +/** + * Range is serialized as named JSON object with ${Range/idShort} as the name of the containing JSON property. The JSON + * object contains two JSON properties. The first is named "min". The second is named "max". Their corresponding values + * are ${Range/min} and ${Range/max}. + */ +public class RangeSerializer extends AbstractSerializer { + RangeSerializer(Range range, String idShortPath) { + super(range, idShortPath); + } + + @Override + public JsonNode serialize() throws ValueOnlySerializationException { + try { + ObjectNode node = JsonNodeFactory.instance.objectNode(); + DataTypeDefXsd valueType = element.getValueType(); + node.set("min", ValueConverter.convert(valueType, element.getMin())); + node.set("max", ValueConverter.convert(valueType, element.getMax())); + return node; + } catch (NumberFormatException ex) { + throw new ValueOnlySerializationException("Cannot serialize the range with idShort path '" + + idShortPath + "': " + ex.getMessage()); + } + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java new file mode 100644 index 000000000..6bf76100c --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java @@ -0,0 +1,21 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; + +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; + +/** + * ReferenceElement is serialized as ${ReferenceElement/idShort}: ${ReferenceElement/value} where + * ${ReferenceElement/value} is the serialization of the Reference class. + */ +public class ReferenceElementSerializer extends AbstractSerializer { + ReferenceElementSerializer(ReferenceElement element, String idShortPath) { + super(element, idShortPath); + } + + @Override + public JsonNode serialize() throws ValueOnlySerializationException { + return JsonNodeFactory.instance.pojoNode(element.getValue()); + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipSerializer.java new file mode 100644 index 000000000..0363f8bbb --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipSerializer.java @@ -0,0 +1,27 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + +import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; + +/** + * RelationshipElement is serialized as named JSON object with ${RelationshipElement/idShort} as the name of the + * containing JSON property. The JSON object contains two JSON properties. The first is named "first". The second is + * named "second". Their corresponding values are ${RelationshipElement/first} resp. ${Relationship/second}. The values + * are serialized according to the serialization of a Reference. + */ +public class RelationshipSerializer extends AbstractSerializer { + RelationshipSerializer(RelationshipElement relationship, String idShortPath) { + super(relationship, idShortPath); + } + + @Override + public JsonNode serialize() throws ValueOnlySerializationException { + ObjectNode node = JsonNodeFactory.instance.objectNode(); + node.set("first", JsonNodeFactory.instance.pojoNode(element.getFirst())); + node.set("second", JsonNodeFactory.instance.pojoNode(element.getSecond())); + return node; + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueConverter.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueConverter.java new file mode 100644 index 000000000..1e7201c1d --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueConverter.java @@ -0,0 +1,68 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.BooleanNode; +import com.fasterxml.jackson.databind.node.DoubleNode; +import com.fasterxml.jackson.databind.node.FloatNode; +import com.fasterxml.jackson.databind.node.IntNode; +import com.fasterxml.jackson.databind.node.LongNode; +import com.fasterxml.jackson.databind.node.TextNode; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; + +import java.math.BigDecimal; + +/** + * This is a helper class for the serialization of string values depending of their data type. The data types are + * defined according to the W3C XML Schema (https://www.w3.org/TR/xmlschema-2/#built-in-datatypes and + * https://www.w3.org/TR/xmlschema-2/#built-in-derived). + * Note that for xs:decimal, xs:unsignedLong, xs:positiveInteger, xs:nonNegativeInteger, xs:negativeInteger and + * xs:nonPositiveInteger exists the possibility for lost of precision during the conversion. + */ +class ValueConverter { + private ValueConverter() {} + + /** + * + * @param dataType The data type. + * @param value + * @return + * @throws NumberFormatException + */ + static JsonNode convert(DataTypeDefXsd dataType, String value) throws NumberFormatException { + if(dataType == null) { + return new TextNode(value); + } + + switch (dataType) { + case BOOLEAN: + return Boolean.parseBoolean(value) ? BooleanNode.TRUE : BooleanNode.FALSE; + case DECIMAL: + // According to the AAS spec, this type is serialized as a number. + // There is a possibility for lost of precision. + return new DoubleNode(new BigDecimal(value).doubleValue()); + case BYTE: + case UNSIGNED_BYTE: + case SHORT: + case UNSIGNED_SHORT: + case INT: + return new IntNode(Integer.parseInt(value)); + case UNSIGNED_INT: + case POSITIVE_INTEGER: + case NEGATIVE_INTEGER: + case NON_NEGATIVE_INTEGER: + case NON_POSITIVE_INTEGER: + case LONG: + return new LongNode(Long.parseLong(value)); + case UNSIGNED_LONG: + // According to the spec, it should be serialized as number. There is a possibility for precision lost. + case DOUBLE: + return new DoubleNode(Double.parseDouble(value)); + case FLOAT: + return new FloatNode(Float.parseFloat(value)); + default: + // All other types have no need to be converted from string. + return new TextNode(value); + } + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java index f87ee2fa8..e4509a89d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java @@ -1,5 +1,77 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import com.fasterxml.jackson.databind.JsonNode; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +/** + * This class implements the value-only Serialization in JSON format, as described in section 11.4.2 of + * AAS Specification Part 2
+ * + * Values are only available for: + *
  • All subtypes of abstract type DataElement
  • + *
  • SubmodelElementList and SubmodelElementCollection respectively for their included SubmodelElements
  • + *
  • ReferenceElement
  • + *
  • RelationshipElement + AnnotatedRelationshipElement
  • + *
  • Entity
  • + *
  • BasicEventElement
  • + */ public class ValueOnlyJsonSerializer { - + private final boolean prettyString; + + /** + * The default constructor creates a value-only serializer which serializes submodels and submodel elements to a + * compact string. + */ + public ValueOnlyJsonSerializer() { + this(false); + } + + /** + * Creates a value-only serializer. + * @param prettyString pass true, if you want to have a pretty formatted strings. + */ + public ValueOnlyJsonSerializer(boolean prettyString) { + this.prettyString = prettyString; + } + + /** + * Serializes a submodel in value-only JSON format. + * @param submodel the submodel to be serialized. + * @return the corresponding value-only JSON string. + */ + public String write(Submodel submodel) throws ValueOnlySerializationException { + ElementsCollectionSerializer serializer = new ElementsCollectionSerializer(submodel.getSubmodelElements(), "$"); + JsonNode node = serializer.serialize(); + return prettyString ? node.toPrettyString() : node.toString(); + } + + /** + * Serializes a submodel element in value-only JSON format. + * @param element the submodel element to be serialized. + * @return the corresponding value-only JSON string. + * @param element + * @return + */ + public String write(SubmodelElement element) throws ValueOnlySerializationException { + JsonNode node = ElementsCollectionSerializer.serialize(element, "$"); + return prettyString ? node.toPrettyString() : node.toString(); + } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java new file mode 100644 index 000000000..07dc6694e --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java @@ -0,0 +1,10 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +/** + * This exception is thrown during the value-only serialization. + */ +public class ValueOnlySerializationException extends Exception { + public ValueOnlySerializationException(String msg) { + super(msg); + } +} diff --git a/dataformat-json/src/test/resources/valueonly/submodel.json b/dataformat-json/src/test/resources/valueonly/submodel.json new file mode 100644 index 000000000..20140c117 --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/submodel.json @@ -0,0 +1,22 @@ +{ + "collection1": { + "propString": "foo", + "rangeDouble": { + "min": 3.0, + "max": 5.0 + }, + "entity1": { + "statements": + { + "MaxRotationSpeed": 5000 + }, + "entityType": "SelfManagedEntity", + "globalAssetId": ["http://customer.com/demo/asset/1/1/MySubAsset"] + } + }, + "propString": "foo", + "rangeDouble": { + "min": 3, + "max": 5 + } +} From 836e7ca187cdff80ca09fe374a6129242d7d6166 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 17 Jul 2023 17:01:04 +0200 Subject: [PATCH 31/59] Add unit tests for value-only serialization. --- .../aas4j/v3/dataformat/json/JsonSerializer.java | 5 +++++ .../dataformat/json/valueonly/BasicEventSerializer.java | 2 +- .../v3/dataformat/json/valueonly/EntitySerializer.java | 3 ++- .../src/test/resources/valueonly/submodel.json | 9 ++++----- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 7ee80bb9d..c678c8c9e 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.json.JsonMapper; @@ -115,6 +116,10 @@ public String writeReference(Reference reference) throws SerializationException } } + public JsonNode toJson(Reference reference) { + return mapper.valueToTree(reference); + } + @Override public String writeReferences(List references) throws SerializationException { if(references.isEmpty()){ diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java index 6fd85fad8..1fac67336 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java @@ -18,7 +18,7 @@ public class BasicEventSerializer extends AbstractSerializer @Override public JsonNode serialize() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); - node.set("observed", JsonNodeFactory.instance.pojoNode(element.getObserved())); + node.set("observed", serializer.toJson(element.getObserved())); return node; } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java index 855da27e5..6a7fb9ff4 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Entity; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; @@ -43,7 +44,7 @@ public JsonNode serialize() throws ValueOnlySerializationException { } node.set("specificAssetId", assetIdNode); } - node.set("entityType", new TextNode(element.getEntityType().name())); + node.set("entityType", new TextNode(EnumSerializer.serializeEnumName(element.getEntityType().name()))); return node; } } diff --git a/dataformat-json/src/test/resources/valueonly/submodel.json b/dataformat-json/src/test/resources/valueonly/submodel.json index 20140c117..a8c794bee 100644 --- a/dataformat-json/src/test/resources/valueonly/submodel.json +++ b/dataformat-json/src/test/resources/valueonly/submodel.json @@ -6,12 +6,11 @@ "max": 5.0 }, "entity1": { - "statements": - { - "MaxRotationSpeed": 5000 - }, + "statements": [ + 5000 + ], "entityType": "SelfManagedEntity", - "globalAssetId": ["http://customer.com/demo/asset/1/1/MySubAsset"] + "globalAssetId": "Global Asset Id" } }, "propString": "foo", From 7d547d921a300cf3ba924ccdc26e5f3425ce572e Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 17 Jul 2023 17:01:40 +0200 Subject: [PATCH 32/59] Add unit tests for value-only serialization --- .../json/valueonly/AbstractSerializer.java | 2 + .../AnnotatedRelationshipSerializer.java | 4 +- .../valueonly/ReferenceElementSerializer.java | 2 +- .../valueonly/RelationshipSerializer.java | 4 +- .../dataformat/json/valueonly/TestData.java | 59 +++++++++++++++++++ .../ValueOnlyJsonSerializerTest.java | 46 +++++++++++++++ 6 files changed, 112 insertions(+), 5 deletions(-) create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializerTest.java diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java index 241282ba7..41ce1b4b0 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java @@ -1,6 +1,7 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonSerializer; /** * The abstract base class for all value-only serializers. @@ -9,6 +10,7 @@ public abstract class AbstractSerializer { protected T element; protected String idShortPath; + protected static JsonSerializer serializer = new JsonSerializer(); /** * diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java index 182016a2b..4001a5526 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java @@ -23,8 +23,8 @@ public class AnnotatedRelationshipSerializer extends AbstractSerializer annotations = new ArrayList<>(element.getAnnotations()); ElementsListSerializer listSerializer = new ElementsListSerializer( annotations, idShortPath + ".annotations"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java index 6bf76100c..5ff495d7f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java @@ -16,6 +16,6 @@ public class ReferenceElementSerializer extends AbstractSerializer Date: Tue, 18 Jul 2023 11:37:15 +0200 Subject: [PATCH 33/59] Add a copyright header --- .../json/valueonly/AbstractSerializer.java | 16 ++ .../AnnotatedRelationshipSerializer.java | 16 ++ .../json/valueonly/BasicEventSerializer.java | 16 ++ .../json/valueonly/BlobSerializer.java | 17 +- .../ElementsCollectionSerializer.java | 16 ++ .../valueonly/ElementsListSerializer.java | 16 ++ .../json/valueonly/EntitySerializer.java | 16 ++ .../json/valueonly/FileSerializer.java | 16 ++ .../MultiLanguagePropertySerializer.java | 16 ++ .../json/valueonly/PropertySerializer.java | 19 ++- .../json/valueonly/RangeSerializer.java | 16 ++ .../valueonly/ReferenceElementSerializer.java | 17 +- .../valueonly/RelationshipSerializer.java | 16 ++ .../json/valueonly/ValueConverter.java | 16 ++ .../ValueOnlySerializationException.java | 16 ++ .../dataformat/json/valueonly/TestData.java | 151 ++++++++++++++++-- .../ValueOnlyJsonSerializerTest.java | 41 +++-- 17 files changed, 404 insertions(+), 33 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java index 41ce1b4b0..2124d3e5f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java index 4001a5526..5e5828a69 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java index 1fac67336..cf6df90a1 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobSerializer.java index 6b186f33e..363543185 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobSerializer.java @@ -1,6 +1,21 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java index c66e8a434..3ee95f537 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListSerializer.java index f59ac2a05..d1b6b02dc 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListSerializer.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java index 6a7fb9ff4..2e602661c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileSerializer.java index cbd7c170c..1cb2489af 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileSerializer.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertySerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertySerializer.java index 151914e4d..2b474fb88 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertySerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertySerializer.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertySerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertySerializer.java index 78ac83f27..31dbece3a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertySerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertySerializer.java @@ -1,8 +1,23 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.TextNode; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; + import org.eclipse.digitaltwin.aas4j.v3.model.Property; /** diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeSerializer.java index eb1466838..0525ca87b 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeSerializer.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java index 5ff495d7f..97c6373c6 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java @@ -1,7 +1,22 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipSerializer.java index 8afbc16f6..972534f17 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipSerializer.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueConverter.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueConverter.java index 1e7201c1d..ee9f8ccb1 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueConverter.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueConverter.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java index 07dc6694e..51a2a4163 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; /** diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java index 5de542ac5..9f7f2fbb6 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java @@ -1,20 +1,56 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.Blob; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Entity; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; import org.eclipse.digitaltwin.aas4j.v3.model.Range; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; + public class TestData { public static final Entity ENTITY = new DefaultEntity.Builder() .idShort("entity1") @@ -38,22 +74,109 @@ public class TestData { .min("3.0") .max("5.0") .build(); - public static final SubmodelElementCollection ELEMENT_COLLECTION = new DefaultSubmodelElementCollection.Builder() - .idShort("collection1") - .value(PROPERTY_STRING) - .value(RANGE_DOUBLE) - .value(ENTITY) + + public static final Blob BLOB = new DefaultBlob.Builder() + .idShort("blob1") + .contentType("application/octet-stream") + .value("example-data".getBytes()) + .build(); + + + public static final File FILE = new DefaultFile.Builder() + .idShort("file1") + .contentType("application/pdf") + .value("SafetyInstructions.pdf") + .build(); + + public static final MultiLanguageProperty MULTI_LANGUAGE_PROPERTY = new DefaultMultiLanguageProperty.Builder() + .idShort("multiLanguageProp1") + .value(new DefaultLangStringTextType.Builder().text("foo").language("de").build()) + .value(new DefaultLangStringTextType.Builder() .text("bar").language("en").build()) + .build(); + + public static final Property PROPERTY_DOUBLE = new DefaultProperty.Builder() + .category("category") + .idShort("propDouble") + .valueType(DataTypeDefXsd.DOUBLE) + .value("42.17") + .build(); + public static final Property PROPERTY_DATETIME = new DefaultProperty.Builder() + .category("category") + .idShort("propDateTime") + .valueType(DataTypeDefXsd.DATE_TIME) + .value(ZonedDateTime.of(2022, 7, 31, 17, 8, 51, 0, ZoneOffset.UTC).toString()) + .build(); + + public static final Property PROPERTY_INT = new DefaultProperty.Builder() + .category("category") + .idShort("propInt") + .valueType(DataTypeDefXsd.INT) + .value("42") + .build(); + + + public static final Range RANGE_INT = new DefaultRange.Builder() + .idShort("rangeInt") + .valueType(DataTypeDefXsd.INT) + .min("17") + .max("42") + .build(); + + public static final ReferenceElement REFERENCE_ELEMENT_GLOBAL = new DefaultReferenceElement.Builder() + .idShort("referenceGlobal") + .value(new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("global reference key value") + .build()) + .build()) .build(); - public static final Submodel SUBMODEL = new DefaultSubmodel.Builder() - .category("category") - .idShort("submodel1") - .kind(ModellingKind.INSTANCE) - .submodelElements(PROPERTY_STRING) - .submodelElements(RANGE_DOUBLE) - .submodelElements(ELEMENT_COLLECTION) - .submodelElements(new DefaultOperation.Builder() - .idShort("operation1") + public static final ReferenceElement REFERENCE_ELEMENT_MODEL = new DefaultReferenceElement.Builder() + .idShort("referenceModel") + .value(new DefaultReference.Builder() + .type(ReferenceTypes.MODEL_REFERENCE) + .keys(new DefaultKey.Builder() + .type(KeyTypes.PROPERTY) + .value("MaxRotationSpeed") + .build()) + .build()) + .build(); + + public static final AnnotatedRelationshipElement ANNOTATED_RELATIONSHIP_ELEMENT = new DefaultAnnotatedRelationshipElement.Builder() + .idShort("annotatedRelationship1") + .first(REFERENCE_ELEMENT_GLOBAL.getValue()) + .second(REFERENCE_ELEMENT_MODEL.getValue()) + .annotations(new DefaultProperty.Builder() + .idShort("AppliedRule") + .value("TechnicalCurrentFlowDirection") .build()) .build(); + + public static final RelationshipElement RELATIONSHIP_ELEMENT = new DefaultRelationshipElement.Builder() + .idShort("relationship1") + .first(REFERENCE_ELEMENT_GLOBAL.getValue()) + .second(REFERENCE_ELEMENT_MODEL.getValue()) + .build(); + + + public static final SubmodelElementCollection ELEMENT_COLLECTION = new DefaultSubmodelElementCollection.Builder() + .idShort("collection1") + .value(PROPERTY_STRING) + .value(RANGE_DOUBLE) + .value(ENTITY) + .build(); + + public static final Submodel SUBMODEL = new DefaultSubmodel.Builder() + .category("category") + .idShort("submodel1") + .kind(ModellingKind.INSTANCE) + .submodelElements(PROPERTY_STRING) + .submodelElements(RANGE_DOUBLE) + .submodelElements(ELEMENT_COLLECTION) + .submodelElements(new DefaultOperation.Builder() + .idShort("operation1") + .build()) + .build(); + } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializerTest.java index ab48a7a23..de7b12a3d 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializerTest.java @@ -1,7 +1,21 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; import org.json.JSONException; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -10,20 +24,14 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; public class ValueOnlyJsonSerializerTest { - private static ObjectMapper objectMapper = new ObjectMapper(); private static ValueOnlyJsonSerializer serializer = new ValueOnlyJsonSerializer(true); @Test - public void testCreateSerializer() throws IOException { - assertNotNull(serializer); - String valueOnlySubmodel = readValueOnlyFile("submodel.json"); - assertNotNull(valueOnlySubmodel); - JsonNode node = readValueOnlyJson("submodel.json"); - assertNotNull(node); + public void testCreateDefaultSerializer() throws IOException { + assertNotNull(new ValueOnlyJsonSerializer()); } @Test @@ -34,13 +42,16 @@ public void testSerializeSubmodel() throws IOException, ValueOnlySerializationEx JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } + @Test + public void testSerializeEntity() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnlySubmodelString = serializer.write(TestData.ENTITY); + assertNotNull(valueOnlySubmodelString); + String expected = readValueOnlyFile("entity.json"); + JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); + } + private String readValueOnlyFile(String valueOnlyFile) throws IOException { return new String(getClass().getClassLoader().getResourceAsStream( "valueonly/" + valueOnlyFile).readAllBytes(), StandardCharsets.UTF_8); } - - private JsonNode readValueOnlyJson(String valueOnlyFile) throws IOException { - return objectMapper.readTree(getClass().getClassLoader().getResourceAsStream( - "valueonly/" + valueOnlyFile)); - } } From ca4165b8741a2ecd28c593802bc391e76bedb87a Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 18 Jul 2023 15:53:21 +0200 Subject: [PATCH 34/59] Add more tests --- .../ElementsCollectionSerializer.java | 2 +- .../dataformat/json/valueonly/TestData.java | 25 +++++- .../ValueOnlyJsonSerializerTest.java | 79 ++++++++++++++++++- .../valueonly/ann_relationship_element.json | 30 +++++++ .../src/test/resources/valueonly/blob.json | 4 + .../valueonly/date_time_property.json | 1 + .../valueonly/element_collection.json | 35 ++++++++ .../resources/valueonly/element_list.json | 48 +++++++++++ .../src/test/resources/valueonly/entity.json | 5 ++ .../src/test/resources/valueonly/file.json | 4 + .../valueonly/multi_lang_property.json | 4 + .../src/test/resources/valueonly/range.json | 4 + .../valueonly/ref_element_global.json | 18 +++++ .../test/resources/valueonly/submodel.json | 55 +++++++++---- 14 files changed, 290 insertions(+), 24 deletions(-) create mode 100644 dataformat-json/src/test/resources/valueonly/ann_relationship_element.json create mode 100644 dataformat-json/src/test/resources/valueonly/blob.json create mode 100644 dataformat-json/src/test/resources/valueonly/date_time_property.json create mode 100644 dataformat-json/src/test/resources/valueonly/element_collection.json create mode 100644 dataformat-json/src/test/resources/valueonly/element_list.json create mode 100644 dataformat-json/src/test/resources/valueonly/entity.json create mode 100644 dataformat-json/src/test/resources/valueonly/file.json create mode 100644 dataformat-json/src/test/resources/valueonly/multi_lang_property.json create mode 100644 dataformat-json/src/test/resources/valueonly/range.json create mode 100644 dataformat-json/src/test/resources/valueonly/ref_element_global.json diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java index 3ee95f537..0e72c75f2 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java @@ -94,7 +94,7 @@ static JsonNode serialize(SubmodelElement element, String idShortPath) throws Va return new ElementsCollectionSerializer(((SubmodelElementCollection)element).getValue(), idShortPath).serialize(); } if(element instanceof SubmodelElementList) { - return new ElementsListSerializer(((SubmodelElementCollection)element).getValue(), idShortPath).serialize(); + return new ElementsListSerializer(((SubmodelElementList)element).getValue(), idShortPath).serialize(); } if(element instanceof AnnotatedRelationshipElement) { return new AnnotatedRelationshipSerializer((AnnotatedRelationshipElement) element, idShortPath).serialize(); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java index 9f7f2fbb6..5852ec42a 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java @@ -31,6 +31,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; @@ -47,6 +48,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; import java.time.ZoneOffset; import java.time.ZonedDateTime; @@ -114,17 +116,22 @@ public class TestData { .value("42") .build(); - public static final Range RANGE_INT = new DefaultRange.Builder() .idShort("rangeInt") .valueType(DataTypeDefXsd.INT) .min("17") .max("42") .build(); - public static final ReferenceElement REFERENCE_ELEMENT_GLOBAL = new DefaultReferenceElement.Builder() .idShort("referenceGlobal") .value(new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) + .referredSemanticId(new DefaultReference.Builder() + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys(new DefaultKey.Builder() + .type(KeyTypes.CONCEPT_DESCRIPTION) + .value("Concept Description key value") + .build()) + .build()) .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("global reference key value") @@ -151,6 +158,7 @@ public class TestData { .idShort("AppliedRule") .value("TechnicalCurrentFlowDirection") .build()) + .annotations(RANGE_INT) .build(); public static final RelationshipElement RELATIONSHIP_ELEMENT = new DefaultRelationshipElement.Builder() @@ -165,6 +173,15 @@ public class TestData { .value(PROPERTY_STRING) .value(RANGE_DOUBLE) .value(ENTITY) + .value(RELATIONSHIP_ELEMENT) + .build(); + + public static final SubmodelElementList ELEMENT_LIST = new DefaultSubmodelElementList.Builder() + .idShort("list1") + .value(PROPERTY_STRING) + .value(RANGE_DOUBLE) + .value(ENTITY) + .value(ANNOTATED_RELATIONSHIP_ELEMENT) .build(); public static final Submodel SUBMODEL = new DefaultSubmodel.Builder() @@ -175,8 +192,8 @@ public class TestData { .submodelElements(RANGE_DOUBLE) .submodelElements(ELEMENT_COLLECTION) .submodelElements(new DefaultOperation.Builder() - .idShort("operation1") - .build()) + .idShort("operation1") + .build()) .build(); } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializerTest.java index de7b12a3d..12524e18a 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializerTest.java @@ -17,6 +17,7 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import org.json.JSONException; + import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; @@ -24,6 +25,7 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; public class ValueOnlyJsonSerializerTest { @@ -37,7 +39,6 @@ public void testCreateDefaultSerializer() throws IOException { @Test public void testSerializeSubmodel() throws IOException, ValueOnlySerializationException, JSONException { String valueOnlySubmodelString = serializer.write(TestData.SUBMODEL); - assertNotNull(valueOnlySubmodelString); String expected = readValueOnlyFile("submodel.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } @@ -45,11 +46,85 @@ public void testSerializeSubmodel() throws IOException, ValueOnlySerializationEx @Test public void testSerializeEntity() throws IOException, ValueOnlySerializationException, JSONException { String valueOnlySubmodelString = serializer.write(TestData.ENTITY); - assertNotNull(valueOnlySubmodelString); String expected = readValueOnlyFile("entity.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } + @Test + public void testSerializeProperty() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnlySubmodelString = serializer.write(TestData.PROPERTY_INT); + assertEquals("42", valueOnlySubmodelString); + } + + @Test + public void testSerializeRange() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnlySubmodelString = serializer.write(TestData.RANGE_DOUBLE); + String expected = readValueOnlyFile("range.json"); + JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeBlob() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnlySubmodelString = serializer.write(TestData.BLOB); + String expected = readValueOnlyFile("blob.json"); + JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeFile() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnlySubmodelString = serializer.write(TestData.FILE); + String expected = readValueOnlyFile("file.json"); + JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeMultiLangProperty() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnlySubmodelString = serializer.write(TestData.MULTI_LANGUAGE_PROPERTY); + String expected = readValueOnlyFile("multi_lang_property.json"); + JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializePropertyDouble() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnlySubmodelString = serializer.write(TestData.PROPERTY_DOUBLE); + JSONAssert.assertEquals("42.17", valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializePropertyDatetime() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnlySubmodelString = serializer.write(TestData.PROPERTY_DATETIME); + String expected = readValueOnlyFile("date_time_property.json"); + JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeRefElementGlobal() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnlySubmodelString = serializer.write(TestData.REFERENCE_ELEMENT_GLOBAL); + String expected = readValueOnlyFile("ref_element_global.json"); + JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeAnnotatedRelationshipElement() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnlySubmodelString = serializer.write(TestData.ANNOTATED_RELATIONSHIP_ELEMENT); + String expected = readValueOnlyFile("ann_relationship_element.json"); + JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeCollectionElement() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnlySubmodelString = serializer.write(TestData.ELEMENT_COLLECTION); + String expected = readValueOnlyFile("element_collection.json"); + JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeListElement() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnlySubmodelString = serializer.write(TestData.ELEMENT_LIST); + String expected = readValueOnlyFile("element_list.json"); + JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); + } + private String readValueOnlyFile(String valueOnlyFile) throws IOException { return new String(getClass().getClassLoader().getResourceAsStream( "valueonly/" + valueOnlyFile).readAllBytes(), StandardCharsets.UTF_8); diff --git a/dataformat-json/src/test/resources/valueonly/ann_relationship_element.json b/dataformat-json/src/test/resources/valueonly/ann_relationship_element.json new file mode 100644 index 000000000..b68f9fa35 --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/ann_relationship_element.json @@ -0,0 +1,30 @@ +{ + "first" : { + "referredSemanticId" : { + "keys" : [ { + "type" : "ConceptDescription", + "value" : "Concept Description key value" + } ], + "type" : "ExternalReference" + }, + "keys" : [ { + "type" : "GlobalReference", + "value" : "global reference key value" + } ], + "type" : "ExternalReference" + }, + "second" : { + "keys" : [ { + "type" : "Property", + "value" : "MaxRotationSpeed" + } ], + "type" : "ModelReference" + }, + "annotations" : [ + "TechnicalCurrentFlowDirection", + { + "min" : 17, + "max" : 42 + } + ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/blob.json b/dataformat-json/src/test/resources/valueonly/blob.json new file mode 100644 index 000000000..c47688e6f --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/blob.json @@ -0,0 +1,4 @@ +{ + "contentType" : "application/octet-stream", + "value" : "ZXhhbXBsZS1kYXRh" +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/date_time_property.json b/dataformat-json/src/test/resources/valueonly/date_time_property.json new file mode 100644 index 000000000..5d4b426cf --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/date_time_property.json @@ -0,0 +1 @@ +"2022-07-31T17:08:51Z" \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/element_collection.json b/dataformat-json/src/test/resources/valueonly/element_collection.json new file mode 100644 index 000000000..25add3e13 --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/element_collection.json @@ -0,0 +1,35 @@ +{ + "propString" : "foo", + "rangeDouble" : { + "min" : 3.0, + "max" : 5.0 + }, + "entity1" : { + "statements" : [ 5000 ], + "globalAssetId" : "Global Asset Id", + "entityType" : "SelfManagedEntity" + }, + "relationship1" : { + "first" : { + "referredSemanticId" : { + "keys" : [ { + "type" : "ConceptDescription", + "value" : "Concept Description key value" + } ], + "type" : "ExternalReference" + }, + "keys" : [ { + "type" : "GlobalReference", + "value" : "global reference key value" + } ], + "type" : "ExternalReference" + }, + "second" : { + "keys" : [ { + "type" : "Property", + "value" : "MaxRotationSpeed" + } ], + "type" : "ModelReference" + } + } +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/element_list.json b/dataformat-json/src/test/resources/valueonly/element_list.json new file mode 100644 index 000000000..2c1ae1fcc --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/element_list.json @@ -0,0 +1,48 @@ +[ + "foo", + { + "min" : 3.0, + "max" : 5.0 + }, + { + "statements" : [ 5000 ], + "globalAssetId" : "Global Asset Id", + "entityType" : "SelfManagedEntity" + }, + { + "first" : { + "referredSemanticId" : { + "keys" : [ + { + "type" : "ConceptDescription", + "value" : "Concept Description key value" + } + ], + "type" : "ExternalReference" + }, + "keys" : [ + { + "type" : "GlobalReference", + "value" : "global reference key value" + } + ], + "type" : "ExternalReference" + }, + "second" : { + "keys" : [ + { + "type" : "Property", + "value" : "MaxRotationSpeed" + } + ], + "type" : "ModelReference" + }, + "annotations" : [ + "TechnicalCurrentFlowDirection", + { + "min" : 17, + "max" : 42 + } + ] + } +] \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/entity.json b/dataformat-json/src/test/resources/valueonly/entity.json new file mode 100644 index 000000000..20a799db7 --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/entity.json @@ -0,0 +1,5 @@ +{ + "statements" : [ 5000 ], + "globalAssetId" : "Global Asset Id", + "entityType" : "SelfManagedEntity" +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/file.json b/dataformat-json/src/test/resources/valueonly/file.json new file mode 100644 index 000000000..fa87bdd03 --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/file.json @@ -0,0 +1,4 @@ +{ + "contentType" : "application/pdf", + "value" : "SafetyInstructions.pdf" +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/multi_lang_property.json b/dataformat-json/src/test/resources/valueonly/multi_lang_property.json new file mode 100644 index 000000000..b39b3e33f --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/multi_lang_property.json @@ -0,0 +1,4 @@ +{ + "de" : "foo", + "en" : "bar" +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/range.json b/dataformat-json/src/test/resources/valueonly/range.json new file mode 100644 index 000000000..67354262f --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/range.json @@ -0,0 +1,4 @@ +{ + "min" : 3.0, + "max" : 5.0 +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/ref_element_global.json b/dataformat-json/src/test/resources/valueonly/ref_element_global.json new file mode 100644 index 000000000..57cc49811 --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/ref_element_global.json @@ -0,0 +1,18 @@ +{ + "referredSemanticId" : { + "keys" : [ + { + "type" : "ConceptDescription", + "value" : "Concept Description key value" + } + ], + "type" : "ExternalReference" + }, + "keys" : [ + { + "type" : "GlobalReference", + "value" : "global reference key value" + } + ], + "type" : "ExternalReference" +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/submodel.json b/dataformat-json/src/test/resources/valueonly/submodel.json index a8c794bee..da8354cda 100644 --- a/dataformat-json/src/test/resources/valueonly/submodel.json +++ b/dataformat-json/src/test/resources/valueonly/submodel.json @@ -1,21 +1,42 @@ { - "collection1": { - "propString": "foo", - "rangeDouble": { - "min": 3.0, - "max": 5.0 + "propString" : "foo", + "rangeDouble" : { + "min" : 3.0, + "max" : 5.0 + }, + "collection1" : { + "propString" : "foo", + "rangeDouble" : { + "min" : 3.0, + "max" : 5.0 + }, + "entity1" : { + "statements" : [ 5000 ], + "globalAssetId" : "Global Asset Id", + "entityType" : "SelfManagedEntity" }, - "entity1": { - "statements": [ - 5000 - ], - "entityType": "SelfManagedEntity", - "globalAssetId": "Global Asset Id" + "relationship1" : { + "first" : { + "referredSemanticId" : { + "keys" : [ { + "type" : "ConceptDescription", + "value" : "Concept Description key value" + } ], + "type" : "ExternalReference" + }, + "keys" : [ { + "type" : "GlobalReference", + "value" : "global reference key value" + } ], + "type" : "ExternalReference" + }, + "second" : { + "keys" : [ { + "type" : "Property", + "value" : "MaxRotationSpeed" + } ], + "type" : "ModelReference" + } } - }, - "propString": "foo", - "rangeDouble": { - "min": 3, - "max": 5 } -} +} \ No newline at end of file From 1e2f37a004c0d2552f5cafb4c5a0ccacc80f1396 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Wed, 19 Jul 2023 09:53:20 +0200 Subject: [PATCH 35/59] Correct the documentation to make it conformable with maven-javadoc-plugin --- .../v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java index e4509a89d..7a80c5418 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java @@ -26,12 +26,14 @@ * AAS Specification Part 2
    * * Values are only available for: + *
      *
    1. All subtypes of abstract type DataElement
    2. *
    3. SubmodelElementList and SubmodelElementCollection respectively for their included SubmodelElements
    4. *
    5. ReferenceElement
    6. *
    7. RelationshipElement + AnnotatedRelationshipElement
    8. *
    9. Entity
    10. *
    11. BasicEventElement
    12. + *
    */ public class ValueOnlyJsonSerializer { private final boolean prettyString; From 7ee8ca31ccf00aa4dba3f52460a262db1be561bd Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Wed, 19 Jul 2023 10:16:27 +0200 Subject: [PATCH 36/59] Add methods for valueOnly deserialization --- .../valueonly/ValueOnlyJsonSerializer.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java index 7a80c5418..2ba1dcb24 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java @@ -65,6 +65,16 @@ public String write(Submodel submodel) throws ValueOnlySerializationException { return prettyString ? node.toPrettyString() : node.toString(); } + /** + * Update an existing submodel with the given valueOnly. + * @param submodel The submodel to be updated. If you want to prevent the direct modification of the original + * submodel, just use the corresponding copy constructor, when you pass this argument. + * @param valueOnly the valueOnly string. + */ + public void update(Submodel submodel, String valueOnly) { + throw new UnsupportedOperationException("This method is still not implemented."); + } + /** * Serializes a submodel element in value-only JSON format. * @param element the submodel element to be serialized. @@ -76,4 +86,14 @@ public String write(SubmodelElement element) throws ValueOnlySerializationExcept JsonNode node = ElementsCollectionSerializer.serialize(element, "$"); return prettyString ? node.toPrettyString() : node.toString(); } + + /** + * Update an existing submodel element with the given valueOnly. + * @param element The submodel element to be updated. If you want to prevent the direct modification of the original + * submodel element, just use the corresponding copy constructor, when you pass this argument. + * @param valueOnly the valueOnly string. + */ + public SubmodelElement update(SubmodelElement element, String valueOnly) { + throw new UnsupportedOperationException("This method is still not implemented."); + } } From 27f34cb28a4c256fe967d4146665cf868da88688 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Wed, 19 Jul 2023 10:28:02 +0200 Subject: [PATCH 37/59] Rename the serializer classes to mappers, as they will be used for the deserialization too. --- ...actSerializer.java => AbstractMapper.java} | 4 +-- ....java => AnnotatedRelationshipMapper.java} | 6 ++-- ...izer.java => BasicEventElementMapper.java} | 4 +-- .../{BlobSerializer.java => BlobMapper.java} | 4 +-- ...zer.java => ElementsCollectionMapper.java} | 28 +++++++++---------- ...erializer.java => ElementsListMapper.java} | 4 +-- ...ntitySerializer.java => EntityMapper.java} | 6 ++-- .../{FileSerializer.java => FileMapper.java} | 4 +-- ....java => MultiLanguagePropertyMapper.java} | 4 +-- ...rtySerializer.java => PropertyMapper.java} | 4 +-- ...{RangeSerializer.java => RangeMapper.java} | 4 +-- ...lizer.java => ReferenceElementMapper.java} | 4 +-- ...er.java => RelationshipElementMapper.java} | 4 +-- ...onSerializer.java => ValueOnlyMapper.java} | 10 +++---- .../ValueOnlySerializationException.java | 2 +- ...izerTest.java => ValueOnlyMapperTest.java} | 6 ++-- 16 files changed, 49 insertions(+), 49 deletions(-) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{AbstractSerializer.java => AbstractMapper.java} (93%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{AnnotatedRelationshipSerializer.java => AnnotatedRelationshipMapper.java} (88%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{BasicEventSerializer.java => BasicEventElementMapper.java} (91%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{BlobSerializer.java => BlobMapper.java} (95%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{ElementsCollectionSerializer.java => ElementsCollectionMapper.java} (74%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{ElementsListSerializer.java => ElementsListMapper.java} (91%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{EntitySerializer.java => EntityMapper.java} (92%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{FileSerializer.java => FileMapper.java} (95%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{MultiLanguagePropertySerializer.java => MultiLanguagePropertyMapper.java} (92%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{PropertySerializer.java => PropertyMapper.java} (92%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{RangeSerializer.java => RangeMapper.java} (94%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{ReferenceElementSerializer.java => ReferenceElementMapper.java} (88%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{RelationshipSerializer.java => RelationshipElementMapper.java} (91%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{ValueOnlyJsonSerializer.java => ValueOnlyMapper.java} (91%) rename dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{ValueOnlyJsonSerializerTest.java => ValueOnlyMapperTest.java} (97%) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java similarity index 93% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java index 2124d3e5f..9ecf9aae3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java @@ -23,7 +23,7 @@ * The abstract base class for all value-only serializers. * @param The type of the serialized elements. */ -public abstract class AbstractSerializer { +public abstract class AbstractMapper { protected T element; protected String idShortPath; protected static JsonSerializer serializer = new JsonSerializer(); @@ -34,7 +34,7 @@ public abstract class AbstractSerializer { * @param idShortPath the idShort path is a dot separated chain of idShorts, that can be used in case of * troubleshooting. */ - protected AbstractSerializer(T element, String idShortPath) { + protected AbstractMapper(T element, String idShortPath) { this.element = element; this.idShortPath = idShortPath; } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java similarity index 88% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java index 5e5828a69..d03337a78 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java @@ -31,8 +31,8 @@ * ${AnnotatedRelationshipElement/annotations}. The values of the array items are serialized depending on the type of * the annotation data element. */ -public class AnnotatedRelationshipSerializer extends AbstractSerializer { - AnnotatedRelationshipSerializer(AnnotatedRelationshipElement relationship, String idShortPath) { +public class AnnotatedRelationshipMapper extends AbstractMapper { + AnnotatedRelationshipMapper(AnnotatedRelationshipElement relationship, String idShortPath) { super(relationship, idShortPath); } @@ -42,7 +42,7 @@ public JsonNode serialize() throws ValueOnlySerializationException { node.set("first", serializer.toJson(element.getFirst())); node.set("second", serializer.toJson(element.getSecond())); List annotations = new ArrayList<>(element.getAnnotations()); - ElementsListSerializer listSerializer = new ElementsListSerializer( + ElementsListMapper listSerializer = new ElementsListMapper( annotations, idShortPath + ".annotations"); node.set("annotations", listSerializer.serialize()); return node; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java similarity index 91% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java index cf6df90a1..49b2fa7d7 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java @@ -26,8 +26,8 @@ * JSON property. The JSON object contains one JSON property named “observed” with the corresponding value of * ${BasicEventElement/observed} as the standard serialization of the Reference class. */ -public class BasicEventSerializer extends AbstractSerializer { - BasicEventSerializer(BasicEventElement event, String idShortPath) { +public class BasicEventElementMapper extends AbstractMapper { + BasicEventElementMapper(BasicEventElement event, String idShortPath) { super(event, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java similarity index 95% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobSerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java index 363543185..3d4433c78 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java @@ -32,8 +32,8 @@ * type of the target resource into account. Since the receiver knows in advance if a File or a Blob SubmodelElement * shall be manipulated, it can parse the transferred value-only object accordingly as a File or Blob object. */ -class BlobSerializer extends AbstractSerializer { - BlobSerializer(Blob blob, String idShortPath) { +class BlobMapper extends AbstractMapper { + BlobMapper(Blob blob, String idShortPath) { super(blob, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java similarity index 74% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java index 0e72c75f2..e407c738c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java @@ -41,8 +41,8 @@ * the containing JSON property. The elements contained within the struct are serialized according to their respective * type with ${SubmodelElement/idShort} as the name of the containing JSON property. */ -public class ElementsCollectionSerializer extends AbstractSerializer> { - ElementsCollectionSerializer(List elements, String idShortPath) { +public class ElementsCollectionMapper extends AbstractMapper> { + ElementsCollectionMapper(List elements, String idShortPath) { super(elements, idShortPath); } @@ -67,40 +67,40 @@ public JsonNode serialize() throws ValueOnlySerializationException { static JsonNode serialize(SubmodelElement element, String idShortPath) throws ValueOnlySerializationException { if(element instanceof Blob) { - return new BlobSerializer((Blob) element, idShortPath).serialize(); + return new BlobMapper((Blob) element, idShortPath).serialize(); } if(element instanceof File) { - return new FileSerializer((File) element, idShortPath).serialize(); + return new FileMapper((File) element, idShortPath).serialize(); } if(element instanceof MultiLanguageProperty) { - return new MultiLanguagePropertySerializer((MultiLanguageProperty)element, idShortPath).serialize(); + return new MultiLanguagePropertyMapper((MultiLanguageProperty)element, idShortPath).serialize(); } if(element instanceof Property) { - return new PropertySerializer((Property)element, idShortPath).serialize(); + return new PropertyMapper((Property)element, idShortPath).serialize(); } if(element instanceof Range) { - return new RangeSerializer((Range) element, idShortPath).serialize(); + return new RangeMapper((Range) element, idShortPath).serialize(); } if(element instanceof ReferenceElement) { - return new ReferenceElementSerializer((ReferenceElement) element, idShortPath).serialize(); + return new ReferenceElementMapper((ReferenceElement) element, idShortPath).serialize(); } if(element instanceof Entity) { - return new EntitySerializer((Entity) element, idShortPath).serialize(); + return new EntityMapper((Entity) element, idShortPath).serialize(); } if(element instanceof BasicEventElement) { - return new BasicEventSerializer((BasicEventElement) element, idShortPath).serialize(); + return new BasicEventElementMapper((BasicEventElement) element, idShortPath).serialize(); } if(element instanceof SubmodelElementCollection) { - return new ElementsCollectionSerializer(((SubmodelElementCollection)element).getValue(), idShortPath).serialize(); + return new ElementsCollectionMapper(((SubmodelElementCollection)element).getValue(), idShortPath).serialize(); } if(element instanceof SubmodelElementList) { - return new ElementsListSerializer(((SubmodelElementList)element).getValue(), idShortPath).serialize(); + return new ElementsListMapper(((SubmodelElementList)element).getValue(), idShortPath).serialize(); } if(element instanceof AnnotatedRelationshipElement) { - return new AnnotatedRelationshipSerializer((AnnotatedRelationshipElement) element, idShortPath).serialize(); + return new AnnotatedRelationshipMapper((AnnotatedRelationshipElement) element, idShortPath).serialize(); } if(element instanceof RelationshipElement) { - return new RelationshipSerializer((RelationshipElement) element, idShortPath).serialize(); + return new RelationshipElementMapper((RelationshipElement) element, idShortPath).serialize(); } // This type of submodel element should not be serialized. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java similarity index 91% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListSerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java index d1b6b02dc..8a9359eb2 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java @@ -28,8 +28,8 @@ * SubmodelElementList is serialized as a JSON array with the index of the contained SubmodelElement in the list as the * position in the JSON array. The elements contained within the list are serialized according to their respective type. */ -public class ElementsListSerializer extends ElementsCollectionSerializer { - ElementsListSerializer(List elements, String idShortPath) { +public class ElementsListMapper extends ElementsCollectionMapper { + ElementsListMapper(List elements, String idShortPath) { super(elements, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java similarity index 92% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java index 2e602661c..d7114daa3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntitySerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java @@ -36,9 +36,9 @@ * JSON key and “value” for the JSON value. The third property is named “entityType” and contains a string * representation of ${Entity/entityType}. */ -public class EntitySerializer extends AbstractSerializer { +public class EntityMapper extends AbstractMapper { - EntitySerializer(Entity entity, String idShortPath) { + EntityMapper(Entity entity, String idShortPath) { super(entity, idShortPath); } @@ -46,7 +46,7 @@ public class EntitySerializer extends AbstractSerializer { public JsonNode serialize() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); List elements = element.getStatements(); - ElementsListSerializer ecSerializer = new ElementsListSerializer(elements, idShortPath + ".statements"); + ElementsListMapper ecSerializer = new ElementsListMapper(elements, idShortPath + ".statements"); node.set("statements", ecSerializer.serialize()); String globalAssetId = element.getGlobalAssetId(); if(globalAssetId != null) { diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java similarity index 95% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileSerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java index 1cb2489af..5db1fd606 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java @@ -30,9 +30,9 @@ * type of the target resource into account. Since the receiver knows in advance if a File or a Blob SubmodelElement * shall be manipulated, it can parse the transferred value-only object accordingly as a File or Blob object. */ -class FileSerializer extends AbstractSerializer { +class FileMapper extends AbstractMapper { - FileSerializer(File file, String idShortPath) { + FileMapper(File file, String idShortPath) { super(file, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertySerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java similarity index 92% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertySerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java index 2b474fb88..256fc922f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertySerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java @@ -32,9 +32,9 @@ * MultiLanguageProperty with the language as name and the corresponding localized string as value of the respective * JSON property. The language name is defined as two chars according to ISO 639-1. */ -public class MultiLanguagePropertySerializer extends AbstractSerializer { +public class MultiLanguagePropertyMapper extends AbstractMapper { - MultiLanguagePropertySerializer(MultiLanguageProperty property, String idShortPath) { + MultiLanguagePropertyMapper(MultiLanguageProperty property, String idShortPath) { super(property, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertySerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java similarity index 92% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertySerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java index 31dbece3a..62135a29f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertySerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java @@ -25,8 +25,8 @@ * of the respective property’s value in accordance with the data type to value mapping. * @see ValueConverter */ -public class PropertySerializer extends AbstractSerializer { - PropertySerializer(Property property, String idShortPath) { +public class PropertyMapper extends AbstractMapper { + PropertyMapper(Property property, String idShortPath) { super(property, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java similarity index 94% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeSerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java index 0525ca87b..085194897 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java @@ -28,8 +28,8 @@ * object contains two JSON properties. The first is named "min". The second is named "max". Their corresponding values * are ${Range/min} and ${Range/max}. */ -public class RangeSerializer extends AbstractSerializer { - RangeSerializer(Range range, String idShortPath) { +public class RangeMapper extends AbstractMapper { + RangeMapper(Range range, String idShortPath) { super(range, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java similarity index 88% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java index 97c6373c6..ceeb77a56 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java @@ -24,8 +24,8 @@ * ReferenceElement is serialized as ${ReferenceElement/idShort}: ${ReferenceElement/value} where * ${ReferenceElement/value} is the serialization of the Reference class. */ -public class ReferenceElementSerializer extends AbstractSerializer { - ReferenceElementSerializer(ReferenceElement element, String idShortPath) { +public class ReferenceElementMapper extends AbstractMapper { + ReferenceElementMapper(ReferenceElement element, String idShortPath) { super(element, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java similarity index 91% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipSerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java index 972534f17..46dc34a91 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java @@ -28,8 +28,8 @@ * named "second". Their corresponding values are ${RelationshipElement/first} resp. ${Relationship/second}. The values * are serialized according to the serialization of a Reference. */ -public class RelationshipSerializer extends AbstractSerializer { - RelationshipSerializer(RelationshipElement relationship, String idShortPath) { +public class RelationshipElementMapper extends AbstractMapper { + RelationshipElementMapper(RelationshipElement relationship, String idShortPath) { super(relationship, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java similarity index 91% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java index 2ba1dcb24..db01b02f0 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java @@ -35,14 +35,14 @@ *
  • BasicEventElement
  • * */ -public class ValueOnlyJsonSerializer { +public class ValueOnlyMapper { private final boolean prettyString; /** * The default constructor creates a value-only serializer which serializes submodels and submodel elements to a * compact string. */ - public ValueOnlyJsonSerializer() { + public ValueOnlyMapper() { this(false); } @@ -50,7 +50,7 @@ public ValueOnlyJsonSerializer() { * Creates a value-only serializer. * @param prettyString pass true, if you want to have a pretty formatted strings. */ - public ValueOnlyJsonSerializer(boolean prettyString) { + public ValueOnlyMapper(boolean prettyString) { this.prettyString = prettyString; } @@ -60,7 +60,7 @@ public ValueOnlyJsonSerializer(boolean prettyString) { * @return the corresponding value-only JSON string. */ public String write(Submodel submodel) throws ValueOnlySerializationException { - ElementsCollectionSerializer serializer = new ElementsCollectionSerializer(submodel.getSubmodelElements(), "$"); + ElementsCollectionMapper serializer = new ElementsCollectionMapper(submodel.getSubmodelElements(), "$"); JsonNode node = serializer.serialize(); return prettyString ? node.toPrettyString() : node.toString(); } @@ -83,7 +83,7 @@ public void update(Submodel submodel, String valueOnly) { * @return */ public String write(SubmodelElement element) throws ValueOnlySerializationException { - JsonNode node = ElementsCollectionSerializer.serialize(element, "$"); + JsonNode node = ElementsCollectionMapper.serialize(element, "$"); return prettyString ? node.toPrettyString() : node.toString(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java index 51a2a4163..dbb8e8706 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java @@ -17,7 +17,7 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; /** - * This exception is thrown during the value-only serialization. + * This exception is thrown during the value-only serialization or deserialization. */ public class ValueOnlySerializationException extends Exception { public ValueOnlySerializationException(String msg) { diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java similarity index 97% rename from dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializerTest.java rename to dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java index 12524e18a..22da643d8 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyJsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java @@ -28,12 +28,12 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -public class ValueOnlyJsonSerializerTest { - private static ValueOnlyJsonSerializer serializer = new ValueOnlyJsonSerializer(true); +public class ValueOnlyMapperTest { + private static ValueOnlyMapper serializer = new ValueOnlyMapper(true); @Test public void testCreateDefaultSerializer() throws IOException { - assertNotNull(new ValueOnlyJsonSerializer()); + assertNotNull(new ValueOnlyMapper()); } @Test From adb704064f12e234de947628752e0d5f540c1abd Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Wed, 19 Jul 2023 10:43:31 +0200 Subject: [PATCH 38/59] Extract the method createMapper --- .../valueonly/ElementsCollectionMapper.java | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java index e407c738c..5bb2efc84 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java @@ -66,44 +66,47 @@ public JsonNode serialize() throws ValueOnlySerializationException { } static JsonNode serialize(SubmodelElement element, String idShortPath) throws ValueOnlySerializationException { + AbstractMapper mapper = createMapper(element, idShortPath); + return mapper == null ? NullNode.instance : mapper.serialize(); + } + + private static AbstractMapper createMapper(SubmodelElement element, String idShortPath) { if(element instanceof Blob) { - return new BlobMapper((Blob) element, idShortPath).serialize(); + return new BlobMapper((Blob) element, idShortPath); } if(element instanceof File) { - return new FileMapper((File) element, idShortPath).serialize(); + return new FileMapper((File) element, idShortPath); } if(element instanceof MultiLanguageProperty) { - return new MultiLanguagePropertyMapper((MultiLanguageProperty)element, idShortPath).serialize(); + return new MultiLanguagePropertyMapper((MultiLanguageProperty)element, idShortPath); } if(element instanceof Property) { - return new PropertyMapper((Property)element, idShortPath).serialize(); + return new PropertyMapper((Property)element, idShortPath); } if(element instanceof Range) { - return new RangeMapper((Range) element, idShortPath).serialize(); + return new RangeMapper((Range) element, idShortPath); } if(element instanceof ReferenceElement) { - return new ReferenceElementMapper((ReferenceElement) element, idShortPath).serialize(); + return new ReferenceElementMapper((ReferenceElement) element, idShortPath); } if(element instanceof Entity) { - return new EntityMapper((Entity) element, idShortPath).serialize(); + return new EntityMapper((Entity) element, idShortPath); } if(element instanceof BasicEventElement) { - return new BasicEventElementMapper((BasicEventElement) element, idShortPath).serialize(); + return new BasicEventElementMapper((BasicEventElement) element, idShortPath); } if(element instanceof SubmodelElementCollection) { - return new ElementsCollectionMapper(((SubmodelElementCollection)element).getValue(), idShortPath).serialize(); + return new ElementsCollectionMapper(((SubmodelElementCollection)element).getValue(), idShortPath); } if(element instanceof SubmodelElementList) { - return new ElementsListMapper(((SubmodelElementList)element).getValue(), idShortPath).serialize(); + return new ElementsListMapper(((SubmodelElementList)element).getValue(), idShortPath); } if(element instanceof AnnotatedRelationshipElement) { - return new AnnotatedRelationshipMapper((AnnotatedRelationshipElement) element, idShortPath).serialize(); + return new AnnotatedRelationshipMapper((AnnotatedRelationshipElement) element, idShortPath); } if(element instanceof RelationshipElement) { - return new RelationshipElementMapper((RelationshipElement) element, idShortPath).serialize(); + return new RelationshipElementMapper((RelationshipElement) element, idShortPath); } - - // This type of submodel element should not be serialized. - return NullNode.instance; + return null; } } From 41609d2106f8085b952c17a72d1f4f06aa403352 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Wed, 19 Jul 2023 13:53:59 +0200 Subject: [PATCH 39/59] Revert the changes in the JsonSerializer --- .../digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index c678c8c9e..b3df48fe3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -116,10 +116,6 @@ public String writeReference(Reference reference) throws SerializationException } } - public JsonNode toJson(Reference reference) { - return mapper.valueToTree(reference); - } - @Override public String writeReferences(List references) throws SerializationException { if(references.isEmpty()){ From e06ebe946789db88925981c3bd9b3977f0a58aa3 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 20 Jul 2023 09:35:23 +0200 Subject: [PATCH 40/59] Implement the deserialization --- .../json/valueonly/AbstractMapper.java | 19 ++-- .../AnnotatedRelationshipMapper.java | 36 ++++++-- .../valueonly/BasicEventElementMapper.java | 13 ++- .../dataformat/json/valueonly/BlobMapper.java | 32 ++++++- .../valueonly/ElementsCollectionMapper.java | 53 ++++++++--- .../json/valueonly/ElementsListMapper.java | 29 ++++++- .../json/valueonly/EntityMapper.java | 83 ++++++++++++++++-- .../dataformat/json/valueonly/FileMapper.java | 33 ++++++- .../MultiLanguagePropertyMapper.java | 28 +++++- .../json/valueonly/PropertyMapper.java | 27 +++++- .../json/valueonly/RangeMapper.java | 10 ++- .../valueonly/ReferenceElementMapper.java | 9 +- .../valueonly/RelationshipElementMapper.java | 18 +++- .../json/valueonly/ValueOnlyMapper.java | 87 ++++++++++++++----- .../ValueOnlySerializationException.java | 9 +- .../json/valueonly/ValueOnlyMapperTest.java | 26 +++--- 16 files changed, 426 insertions(+), 86 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java index 9ecf9aae3..e6e325515 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java @@ -17,16 +17,14 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonSerializer; /** * The abstract base class for all value-only serializers. * @param The type of the serialized elements. */ public abstract class AbstractMapper { - protected T element; - protected String idShortPath; - protected static JsonSerializer serializer = new JsonSerializer(); + protected final T element; + protected final String idShortPath; /** * @@ -40,9 +38,18 @@ protected AbstractMapper(T element, String idShortPath) { } /** - * This method serializes the corresponding element. + * This method converts the corresponding element to a value-only JSON node. * @return the corresponding JSON node. * @throws ValueOnlySerializationException with information about the idShort path. */ - public abstract JsonNode serialize() throws ValueOnlySerializationException; + abstract JsonNode toJson() throws ValueOnlySerializationException; + + /** + * Updates the corresponding element according the passed valueOnly JSON node. + * @param valueOnly the value only JSON node. + * @throws ValueOnlySerializationException with information about the idShort path. + *
    Note:The update is not an atomic operation and if an exception is thrown, the corresponding element + * will be in an inconsistent state. If you cannot handle such situations, pass a copy of the original element. + */ + abstract void update(JsonNode valueOnly) throws ValueOnlySerializationException; } \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java index d03337a78..2e31beedb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java @@ -20,11 +20,14 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.ArrayList; import java.util.List; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.serializer; + /** * AnnotatedRelationshipElement is serialized according to the serialization of a ReleationshipElement. Additionally, a * third named JSON object is introduced with "annotations" as the name of the containing JSON property. The value is @@ -32,19 +35,40 @@ * the annotation data element. */ public class AnnotatedRelationshipMapper extends AbstractMapper { + private static final String FIRST = "first"; + private static final String SECOND = "second"; + private static final String ANNOTATIONS = "annotations"; AnnotatedRelationshipMapper(AnnotatedRelationshipElement relationship, String idShortPath) { super(relationship, idShortPath); } @Override - public JsonNode serialize() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); - node.set("first", serializer.toJson(element.getFirst())); - node.set("second", serializer.toJson(element.getSecond())); + node.set(FIRST, serializer.toJson(element.getFirst())); + node.set(SECOND, serializer.toJson(element.getSecond())); List annotations = new ArrayList<>(element.getAnnotations()); - ElementsListMapper listSerializer = new ElementsListMapper( - annotations, idShortPath + ".annotations"); - node.set("annotations", listSerializer.serialize()); + if(annotations.size() > 0) { + ElementsListMapper listMapper = new ElementsListMapper( + annotations, idShortPath + "." + ANNOTATIONS); + node.set(ANNOTATIONS, listMapper.toJson()); + } return node; } + + @Override + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + element.setFirst(serializer.parseReference(valueOnly.get(FIRST), idShortPath)); + element.setSecond(serializer.parseReference(valueOnly.get(SECOND), idShortPath)); + + JsonNode annotationsNode = valueOnly.get(ANNOTATIONS); + if(annotationsNode == null || annotationsNode.isNull()) { + element.getAnnotations().clear(); + } else { + List annotations = new ArrayList<>(element.getAnnotations()); + ElementsListMapper listMapper = new ElementsListMapper( + annotations, idShortPath + "." + ANNOTATIONS); + listMapper.update(annotationsNode); + } + } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java index 49b2fa7d7..a1eb1f287 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java @@ -21,20 +21,29 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.serializer; + /** * BasicEventElement is serialized as named JSON object with ${BasicEventElement/idShort} as the name of the containing * JSON property. The JSON object contains one JSON property named “observed” with the corresponding value of * ${BasicEventElement/observed} as the standard serialization of the Reference class. */ public class BasicEventElementMapper extends AbstractMapper { + private static final String OBSERVED = "observed"; + BasicEventElementMapper(BasicEventElement event, String idShortPath) { super(event, idShortPath); } @Override - public JsonNode serialize() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); - node.set("observed", serializer.toJson(element.getObserved())); + node.set(OBSERVED, serializer.toJson(element.getObserved())); return node; } + + @Override + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + element.setObserved(serializer.parseReference(valueOnly.get(OBSERVED), idShortPath)); + } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java index 3d4433c78..17f6c29bd 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java @@ -33,15 +33,41 @@ * shall be manipulated, it can parse the transferred value-only object accordingly as a File or Blob object. */ class BlobMapper extends AbstractMapper { + private static final String CONTENT_TYPE = "contentType"; + private static final String VALUE = "value"; + BlobMapper(Blob blob, String idShortPath) { super(blob, idShortPath); } @Override - public JsonNode serialize() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); - node.set("contentType", new TextNode(element.getContentType())); - node.set("value", new TextNode(Base64.getEncoder().encodeToString(element.getValue()))); + node.set(CONTENT_TYPE, new TextNode(element.getContentType())); + node.set(VALUE, new TextNode(Base64.getEncoder().encodeToString(element.getValue()))); return node; } + + @Override + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + JsonNode contentNode = valueOnly.get(CONTENT_TYPE); + if(contentNode == null || contentNode.isNull()) { + element.setContentType(null); + } else if(contentNode.isTextual()) { + element.setContentType(contentNode.asText()); + } else { + throw new ValueOnlySerializationException( + "Invalid Blob contentType at idShort path '" + idShortPath + "'.", idShortPath); + } + + JsonNode valueNode = valueOnly.get(VALUE); + if(valueNode == null || valueNode.isNull()) { + element.setValue(null); + } else if(contentNode.isTextual()) { + element.setValue(Base64.getDecoder().decode(valueNode.asText())); + } else { + throw new ValueOnlySerializationException( + "Invalid Blob value at idShort path '" + idShortPath + "'.", idShortPath); + } + } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java index 5bb2efc84..b16e9c14e 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.NullNode; import com.fasterxml.jackson.databind.node.ObjectNode; import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; @@ -34,6 +33,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; +import java.util.Iterator; import java.util.List; /** @@ -47,30 +47,47 @@ public class ElementsCollectionMapper extends AbstractMapper it = objNode.fieldNames(); it.hasNext(); ) { + String idShort = it.next(); + SubmodelElement submodelElement = findElementByIdShort(idShort); + AbstractMapper mapper = createMapper(submodelElement, idShortPath + "." + idShort); + mapper.update(objNode.get(idShort)); + } } - private static AbstractMapper createMapper(SubmodelElement element, String idShortPath) { + /** + * Creates the corresponding mapper. + * @param element the submodel element. + * @param idShortPath the idShort path. + * @return the corresponding mapper or null if this type cannot be serialized to value-only JSON string. + */ + static AbstractMapper createMapper(SubmodelElement element, String idShortPath) { if(element instanceof Blob) { return new BlobMapper((Blob) element, idShortPath); } @@ -109,4 +126,14 @@ private static AbstractMapper createMapper(SubmodelElement element, String idSho } return null; } + + private SubmodelElement findElementByIdShort(String idShort) throws ValueOnlySerializationException { + for (SubmodelElement submodelElement : element) { + if(idShort.equals(submodelElement.getIdShort())) { + return submodelElement; + } + } + throw new ValueOnlySerializationException("Cannot find submodel element with idShort '" + idShort + + "' at idShort path '" + idShortPath + "'.", idShortPath); + } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java index 8a9359eb2..4ce72eab3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java @@ -20,8 +20,12 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.NullNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import java.util.ArrayDeque; +import java.util.Iterator; import java.util.List; /** @@ -34,12 +38,33 @@ public class ElementsListMapper extends ElementsCollectionMapper { } @Override - public JsonNode serialize() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ArrayNode arrayNode = JsonNodeFactory.instance.arrayNode(); for(int i = 0; i < element.size(); i++) { SubmodelElement submodelElement = element.get(i); - arrayNode.add(serialize(submodelElement, idShortPath + "[" + i + "]")); + AbstractMapper mapper = createMapper(submodelElement, idShortPath + "[" + i + "]"); + arrayNode.add(mapper == null ? NullNode.instance : mapper.toJson()); } return arrayNode; } + + @Override + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + if(!valueOnly.isArray()) { + throw new ValueOnlySerializationException( + "Cannot update the submodel elements list at idShort path '" + idShortPath + + "', as the corresponding value-only is not a JSON array.", idShortPath); + } + ArrayNode arrayNode = (ArrayNode) valueOnly; + if(arrayNode.size() != element.size()) { + throw new ValueOnlySerializationException( + "Cannot update the submodel elements list at idShort path '" + idShortPath + + "', as the corresponding value-only array has different size.", idShortPath); + } + for (int i = 0; i < arrayNode.size(); i++ ) { + SubmodelElement submodelElement = element.get(i); + AbstractMapper mapper = createMapper(submodelElement, idShortPath + "[" + i + "]"); + mapper.update(arrayNode.get(i)); + } + } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java index d7114daa3..1577eefc4 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java @@ -20,11 +20,14 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Entity; +import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import java.util.Iterator; import java.util.List; /** @@ -37,20 +40,24 @@ * representation of ${Entity/entityType}. */ public class EntityMapper extends AbstractMapper { + private static final String STATEMENTS = "statements"; + private static final String GLOBAL_ASSET_ID = "globalAssetId"; + private static final String SPECIFIC_ASSET_ID = "specificAssetId"; + private static final String ENTITY_TYPE = "entityType"; EntityMapper(Entity entity, String idShortPath) { super(entity, idShortPath); } @Override - public JsonNode serialize() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); - List elements = element.getStatements(); - ElementsListMapper ecSerializer = new ElementsListMapper(elements, idShortPath + ".statements"); - node.set("statements", ecSerializer.serialize()); + ElementsListMapper statementsMapper = new ElementsListMapper( + element.getStatements(), idShortPath + "." + STATEMENTS); + node.set(STATEMENTS, statementsMapper.toJson()); String globalAssetId = element.getGlobalAssetId(); if(globalAssetId != null) { - node.set("globalAssetId", new TextNode(globalAssetId)); + node.set(GLOBAL_ASSET_ID, new TextNode(globalAssetId)); } List specificAssetIds = element.getSpecificAssetIds(); if(specificAssetIds != null && specificAssetIds.size() > 0) { @@ -58,9 +65,71 @@ public JsonNode serialize() throws ValueOnlySerializationException { for (SpecificAssetId assetId : specificAssetIds) { assetIdNode.set(assetId.getValue(), new TextNode(assetId.getName())); } - node.set("specificAssetId", assetIdNode); + node.set(SPECIFIC_ASSET_ID, assetIdNode); } - node.set("entityType", new TextNode(EnumSerializer.serializeEnumName(element.getEntityType().name()))); + node.set(ENTITY_TYPE, new TextNode(EnumSerializer.serializeEnumName(element.getEntityType().name()))); return node; } + + @Override + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + JsonNode statementsNode = valueOnly.get(STATEMENTS); + if(statementsNode == null) { + element.getStatements().clear(); + } else { + ElementsListMapper statementsMapper = new ElementsListMapper( + element.getStatements(), idShortPath + "." + STATEMENTS); + statementsMapper.update(statementsNode); + } + JsonNode globalAssetIdNode = valueOnly.get(GLOBAL_ASSET_ID); + if(globalAssetIdNode == null || globalAssetIdNode.isNull()) { + element.setGlobalAssetId(null); + } else if(globalAssetIdNode.isTextual()) { + element.setGlobalAssetId(globalAssetIdNode.asText()); + } else { + throw new ValueOnlySerializationException("Cannot update the Entity at idShort path '" + + idShortPath + "', as the passed " + GLOBAL_ASSET_ID + " is not a string.", idShortPath); + } + JsonNode specificAssetIdNode = valueOnly.get(SPECIFIC_ASSET_ID); + if(specificAssetIdNode != null) { + List specificAssetIds = element.getSpecificAssetIds(); + if(!specificAssetIdNode.isObject()) { + throw new ValueOnlySerializationException("Cannot update the Entity at idShort path '" + + idShortPath + "' as the passed " + SPECIFIC_ASSET_ID + " is not an object.", idShortPath); + } + updateSpecificAssetIds(element.getSpecificAssetIds(), (ObjectNode) specificAssetIdNode); + } + JsonNode entityTypeNode = valueOnly.get(ENTITY_TYPE); + if(entityTypeNode == null || !entityTypeNode.isTextual()) { + throw new ValueOnlySerializationException("Cannot update the Entity at idShort path '" + + idShortPath + "' as its type is not set as string property '" + ENTITY_TYPE + "'.", idShortPath); + } + element.setEntityType(EntityType.valueOf(EnumDeserializer.deserializeEnumName(entityTypeNode.textValue()))); + } + + private void updateSpecificAssetIds(List specificAssetIds, ObjectNode objNode) + throws ValueOnlySerializationException { + for (Iterator it = objNode.fieldNames(); it.hasNext(); ) { + String name = it.next(); + SpecificAssetId specificAssetId = findSpecificAssetIdByName(specificAssetIds, name); + JsonNode valueNode = objNode.get(name); + if(!valueNode.isTextual()) { + throw new ValueOnlySerializationException("Cannot update the SpecificAssetId at IdShort path '" + + idShortPath + "." + SPECIFIC_ASSET_ID + "." + name + "' as its value is not set as string property.", + idShortPath); + } + specificAssetId.setValue(valueNode.textValue()); + } + } + + private SpecificAssetId findSpecificAssetIdByName(List specificAssetIds, String name) + throws ValueOnlySerializationException { + for (SpecificAssetId saId : specificAssetIds) { + if(name.equals(saId.getName())) { + return saId; + } + } + throw new ValueOnlySerializationException( + "Cannot find the SpecificAssetId with name '" + name + "'.", idShortPath + "." + SPECIFIC_ASSET_ID); + } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java index 5db1fd606..c2934ee41 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java @@ -22,6 +22,8 @@ import com.fasterxml.jackson.databind.node.TextNode; import org.eclipse.digitaltwin.aas4j.v3.model.File; +import java.util.Base64; + /** * File is serialized as named JSON object with ${File/idShort} as the name of the containing JSON property. The JSON * object contains two JSON properties. The first refers to the content type named "contentType" and value @@ -31,16 +33,41 @@ * shall be manipulated, it can parse the transferred value-only object accordingly as a File or Blob object. */ class FileMapper extends AbstractMapper { + private static final String CONTENT_TYPE = "contentType"; + private static final String VALUE = "value"; FileMapper(File file, String idShortPath) { super(file, idShortPath); } @Override - public JsonNode serialize() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); - node.set("contentType", new TextNode(element.getContentType())); - node.set("value", new TextNode(element.getValue())); + node.set(CONTENT_TYPE, new TextNode(element.getContentType())); + node.set(VALUE, new TextNode(element.getValue())); return node; } + + @Override + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + JsonNode contentNode = valueOnly.get(CONTENT_TYPE); + if(contentNode == null || contentNode.isNull()) { + element.setContentType(null); + } else if(contentNode.isTextual()) { + element.setContentType(contentNode.textValue()); + } else { + throw new ValueOnlySerializationException( + "Invalid File " + CONTENT_TYPE + " at idShort path '" + idShortPath + "'.", idShortPath); + } + + JsonNode valueNode = valueOnly.get(VALUE); + if(valueNode == null || valueNode.isNull()) { + element.setValue(null); + } else if(contentNode.isTextual()) { + element.setValue(valueNode.textValue()); + } else { + throw new ValueOnlySerializationException( + "Invalid File " + VALUE + " at idShort path '" + idShortPath + "'.", idShortPath); + } + } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java index 256fc922f..1ad32c612 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java @@ -23,7 +23,10 @@ import com.fasterxml.jackson.databind.node.TextNode; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import javax.naming.OperationNotSupportedException; +import java.util.Iterator; import java.util.List; /** @@ -39,7 +42,7 @@ public class MultiLanguagePropertyMapper extends AbstractMapper langTexts = element.getValue(); if(langTexts == null || langTexts.size() == 0) { return NullNode.instance; @@ -50,4 +53,27 @@ public JsonNode serialize() throws ValueOnlySerializationException { } return node; } + + @Override + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + if(!valueOnly.isObject()) { + throw new ValueOnlySerializationException( + "Cannot update the multi-language property at idShort path '" + idShortPath + + "' as the passed value-only is not a JSON object.", idShortPath); + } + ObjectNode propNode = (ObjectNode)valueOnly; + List value = element.getValue(); + value.clear(); + for (Iterator it = propNode.fieldNames(); it.hasNext(); ) { + String language = it.next(); + JsonNode textNode = propNode.get(language); + if(!textNode.isTextual()) { + String fullPath = idShortPath + "." + language; + throw new ValueOnlySerializationException( + "Cannot update the multi-language property at idShort path '" + fullPath + + "' as the passed value is not a string.", idShortPath); + } + value.add(new DefaultLangStringTextType.Builder().language(language).text(textNode.textValue()).build()); + } + } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java index 62135a29f..8ae66af35 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java @@ -31,12 +31,35 @@ public class PropertyMapper extends AbstractMapper { } @Override - public JsonNode serialize() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { try { return ValueConverter.convert(element.getValueType(), element.getValue()); } catch (NumberFormatException ex) { throw new ValueOnlySerializationException("Cannot serialize the property with idShort path '" + - idShortPath + "': " + ex.getMessage()); + idShortPath + "': " + ex.getMessage(), idShortPath); } } + + @Override + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + element.setValue(readValueAsString("Cannot update the property", idShortPath, valueOnly)); + } + + static String readValueAsString(String msg, String idShortPath, JsonNode valueOnly) + throws ValueOnlySerializationException { + if(valueOnly == null || valueOnly.isNull()) { + return null; + } + if(valueOnly.isObject()) { + throw new ValueOnlySerializationException( + msg + " at idShort path '" + idShortPath + + "', as the passed value is a JSON object.", idShortPath); + } + if(valueOnly.isArray()) { + throw new ValueOnlySerializationException( + msg + " at idShort path '" + idShortPath + + "', as the passed value is a JSON array.", idShortPath); + } + return valueOnly.asText(); + } } \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java index 085194897..e25dc8edf 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java @@ -34,7 +34,7 @@ public class RangeMapper extends AbstractMapper { } @Override - public JsonNode serialize() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { try { ObjectNode node = JsonNodeFactory.instance.objectNode(); DataTypeDefXsd valueType = element.getValueType(); @@ -43,7 +43,13 @@ public JsonNode serialize() throws ValueOnlySerializationException { return node; } catch (NumberFormatException ex) { throw new ValueOnlySerializationException("Cannot serialize the range with idShort path '" + - idShortPath + "': " + ex.getMessage()); + idShortPath + "': " + ex.getMessage(), idShortPath); } } + + @Override + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + element.setMax(PropertyMapper.readValueAsString("Cannot update Range.max", idShortPath, valueOnly.get("max"))); + element.setMin(PropertyMapper.readValueAsString("Cannot update Range.min", idShortPath, valueOnly.get("min"))); + } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java index ceeb77a56..c065a1612 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java @@ -20,6 +20,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.serializer; + /** * ReferenceElement is serialized as ${ReferenceElement/idShort}: ${ReferenceElement/value} where * ${ReferenceElement/value} is the serialization of the Reference class. @@ -30,7 +32,12 @@ public class ReferenceElementMapper extends AbstractMapper { } @Override - public JsonNode serialize() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { return serializer.toJson(element.getValue()); } + + @Override + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + element.setValue(serializer.parseReference(valueOnly, idShortPath)); + } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java index 46dc34a91..b1dcf4a4e 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java @@ -20,8 +20,11 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; +import org.eclipse.digitaltwin.aas4j.v3.model.File; import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.serializer; + /** * RelationshipElement is serialized as named JSON object with ${RelationshipElement/idShort} as the name of the * containing JSON property. The JSON object contains two JSON properties. The first is named "first". The second is @@ -29,15 +32,24 @@ * are serialized according to the serialization of a Reference. */ public class RelationshipElementMapper extends AbstractMapper { + public static final String FIRST = "first"; + public static final String SECOND = "second"; + RelationshipElementMapper(RelationshipElement relationship, String idShortPath) { super(relationship, idShortPath); } @Override - public JsonNode serialize() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); - node.set("first", serializer.toJson(element.getFirst())); - node.set("second", serializer.toJson(element.getSecond())); + node.set(FIRST, serializer.toJson(element.getFirst())); + node.set(SECOND, serializer.toJson(element.getSecond())); return node; } + + @Override + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + element.setFirst(serializer.parseReference(valueOnly.get(FIRST), idShortPath + "." + FIRST)); + element.setSecond(serializer.parseReference(valueOnly.get(SECOND), idShortPath + "." + SECOND)); + } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java index db01b02f0..59e657d4d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java @@ -16,7 +16,11 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; @@ -36,19 +40,46 @@ * */ public class ValueOnlyMapper { + static class ValueOnlySerializer extends JsonSerializer { + JsonNode toJson(Reference reference) { + return mapper.valueToTree(reference); + } + JsonNode readTree(String jsonString) throws ValueOnlySerializationException { + try { + return mapper.readTree(jsonString); + } catch (JsonProcessingException e) { + throw new ValueOnlySerializationException("Cannot parse the value only string: ", e, "$"); + } + } + + Reference parseReference(JsonNode refNode, String idShortPath) throws ValueOnlySerializationException { + if(refNode == null) { + return null; + } + try { + return mapper.treeToValue(refNode, Reference.class); + } catch (JsonProcessingException e) { + throw new ValueOnlySerializationException( + "Cannot deserialize a reference at idShort path + '" + idShortPath + "'.", e, idShortPath); + } + } + } + private final boolean prettyString; + final static ValueOnlySerializer serializer = new ValueOnlySerializer(); + /** - * The default constructor creates a value-only serializer which serializes submodels and submodel elements to a - * compact string. + * The default constructor creates a value-only mapper which serializes and deserializes submodels and submodel + * elements to a compact value-only JSON string. */ public ValueOnlyMapper() { this(false); } /** - * Creates a value-only serializer. - * @param prettyString pass true, if you want to have a pretty formatted strings. + * Creates a value-only mapper. + * @param prettyString pass true, if you want to have a pretty formatted value-only JSON strings. */ public ValueOnlyMapper(boolean prettyString) { this.prettyString = prettyString; @@ -56,34 +87,45 @@ public ValueOnlyMapper(boolean prettyString) { /** * Serializes a submodel in value-only JSON format. - * @param submodel the submodel to be serialized. + * @param submodel the submodel to be serialized. Not null. * @return the corresponding value-only JSON string. */ - public String write(Submodel submodel) throws ValueOnlySerializationException { - ElementsCollectionMapper serializer = new ElementsCollectionMapper(submodel.getSubmodelElements(), "$"); - JsonNode node = serializer.serialize(); + public String toValueOnly(Submodel submodel) throws ValueOnlySerializationException { + ElementsCollectionMapper mapper = new ElementsCollectionMapper(submodel.getSubmodelElements(), "$"); + JsonNode node = mapper.toJson(); return prettyString ? node.toPrettyString() : node.toString(); } /** - * Update an existing submodel with the given valueOnly. + * Update an existing submodel with the given value-only JSON string. + *
    Note:The update is not an atomic operation and if an exception is thrown, the corresponding submodel + * will be in an inconsistent state. If you cannot handle such situations, pass a copy of the original submodel. * @param submodel The submodel to be updated. If you want to prevent the direct modification of the original - * submodel, just use the corresponding copy constructor, when you pass this argument. - * @param valueOnly the valueOnly string. + * submodel, just use the corresponding copy constructor, when you pass this argument. Not null. + * @param valueOnly the valueOnly string. Not null. + * */ - public void update(Submodel submodel, String valueOnly) { - throw new UnsupportedOperationException("This method is still not implemented."); + public void update(Submodel submodel, String valueOnly) throws ValueOnlySerializationException { + JsonNode node = serializer.readTree(valueOnly); + ElementsCollectionMapper mapper = new ElementsCollectionMapper(submodel.getSubmodelElements(), "$"); + mapper.update(node); } /** * Serializes a submodel element in value-only JSON format. - * @param element the submodel element to be serialized. + *
    Note:The update is not an atomic operation and if an exception is thrown, the corresponding element + * will be in an inconsistent state. If you cannot handle such situations, pass a copy of the original element. + * @param element the submodel element to be serialized. Not null. * @return the corresponding value-only JSON string. - * @param element - * @return */ - public String write(SubmodelElement element) throws ValueOnlySerializationException { - JsonNode node = ElementsCollectionMapper.serialize(element, "$"); + public String toValueOnly(SubmodelElement element) throws ValueOnlySerializationException { + AbstractMapper mapper = ElementsCollectionMapper.createMapper(element, "$"); + if(mapper == null) { + throw new ValueOnlySerializationException( + "Value-only serialization is not allowed for submodel elements of type '" + element.getClass() + "'.", + "$"); + } + JsonNode node = mapper.toJson(); return prettyString ? node.toPrettyString() : node.toString(); } @@ -91,9 +133,12 @@ public String write(SubmodelElement element) throws ValueOnlySerializationExcept * Update an existing submodel element with the given valueOnly. * @param element The submodel element to be updated. If you want to prevent the direct modification of the original * submodel element, just use the corresponding copy constructor, when you pass this argument. - * @param valueOnly the valueOnly string. + * Not null. + * @param valueOnly the valueOnly string. Not null. */ - public SubmodelElement update(SubmodelElement element, String valueOnly) { - throw new UnsupportedOperationException("This method is still not implemented."); + public void update(SubmodelElement element, String valueOnly) throws ValueOnlySerializationException { + JsonNode node = serializer.readTree(valueOnly); + AbstractMapper mapper = ElementsCollectionMapper.createMapper(element, "$"); + mapper.update(node); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java index dbb8e8706..c1108f096 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java @@ -20,7 +20,14 @@ * This exception is thrown during the value-only serialization or deserialization. */ public class ValueOnlySerializationException extends Exception { - public ValueOnlySerializationException(String msg) { + private final String idShortPath; + + public ValueOnlySerializationException(String msg, String idShortPath) { super(msg); + this.idShortPath = idShortPath; + } + public ValueOnlySerializationException(String msg, Throwable cause, String idShortPath) { + super(msg, cause); + this.idShortPath = idShortPath; } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java index 22da643d8..39cd791a6 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java @@ -38,89 +38,89 @@ public void testCreateDefaultSerializer() throws IOException { @Test public void testSerializeSubmodel() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.SUBMODEL); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.SUBMODEL); String expected = readValueOnlyFile("submodel.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeEntity() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.ENTITY); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.ENTITY); String expected = readValueOnlyFile("entity.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeProperty() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.PROPERTY_INT); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.PROPERTY_INT); assertEquals("42", valueOnlySubmodelString); } @Test public void testSerializeRange() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.RANGE_DOUBLE); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.RANGE_DOUBLE); String expected = readValueOnlyFile("range.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeBlob() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.BLOB); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.BLOB); String expected = readValueOnlyFile("blob.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeFile() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.FILE); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.FILE); String expected = readValueOnlyFile("file.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeMultiLangProperty() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.MULTI_LANGUAGE_PROPERTY); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.MULTI_LANGUAGE_PROPERTY); String expected = readValueOnlyFile("multi_lang_property.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializePropertyDouble() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.PROPERTY_DOUBLE); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.PROPERTY_DOUBLE); JSONAssert.assertEquals("42.17", valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializePropertyDatetime() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.PROPERTY_DATETIME); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.PROPERTY_DATETIME); String expected = readValueOnlyFile("date_time_property.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeRefElementGlobal() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.REFERENCE_ELEMENT_GLOBAL); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.REFERENCE_ELEMENT_GLOBAL); String expected = readValueOnlyFile("ref_element_global.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeAnnotatedRelationshipElement() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.ANNOTATED_RELATIONSHIP_ELEMENT); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.ANNOTATED_RELATIONSHIP_ELEMENT); String expected = readValueOnlyFile("ann_relationship_element.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeCollectionElement() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.ELEMENT_COLLECTION); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.ELEMENT_COLLECTION); String expected = readValueOnlyFile("element_collection.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeListElement() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnlySubmodelString = serializer.write(TestData.ELEMENT_LIST); + String valueOnlySubmodelString = serializer.toValueOnly(TestData.ELEMENT_LIST); String expected = readValueOnlyFile("element_list.json"); JSONAssert.assertEquals(expected, valueOnlySubmodelString, JSONCompareMode.NON_EXTENSIBLE); } From ece1a16a7b6fa24e742e0300b389c9d177ff350e Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 20 Jul 2023 11:09:41 +0200 Subject: [PATCH 41/59] Add some more test data --- .../dataformat/json/valueonly/TestData.java | 261 +++++++++++++----- .../valueonly/ann_relationship_element.json | 2 +- .../resources/valueonly/element_list.json | 5 +- 3 files changed, 202 insertions(+), 66 deletions(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java index 5852ec42a..106f3cf0c 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java @@ -65,11 +65,29 @@ public class TestData { .build()) .build(); + public static final Entity ENTITY_UPDATED = new DefaultEntity.Builder() + .idShort("entity1") + .entityType(EntityType.CO_MANAGED_ENTITY) + .globalAssetId("Global Asset Id Updated") + .statements(new DefaultProperty.Builder() + .idShort("MaxRotationSpeed") + .valueType(DataTypeDefXsd.INT) + .value("5001") + .build()) + .build(); + public static final Property PROPERTY_STRING = new DefaultProperty.Builder() .category("category") .idShort("propString") .value("foo") .build(); + + public static final Property PROPERTY_STRING_UPDATED = new DefaultProperty.Builder() + .category("category") + .idShort("propString") + .value("foo updated") + .build(); + public static final Range RANGE_DOUBLE = new DefaultRange.Builder() .idShort("rangeDouble") .valueType(DataTypeDefXsd.DOUBLE) @@ -77,51 +95,105 @@ public class TestData { .max("5.0") .build(); + public static final Range RANGE_DOUBLE_UPDATED = new DefaultRange.Builder() + .idShort("rangeDouble") + .valueType(DataTypeDefXsd.DOUBLE) + .min("3.0") + .max("5.0") + .build(); + public static final Blob BLOB = new DefaultBlob.Builder() - .idShort("blob1") - .contentType("application/octet-stream") - .value("example-data".getBytes()) - .build(); + .idShort("blob1") + .contentType("application/octet-stream") + .value("example-data".getBytes()) + .build(); + public static final Blob BLOB_UPDATED = new DefaultBlob.Builder() + .idShort("blob1") + .contentType("application/json") + .value("{ value: 42 }".getBytes()) + .build(); public static final File FILE = new DefaultFile.Builder() - .idShort("file1") - .contentType("application/pdf") - .value("SafetyInstructions.pdf") - .build(); + .idShort("file1") + .contentType("application/pdf") + .value("SafetyInstructions.pdf") + .build(); + + public static final File FILE_UPDATED = new DefaultFile.Builder() + .idShort("file1") + .contentType("application/json") + .value("SafetyInstructions.json") + .build(); public static final MultiLanguageProperty MULTI_LANGUAGE_PROPERTY = new DefaultMultiLanguageProperty.Builder() - .idShort("multiLanguageProp1") - .value(new DefaultLangStringTextType.Builder().text("foo").language("de").build()) - .value(new DefaultLangStringTextType.Builder() .text("bar").language("en").build()) - .build(); + .idShort("multiLanguageProp1") + .value(new DefaultLangStringTextType.Builder().text("foo").language("de").build()) + .value(new DefaultLangStringTextType.Builder() .text("bar").language("en").build()) + .build(); + + public static final MultiLanguageProperty MULTI_LANGUAGE_PROPERTY_UPDATED = new DefaultMultiLanguageProperty.Builder() + .idShort("multiLanguageProp1") + .value(new DefaultLangStringTextType.Builder().text("foo updated").language("fr").build()) + .value(new DefaultLangStringTextType.Builder() .text("bar updated").language("de").build()) + .build(); public static final Property PROPERTY_DOUBLE = new DefaultProperty.Builder() - .category("category") - .idShort("propDouble") - .valueType(DataTypeDefXsd.DOUBLE) - .value("42.17") - .build(); + .category("category") + .idShort("propDouble") + .valueType(DataTypeDefXsd.DOUBLE) + .value("42.17") + .build(); + + public static final Property PROPERTY_DOUBLE_UPDATED = new DefaultProperty.Builder() + .category("category") + .idShort("propDouble") + .valueType(DataTypeDefXsd.DOUBLE) + .value("24.71") + .build(); + public static final Property PROPERTY_DATETIME = new DefaultProperty.Builder() - .category("category") - .idShort("propDateTime") - .valueType(DataTypeDefXsd.DATE_TIME) - .value(ZonedDateTime.of(2022, 7, 31, 17, 8, 51, 0, ZoneOffset.UTC).toString()) - .build(); + .category("category") + .idShort("propDateTime") + .valueType(DataTypeDefXsd.DATE_TIME) + .value(ZonedDateTime.of(2022, 7, 31, 17, 8, 51, 0, ZoneOffset.UTC).toString()) + .build(); + + public static final Property PROPERTY_DATETIME_UPDATED = new DefaultProperty.Builder() + .category("category") + .idShort("propDateTime") + .valueType(DataTypeDefXsd.DATE_TIME) + .value(ZonedDateTime.of(2023, 7, 31, 17, 8, 51, 0, ZoneOffset.UTC).toString()) + .build(); public static final Property PROPERTY_INT = new DefaultProperty.Builder() - .category("category") - .idShort("propInt") - .valueType(DataTypeDefXsd.INT) - .value("42") - .build(); + .category("category") + .idShort("propInt") + .valueType(DataTypeDefXsd.INT) + .value("42") + .build(); + + public static final Property PROPERTY_INT_UPDATED = new DefaultProperty.Builder() + .category("category") + .idShort("propInt") + .valueType(DataTypeDefXsd.INT) + .value("24") + .build(); public static final Range RANGE_INT = new DefaultRange.Builder() - .idShort("rangeInt") - .valueType(DataTypeDefXsd.INT) - .min("17") - .max("42") - .build(); + .idShort("rangeInt") + .valueType(DataTypeDefXsd.INT) + .min("17") + .max("42") + .build(); + + public static final Range RANGE_INT_UPDATED = new DefaultRange.Builder() + .idShort("rangeInt") + .valueType(DataTypeDefXsd.INT) + .min("24") + .max("50") + .build(); + public static final ReferenceElement REFERENCE_ELEMENT_GLOBAL = new DefaultReferenceElement.Builder() .idShort("referenceGlobal") .value(new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -139,6 +211,23 @@ public class TestData { .build()) .build(); + public static final ReferenceElement REFERENCE_ELEMENT_GLOBAL_UPDATED = new DefaultReferenceElement.Builder() + .idShort("referenceGlobal") + .value(new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) + .referredSemanticId(new DefaultReference.Builder() + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("Global reference key value updated") + .build()) + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.FILE) + .value("file key value") + .build()) + .build()) + .build(); + public static final ReferenceElement REFERENCE_ELEMENT_MODEL = new DefaultReferenceElement.Builder() .idShort("referenceModel") .value(new DefaultReference.Builder() @@ -150,50 +239,98 @@ public class TestData { .build()) .build(); + public static final ReferenceElement REFERENCE_ELEMENT_MODEL_UPDATED = new DefaultReferenceElement.Builder() + .idShort("referenceModel") + .value(new DefaultReference.Builder() + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("Global reference key value updated") + .build()) + .build()) + .build(); + public static final AnnotatedRelationshipElement ANNOTATED_RELATIONSHIP_ELEMENT = new DefaultAnnotatedRelationshipElement.Builder() .idShort("annotatedRelationship1") .first(REFERENCE_ELEMENT_GLOBAL.getValue()) .second(REFERENCE_ELEMENT_MODEL.getValue()) - .annotations(new DefaultProperty.Builder() - .idShort("AppliedRule") - .value("TechnicalCurrentFlowDirection") - .build()) + .annotations(PROPERTY_DATETIME) .annotations(RANGE_INT) .build(); + public static final AnnotatedRelationshipElement ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED = new DefaultAnnotatedRelationshipElement.Builder() + .idShort("annotatedRelationship1") + .first(REFERENCE_ELEMENT_GLOBAL_UPDATED.getValue()) + .second(REFERENCE_ELEMENT_MODEL_UPDATED.getValue()) + .annotations(PROPERTY_DATETIME_UPDATED) + .annotations(RANGE_INT_UPDATED) + .build(); + public static final RelationshipElement RELATIONSHIP_ELEMENT = new DefaultRelationshipElement.Builder() - .idShort("relationship1") - .first(REFERENCE_ELEMENT_GLOBAL.getValue()) - .second(REFERENCE_ELEMENT_MODEL.getValue()) - .build(); + .idShort("relationship1") + .first(REFERENCE_ELEMENT_GLOBAL.getValue()) + .second(REFERENCE_ELEMENT_MODEL.getValue()) + .build(); + + public static final RelationshipElement RELATIONSHIP_ELEMENT_UPDATED = new DefaultRelationshipElement.Builder() + .idShort("relationship1") + .first(REFERENCE_ELEMENT_GLOBAL_UPDATED.getValue()) + .second(REFERENCE_ELEMENT_MODEL_UPDATED.getValue()) + .build(); public static final SubmodelElementCollection ELEMENT_COLLECTION = new DefaultSubmodelElementCollection.Builder() - .idShort("collection1") - .value(PROPERTY_STRING) - .value(RANGE_DOUBLE) - .value(ENTITY) - .value(RELATIONSHIP_ELEMENT) - .build(); + .idShort("collection1") + .value(PROPERTY_STRING) + .value(RANGE_DOUBLE) + .value(ENTITY) + .value(RELATIONSHIP_ELEMENT) + .build(); + + public static final SubmodelElementCollection ELEMENT_COLLECTION_UPDATED = new DefaultSubmodelElementCollection.Builder() + .idShort("collection1") + .value(PROPERTY_STRING_UPDATED) + .value(RANGE_DOUBLE_UPDATED) + .value(ENTITY_UPDATED) + .value(RELATIONSHIP_ELEMENT_UPDATED) + .build(); public static final SubmodelElementList ELEMENT_LIST = new DefaultSubmodelElementList.Builder() - .idShort("list1") - .value(PROPERTY_STRING) - .value(RANGE_DOUBLE) - .value(ENTITY) - .value(ANNOTATED_RELATIONSHIP_ELEMENT) - .build(); + .idShort("list1") + .value(PROPERTY_STRING) + .value(RANGE_DOUBLE) + .value(ENTITY) + .value(ANNOTATED_RELATIONSHIP_ELEMENT) + .build(); + public static final SubmodelElementList ELEMENT_LIST_UPDATED = new DefaultSubmodelElementList.Builder() + .idShort("list1") + .value(PROPERTY_STRING_UPDATED) + .value(RANGE_DOUBLE_UPDATED) + .value(ENTITY_UPDATED) + .value(ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED) + .build(); public static final Submodel SUBMODEL = new DefaultSubmodel.Builder() - .category("category") - .idShort("submodel1") - .kind(ModellingKind.INSTANCE) - .submodelElements(PROPERTY_STRING) - .submodelElements(RANGE_DOUBLE) - .submodelElements(ELEMENT_COLLECTION) - .submodelElements(new DefaultOperation.Builder() - .idShort("operation1") - .build()) - .build(); + .category("category") + .idShort("submodel1") + .kind(ModellingKind.INSTANCE) + .submodelElements(PROPERTY_STRING) + .submodelElements(RANGE_DOUBLE) + .submodelElements(ELEMENT_COLLECTION) + .submodelElements(new DefaultOperation.Builder() + .idShort("operation1") + .build()) + .build(); + public static final Submodel SUBMODEL_UPDATED = new DefaultSubmodel.Builder() + .category("category") + .idShort("submodel1") + .kind(ModellingKind.INSTANCE) + .submodelElements(PROPERTY_STRING_UPDATED) + .submodelElements(RANGE_DOUBLE_UPDATED) + .submodelElements(ELEMENT_COLLECTION_UPDATED) + .submodelElements(new DefaultOperation.Builder() + .idShort("operation1") + .build()) + .build(); } diff --git a/dataformat-json/src/test/resources/valueonly/ann_relationship_element.json b/dataformat-json/src/test/resources/valueonly/ann_relationship_element.json index b68f9fa35..66542bce2 100644 --- a/dataformat-json/src/test/resources/valueonly/ann_relationship_element.json +++ b/dataformat-json/src/test/resources/valueonly/ann_relationship_element.json @@ -21,7 +21,7 @@ "type" : "ModelReference" }, "annotations" : [ - "TechnicalCurrentFlowDirection", + "2022-07-31T17:08:51Z", { "min" : 17, "max" : 42 diff --git a/dataformat-json/src/test/resources/valueonly/element_list.json b/dataformat-json/src/test/resources/valueonly/element_list.json index 2c1ae1fcc..20424db2c 100644 --- a/dataformat-json/src/test/resources/valueonly/element_list.json +++ b/dataformat-json/src/test/resources/valueonly/element_list.json @@ -1,6 +1,5 @@ [ - "foo", - { + "foo", { "min" : 3.0, "max" : 5.0 }, @@ -38,7 +37,7 @@ "type" : "ModelReference" }, "annotations" : [ - "TechnicalCurrentFlowDirection", + "2022-07-31T17:08:51Z", { "min" : 17, "max" : 42 From 1ae7ca8a24e3fcedda7b1eed84b3331af838a55d Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 20 Jul 2023 14:14:36 +0200 Subject: [PATCH 42/59] Add unit tests for the update --- .../AnnotatedRelationshipMapper.java | 7 +- .../valueonly/BasicEventElementMapper.java | 3 +- .../valueonly/ReferenceElementMapper.java | 5 +- .../valueonly/RelationshipElementMapper.java | 6 +- .../json/valueonly/ValueOnlyMapper.java | 10 +- .../json/valueonly/ValueOnlyMapperTest.java | 176 ++++++++++++++---- 6 files changed, 155 insertions(+), 52 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java index 2e31beedb..6fd93ab64 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java @@ -19,14 +19,15 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; + import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.ArrayList; import java.util.List; import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.serializer; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.deserializer; /** * AnnotatedRelationshipElement is serialized according to the serialization of a ReleationshipElement. Additionally, a @@ -58,8 +59,8 @@ public JsonNode toJson() throws ValueOnlySerializationException { @Override public void update(JsonNode valueOnly) throws ValueOnlySerializationException { - element.setFirst(serializer.parseReference(valueOnly.get(FIRST), idShortPath)); - element.setSecond(serializer.parseReference(valueOnly.get(SECOND), idShortPath)); + element.setFirst(deserializer.parseReference(valueOnly.get(FIRST), idShortPath)); + element.setSecond(deserializer.parseReference(valueOnly.get(SECOND), idShortPath)); JsonNode annotationsNode = valueOnly.get(ANNOTATIONS); if(annotationsNode == null || annotationsNode.isNull()) { diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java index a1eb1f287..8f940e05c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java @@ -22,6 +22,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.serializer; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.deserializer; /** * BasicEventElement is serialized as named JSON object with ${BasicEventElement/idShort} as the name of the containing @@ -44,6 +45,6 @@ public JsonNode toJson() throws ValueOnlySerializationException { @Override public void update(JsonNode valueOnly) throws ValueOnlySerializationException { - element.setObserved(serializer.parseReference(valueOnly.get(OBSERVED), idShortPath)); + element.setObserved(deserializer.parseReference(valueOnly.get(OBSERVED), idShortPath)); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java index c065a1612..61c3b3421 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java @@ -21,6 +21,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.serializer; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.deserializer; /** * ReferenceElement is serialized as ${ReferenceElement/idShort}: ${ReferenceElement/value} where @@ -38,6 +39,6 @@ public JsonNode toJson() throws ValueOnlySerializationException { @Override public void update(JsonNode valueOnly) throws ValueOnlySerializationException { - element.setValue(serializer.parseReference(valueOnly, idShortPath)); + element.setValue(deserializer.parseReference(valueOnly, idShortPath)); } -} +} \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java index b1dcf4a4e..7713fe698 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java @@ -20,10 +20,10 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.File; import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.serializer; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.deserializer; /** * RelationshipElement is serialized as named JSON object with ${RelationshipElement/idShort} as the name of the @@ -49,7 +49,7 @@ public JsonNode toJson() throws ValueOnlySerializationException { @Override public void update(JsonNode valueOnly) throws ValueOnlySerializationException { - element.setFirst(serializer.parseReference(valueOnly.get(FIRST), idShortPath + "." + FIRST)); - element.setSecond(serializer.parseReference(valueOnly.get(SECOND), idShortPath + "." + SECOND)); + element.setFirst(deserializer.parseReference(valueOnly.get(FIRST), idShortPath + "." + FIRST)); + element.setSecond(deserializer.parseReference(valueOnly.get(SECOND), idShortPath + "." + SECOND)); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java index 59e657d4d..ffb6d8488 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java @@ -19,10 +19,12 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; /** * This class implements the value-only Serialization in JSON format, as described in section 11.4.2 of Date: Thu, 20 Jul 2023 14:19:02 +0200 Subject: [PATCH 43/59] Refactor the unit tests --- .../json/valueonly/ValueOnlyMapperTest.java | 134 +++++++++--------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java index b6eedd81e..a1c723093 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java @@ -32,190 +32,190 @@ @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class ValueOnlyMapperTest { - private static ValueOnlyMapper serializer = new ValueOnlyMapper(true); + private static ValueOnlyMapper valueOnlyMapper = new ValueOnlyMapper(true); @Test - public void test01_CreateDefaultSerializer() throws IOException { + public void testCreateDefaultSerializer() throws IOException { assertNotNull(new ValueOnlyMapper()); } @Test - public void test02_SerializeSubmodel() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serializer.toValueOnly(TestData.SUBMODEL); + public void testSerializeSubmodel() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.SUBMODEL); String expected = readValueOnlyFile("submodel.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void test03_SerializeEntity() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serializer.toValueOnly(TestData.ENTITY); + public void testSerializeEntity() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.ENTITY); String expected = readValueOnlyFile("entity.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void test04_SerializeProperty() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.PROPERTY_INT); + public void testSerializeProperty() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_INT); assertEquals("42", valueOnly); } @Test - public void test05_SerializeRange() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serializer.toValueOnly(TestData.RANGE_DOUBLE); + public void testSerializeRange() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.RANGE_DOUBLE); String expected = readValueOnlyFile("range.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void test06_SerializeBlob() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serializer.toValueOnly(TestData.BLOB); + public void testSerializeBlob() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.BLOB); String expected = readValueOnlyFile("blob.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void test07_SerializeFile() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serializer.toValueOnly(TestData.FILE); + public void testSerializeFile() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.FILE); String expected = readValueOnlyFile("file.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void test08_SerializeMultiLangProperty() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serializer.toValueOnly(TestData.MULTI_LANGUAGE_PROPERTY); + public void testSerializeMultiLangProperty() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.MULTI_LANGUAGE_PROPERTY); String expected = readValueOnlyFile("multi_lang_property.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void test09_SerializePropertyDouble() throws ValueOnlySerializationException, JSONException { - String valueOnly = serializer.toValueOnly(TestData.PROPERTY_DOUBLE); + public void testSerializePropertyDouble() throws ValueOnlySerializationException, JSONException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_DOUBLE); JSONAssert.assertEquals("42.17", valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void test10_SerializePropertyDatetime() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serializer.toValueOnly(TestData.PROPERTY_DATETIME); + public void testSerializePropertyDatetime() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_DATETIME); String expected = readValueOnlyFile("date_time_property.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void test11_SerializeRefElementGlobal() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serializer.toValueOnly(TestData.REFERENCE_ELEMENT_GLOBAL); + public void testSerializeRefElementGlobal() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.REFERENCE_ELEMENT_GLOBAL); String expected = readValueOnlyFile("ref_element_global.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void test12_SerializeAnnotatedRelationshipElement() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serializer.toValueOnly(TestData.ANNOTATED_RELATIONSHIP_ELEMENT); + public void testSerializeAnnotatedRelationshipElement() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.ANNOTATED_RELATIONSHIP_ELEMENT); String expected = readValueOnlyFile("ann_relationship_element.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void test13_SerializeCollectionElement() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serializer.toValueOnly(TestData.ELEMENT_COLLECTION); + public void testSerializeCollectionElement() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.ELEMENT_COLLECTION); String expected = readValueOnlyFile("element_collection.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void test14_SerializeListElement() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serializer.toValueOnly(TestData.ELEMENT_LIST); + public void testSerializeListElement() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.ELEMENT_LIST); String expected = readValueOnlyFile("element_list.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void test15_UpdateSubmodel() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.SUBMODEL_UPDATED); - serializer.update(TestData.SUBMODEL, valueOnly); + public void testUpdateSubmodel() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.SUBMODEL_UPDATED); + valueOnlyMapper.update(TestData.SUBMODEL, valueOnly); assertEquals(TestData.SUBMODEL_UPDATED, TestData.SUBMODEL); } @Test - public void test16_UpdateEntity() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.ENTITY_UPDATED); - serializer.update(TestData.ENTITY, valueOnly); + public void testUpdateEntity() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.ENTITY_UPDATED); + valueOnlyMapper.update(TestData.ENTITY, valueOnly); assertEquals(TestData.ENTITY_UPDATED, TestData.ENTITY); } @Test - public void test17_UpdateProperty() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.PROPERTY_INT_UPDATED); - serializer.update(TestData.PROPERTY_INT, valueOnly); + public void testUpdateProperty() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_INT_UPDATED); + valueOnlyMapper.update(TestData.PROPERTY_INT, valueOnly); assertEquals(TestData.PROPERTY_INT_UPDATED, TestData.PROPERTY_INT); } @Test - public void test18_UpdateRange() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.RANGE_DOUBLE_UPDATED); - serializer.update(TestData.RANGE_DOUBLE, valueOnly); + public void testUpdateRange() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.RANGE_DOUBLE_UPDATED); + valueOnlyMapper.update(TestData.RANGE_DOUBLE, valueOnly); assertEquals(TestData.RANGE_DOUBLE_UPDATED, TestData.RANGE_DOUBLE); } @Test - public void test19_UpdateBlob() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.BLOB_UPDATED); - serializer.update(TestData.BLOB, valueOnly); + public void testUpdateBlob() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.BLOB_UPDATED); + valueOnlyMapper.update(TestData.BLOB, valueOnly); assertEquals(TestData.BLOB_UPDATED, TestData.BLOB); } @Test - public void test20_UpdateFile() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.FILE_UPDATED); - serializer.update(TestData.FILE, valueOnly); + public void testUpdateFile() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.FILE_UPDATED); + valueOnlyMapper.update(TestData.FILE, valueOnly); assertEquals(TestData.FILE_UPDATED, TestData.FILE); } @Test - public void test21_UpdateMultiLangProperty() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.MULTI_LANGUAGE_PROPERTY_UPDATED); - serializer.update(TestData.MULTI_LANGUAGE_PROPERTY, valueOnly); + public void testUpdateMultiLangProperty() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.MULTI_LANGUAGE_PROPERTY_UPDATED); + valueOnlyMapper.update(TestData.MULTI_LANGUAGE_PROPERTY, valueOnly); assertEquals(TestData.MULTI_LANGUAGE_PROPERTY_UPDATED, TestData.MULTI_LANGUAGE_PROPERTY); } @Test - public void test22_UpdatePropertyDouble() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.PROPERTY_DOUBLE_UPDATED); - serializer.update(TestData.PROPERTY_DOUBLE, valueOnly); + public void testUpdatePropertyDouble() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_DOUBLE_UPDATED); + valueOnlyMapper.update(TestData.PROPERTY_DOUBLE, valueOnly); assertEquals(TestData.PROPERTY_DOUBLE_UPDATED, TestData.PROPERTY_DOUBLE); } @Test - public void test23_UpdatePropertyDatetime() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.PROPERTY_DATETIME_UPDATED); - serializer.update(TestData.PROPERTY_DATETIME, valueOnly); + public void testUpdatePropertyDatetime() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_DATETIME_UPDATED); + valueOnlyMapper.update(TestData.PROPERTY_DATETIME, valueOnly); assertEquals(TestData.PROPERTY_DATETIME_UPDATED, TestData.PROPERTY_DATETIME); } @Test - public void test24_UpdateRefElementGlobal() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.REFERENCE_ELEMENT_GLOBAL_UPDATED); - serializer.update(TestData.REFERENCE_ELEMENT_GLOBAL, valueOnly); + public void testUpdateRefElementGlobal() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.REFERENCE_ELEMENT_GLOBAL_UPDATED); + valueOnlyMapper.update(TestData.REFERENCE_ELEMENT_GLOBAL, valueOnly); assertEquals(TestData.REFERENCE_ELEMENT_GLOBAL_UPDATED, TestData.REFERENCE_ELEMENT_GLOBAL); } @Test - public void test25_UpdateAnnotatedRelationshipElement() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED); - serializer.update(TestData.ANNOTATED_RELATIONSHIP_ELEMENT, valueOnly); + public void testUpdateAnnotatedRelationshipElement() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED); + valueOnlyMapper.update(TestData.ANNOTATED_RELATIONSHIP_ELEMENT, valueOnly); assertEquals(TestData.ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED, TestData.ANNOTATED_RELATIONSHIP_ELEMENT); } @Test - public void test26_UpdateCollectionElement() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.ELEMENT_COLLECTION_UPDATED); - serializer.update(TestData.ELEMENT_COLLECTION, valueOnly); + public void testUpdateCollectionElement() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.ELEMENT_COLLECTION_UPDATED); + valueOnlyMapper.update(TestData.ELEMENT_COLLECTION, valueOnly); assertEquals(TestData.ELEMENT_COLLECTION_UPDATED, TestData.ELEMENT_COLLECTION); } @Test - public void test27_UpdateListElement() throws ValueOnlySerializationException { - String valueOnly = serializer.toValueOnly(TestData.ELEMENT_LIST_UPDATED); - serializer.update(TestData.ELEMENT_LIST, valueOnly); + public void testUpdateListElement() throws ValueOnlySerializationException { + String valueOnly = valueOnlyMapper.toValueOnly(TestData.ELEMENT_LIST_UPDATED); + valueOnlyMapper.update(TestData.ELEMENT_LIST, valueOnly); assertEquals(TestData.ELEMENT_LIST_UPDATED, TestData.ELEMENT_LIST); } From 78e63f3cec4fdc9edfc06f11e2d89369b8e82d72 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 20 Jul 2023 14:22:19 +0200 Subject: [PATCH 44/59] Fix the test --- .../aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java index a1c723093..445f9e206 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java @@ -35,7 +35,7 @@ public class ValueOnlyMapperTest { private static ValueOnlyMapper valueOnlyMapper = new ValueOnlyMapper(true); @Test - public void testCreateDefaultSerializer() throws IOException { + public void testCreateDefaultMapper() throws IOException { assertNotNull(new ValueOnlyMapper()); } From 4b9b34d3da912e50e2ce49bd3106ca832beacdb6 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 20 Jul 2023 14:35:27 +0200 Subject: [PATCH 45/59] Remove unused imports --- .../v3/dataformat/json/valueonly/AbstractMapper.java | 6 +++--- .../dataformat/json/valueonly/ElementsListMapper.java | 4 +--- .../v3/dataformat/json/valueonly/EntityMapper.java | 5 ++--- .../json/valueonly/MultiLanguagePropertyMapper.java | 5 ++--- .../v3/dataformat/json/valueonly/RangeMapper.java | 11 +++++++---- .../v3/dataformat/json/valueonly/ValueOnlyMapper.java | 2 +- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java index e6e325515..c35bf0bb6 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java @@ -19,8 +19,8 @@ import com.fasterxml.jackson.databind.JsonNode; /** - * The abstract base class for all value-only serializers. - * @param The type of the serialized elements. + * The abstract base class for all value-only mappers. + * @param The type of the mapped elements. */ public abstract class AbstractMapper { protected final T element; @@ -28,7 +28,7 @@ public abstract class AbstractMapper { /** * - * @param element the submodel element that has to be serialized. + * @param element the submodel element that has to be mapped. * @param idShortPath the idShort path is a dot separated chain of idShorts, that can be used in case of * troubleshooting. */ diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java index 4ce72eab3..92718d4a2 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java @@ -21,11 +21,9 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.ObjectNode; + import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import java.util.ArrayDeque; -import java.util.Iterator; import java.util.List; /** diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java index 1577eefc4..f6b5237ac 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java @@ -25,7 +25,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Entity; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.Iterator; import java.util.List; @@ -95,14 +94,14 @@ public void update(JsonNode valueOnly) throws ValueOnlySerializationException { List specificAssetIds = element.getSpecificAssetIds(); if(!specificAssetIdNode.isObject()) { throw new ValueOnlySerializationException("Cannot update the Entity at idShort path '" + - idShortPath + "' as the passed " + SPECIFIC_ASSET_ID + " is not an object.", idShortPath); + idShortPath + "', as the passed " + SPECIFIC_ASSET_ID + " is not an object.", idShortPath); } updateSpecificAssetIds(element.getSpecificAssetIds(), (ObjectNode) specificAssetIdNode); } JsonNode entityTypeNode = valueOnly.get(ENTITY_TYPE); if(entityTypeNode == null || !entityTypeNode.isTextual()) { throw new ValueOnlySerializationException("Cannot update the Entity at idShort path '" + - idShortPath + "' as its type is not set as string property '" + ENTITY_TYPE + "'.", idShortPath); + idShortPath + "', as its type is not set as string property '" + ENTITY_TYPE + "'.", idShortPath); } element.setEntityType(EntityType.valueOf(EnumDeserializer.deserializeEnumName(entityTypeNode.textValue()))); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java index 1ad32c612..92c779143 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java @@ -25,7 +25,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; -import javax.naming.OperationNotSupportedException; import java.util.Iterator; import java.util.List; @@ -59,7 +58,7 @@ public void update(JsonNode valueOnly) throws ValueOnlySerializationException { if(!valueOnly.isObject()) { throw new ValueOnlySerializationException( "Cannot update the multi-language property at idShort path '" + idShortPath + - "' as the passed value-only is not a JSON object.", idShortPath); + "', as the passed value-only is not a JSON object.", idShortPath); } ObjectNode propNode = (ObjectNode)valueOnly; List value = element.getValue(); @@ -71,7 +70,7 @@ public void update(JsonNode valueOnly) throws ValueOnlySerializationException { String fullPath = idShortPath + "." + language; throw new ValueOnlySerializationException( "Cannot update the multi-language property at idShort path '" + fullPath + - "' as the passed value is not a string.", idShortPath); + "', as the passed value is not a string.", idShortPath); } value.add(new DefaultLangStringTextType.Builder().language(language).text(textNode.textValue()).build()); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java index e25dc8edf..f0e6b051f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java @@ -29,6 +29,9 @@ * are ${Range/min} and ${Range/max}. */ public class RangeMapper extends AbstractMapper { + private static final String MIN = "min"; + private static final String MAX = "max"; + RangeMapper(Range range, String idShortPath) { super(range, idShortPath); } @@ -38,8 +41,8 @@ public JsonNode toJson() throws ValueOnlySerializationException { try { ObjectNode node = JsonNodeFactory.instance.objectNode(); DataTypeDefXsd valueType = element.getValueType(); - node.set("min", ValueConverter.convert(valueType, element.getMin())); - node.set("max", ValueConverter.convert(valueType, element.getMax())); + node.set(MIN, ValueConverter.convert(valueType, element.getMin())); + node.set(MAX, ValueConverter.convert(valueType, element.getMax())); return node; } catch (NumberFormatException ex) { throw new ValueOnlySerializationException("Cannot serialize the range with idShort path '" + @@ -49,7 +52,7 @@ public JsonNode toJson() throws ValueOnlySerializationException { @Override public void update(JsonNode valueOnly) throws ValueOnlySerializationException { - element.setMax(PropertyMapper.readValueAsString("Cannot update Range.max", idShortPath, valueOnly.get("max"))); - element.setMin(PropertyMapper.readValueAsString("Cannot update Range.min", idShortPath, valueOnly.get("min"))); + element.setMax(PropertyMapper.readValueAsString("Cannot update Range." + MAX, idShortPath, valueOnly.get(MAX))); + element.setMin(PropertyMapper.readValueAsString("Cannot update Range." + MIN, idShortPath, valueOnly.get(MIN))); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java index ffb6d8488..fe00f0d51 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; From 27f96ebf69e459382f893dc5ded1d6419bf80234 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 20 Jul 2023 14:48:27 +0200 Subject: [PATCH 46/59] Update the ValueOnlySerializationException --- .../json/valueonly/ValueOnlySerializationException.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java index c1108f096..6734fec1b 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java @@ -30,4 +30,8 @@ public ValueOnlySerializationException(String msg, Throwable cause, String idSho super(msg, cause); this.idShortPath = idShortPath; } + + public String getIdShortPath() { + return idShortPath; + } } From 3960a99be53b3893903cb410c2eea0ce26d5515c Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 20 Jul 2023 14:51:57 +0200 Subject: [PATCH 47/59] Revert JsonSerializer --- .../digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java | 1 - 1 file changed, 1 deletion(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index b3df48fe3..7ee80bb9d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.json.JsonMapper; From 8eac11b8c1747a1d761367f60d3490a729de6233 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 20 Jul 2023 14:59:47 +0200 Subject: [PATCH 48/59] Make the exception RuntimeException --- .../ValueOnlySerializationException.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java index 6734fec1b..41299acbe 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java @@ -19,18 +19,36 @@ /** * This exception is thrown during the value-only serialization or deserialization. */ -public class ValueOnlySerializationException extends Exception { +public class ValueOnlySerializationException extends RuntimeException { private final String idShortPath; + /** + * The constructor. + * @param msg The exception message + * @param idShortPath the idShort path is a dot separated chain of idShorts, that can be used in case of + * troubleshooting. + */ public ValueOnlySerializationException(String msg, String idShortPath) { super(msg); this.idShortPath = idShortPath; } + + /** + * The constructor. + * @param msg The exception message. + * @param cause The root cause. + * @param idShortPath the idShort path is a dot separated chain of idShorts, that can be used in case of + * troubleshooting. + */ public ValueOnlySerializationException(String msg, Throwable cause, String idShortPath) { super(msg, cause); this.idShortPath = idShortPath; } + /** + * Return the corresponding idShort path. + * @return the idShort path is a dot separated chain of idShorts, that can be used in case of troubleshooting. + */ public String getIdShortPath() { return idShortPath; } From 70fb63b8c64b389162a38db1d5ac603e5cb2d08a Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 20 Jul 2023 16:00:13 +0200 Subject: [PATCH 49/59] Hide the constants --- .../dataformat/json/valueonly/RelationshipElementMapper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java index 7713fe698..1b5f3f4e8 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java @@ -32,8 +32,8 @@ * are serialized according to the serialization of a Reference. */ public class RelationshipElementMapper extends AbstractMapper { - public static final String FIRST = "first"; - public static final String SECOND = "second"; + private static final String FIRST = "first"; + private static final String SECOND = "second"; RelationshipElementMapper(RelationshipElement relationship, String idShortPath) { super(relationship, idShortPath); From 120ad8be9c2fc066d7e4ef421075bfd14dfc557b Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 20 Jul 2023 16:49:26 +0200 Subject: [PATCH 50/59] Make AnnotatedRelationshipMapper a subclass of RelationshipMapper --- .../AnnotatedRelationshipMapper.java | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java index 6fd93ab64..8847e9e62 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java @@ -17,27 +17,22 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.ArrayList; import java.util.List; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.serializer; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.deserializer; - /** * AnnotatedRelationshipElement is serialized according to the serialization of a ReleationshipElement. Additionally, a * third named JSON object is introduced with "annotations" as the name of the containing JSON property. The value is * ${AnnotatedRelationshipElement/annotations}. The values of the array items are serialized depending on the type of * the annotation data element. */ -public class AnnotatedRelationshipMapper extends AbstractMapper { - private static final String FIRST = "first"; - private static final String SECOND = "second"; +public class AnnotatedRelationshipMapper extends RelationshipElementMapper { private static final String ANNOTATIONS = "annotations"; AnnotatedRelationshipMapper(AnnotatedRelationshipElement relationship, String idShortPath) { super(relationship, idShortPath); @@ -45,10 +40,8 @@ public class AnnotatedRelationshipMapper extends AbstractMapper annotations = new ArrayList<>(element.getAnnotations()); + ObjectNode node = (ObjectNode) super.toJson(); + List annotations = new ArrayList<>(((AnnotatedRelationshipElement)element).getAnnotations()); if(annotations.size() > 0) { ElementsListMapper listMapper = new ElementsListMapper( annotations, idShortPath + "." + ANNOTATIONS); @@ -59,16 +52,14 @@ public JsonNode toJson() throws ValueOnlySerializationException { @Override public void update(JsonNode valueOnly) throws ValueOnlySerializationException { - element.setFirst(deserializer.parseReference(valueOnly.get(FIRST), idShortPath)); - element.setSecond(deserializer.parseReference(valueOnly.get(SECOND), idShortPath)); - + super.update(valueOnly); + List annotations = ((AnnotatedRelationshipElement)element).getAnnotations(); JsonNode annotationsNode = valueOnly.get(ANNOTATIONS); if(annotationsNode == null || annotationsNode.isNull()) { - element.getAnnotations().clear(); + annotations.clear(); } else { - List annotations = new ArrayList<>(element.getAnnotations()); - ElementsListMapper listMapper = new ElementsListMapper( - annotations, idShortPath + "." + ANNOTATIONS); + List elements = new ArrayList<>(annotations); + ElementsListMapper listMapper = new ElementsListMapper(elements, idShortPath + "." + ANNOTATIONS); listMapper.update(annotationsNode); } } From b22b990ed290883d67a37a6d13ce4f550650cfa2 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 20 Jul 2023 16:55:11 +0200 Subject: [PATCH 51/59] Correct the Javadoc --- .../v3/dataformat/json/valueonly/ValueOnlyMapper.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java index fe00f0d51..b810d8a0f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java @@ -24,7 +24,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; /** * This class implements the value-only Serialization in JSON format, as described in section 11.4.2 of Note:The update is not an atomic operation and if an exception is thrown, the corresponding element - * will be in an inconsistent state. If you cannot handle such situations, pass a copy of the original element. * @param element the submodel element to be serialized. Not null. * @return the corresponding value-only JSON string. */ @@ -137,6 +134,8 @@ public String toValueOnly(SubmodelElement element) throws ValueOnlySerialization /** * Update an existing submodel element with the given valueOnly. + *
    Note:The update is not an atomic operation and if an exception is thrown, the corresponding element + * will be in an inconsistent state. If you cannot handle such situations, pass a copy of the original element. * @param element The submodel element to be updated. If you want to prevent the direct modification of the original * submodel element, just use the corresponding copy constructor, when you pass this argument. * Not null. From f0ee90d208e746cc1ebf10f05e4b3747b2823dd6 Mon Sep 17 00:00:00 2001 From: arnoweiss Date: Fri, 21 Jul 2023 09:33:07 +0200 Subject: [PATCH 52/59] Update value-only test-files --- .../dataformat/json/valueonly/TestData.java | 24 ++----- .../json/valueonly/ValueOnlyMapperTest.java | 11 ++-- .../valueonly/ann_relationship_element.json | 66 +++++++++++-------- .../valueonly/date_time_property.json | 4 +- .../valueonly/element_collection.json | 8 ++- .../resources/valueonly/element_list.json | 15 +++-- .../src/test/resources/valueonly/entity.json | 8 ++- .../resources/valueonly/property_double.json | 3 + .../resources/valueonly/property_int.json | 3 + .../valueonly/ref_element_global.json | 28 ++++---- .../test/resources/valueonly/submodel.json | 12 +++- 11 files changed, 105 insertions(+), 77 deletions(-) create mode 100644 dataformat-json/src/test/resources/valueonly/property_double.json create mode 100644 dataformat-json/src/test/resources/valueonly/property_int.json diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java index 106f3cf0c..c7b3d8f8f 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java @@ -32,32 +32,18 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; import java.time.ZoneOffset; import java.time.ZonedDateTime; +import java.util.List; public class TestData { public static final Entity ENTITY = new DefaultEntity.Builder() - .idShort("entity1") - .entityType(EntityType.SELF_MANAGED_ENTITY) - .globalAssetId("Global Asset Id") + .idShort("entity1") + .entityType(EntityType.SELF_MANAGED_ENTITY) + .globalAssetId("Global Asset Id") .statements(new DefaultProperty.Builder() .idShort("MaxRotationSpeed") .valueType(DataTypeDefXsd.INT) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java index 445f9e206..ba613b181 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java @@ -54,9 +54,10 @@ public void testSerializeEntity() throws IOException, ValueOnlySerializationExce } @Test - public void testSerializeProperty() throws ValueOnlySerializationException { + public void testSerializeProperty() throws ValueOnlySerializationException, IOException, JSONException { String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_INT); - assertEquals("42", valueOnly); + String expected = readValueOnlyFile("property_int.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test @@ -88,9 +89,10 @@ public void testSerializeMultiLangProperty() throws IOException, ValueOnlySerial } @Test - public void testSerializePropertyDouble() throws ValueOnlySerializationException, JSONException { + public void testSerializePropertyDouble() throws ValueOnlySerializationException, JSONException, IOException { String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_DOUBLE); - JSONAssert.assertEquals("42.17", valueOnly, JSONCompareMode.NON_EXTENSIBLE); + String expected = readValueOnlyFile("property_double.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test @@ -119,6 +121,7 @@ public void testSerializeCollectionElement() throws IOException, ValueOnlySerial String valueOnly = valueOnlyMapper.toValueOnly(TestData.ELEMENT_COLLECTION); String expected = readValueOnlyFile("element_collection.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + // failing } @Test diff --git a/dataformat-json/src/test/resources/valueonly/ann_relationship_element.json b/dataformat-json/src/test/resources/valueonly/ann_relationship_element.json index 66542bce2..e0ebd5764 100644 --- a/dataformat-json/src/test/resources/valueonly/ann_relationship_element.json +++ b/dataformat-json/src/test/resources/valueonly/ann_relationship_element.json @@ -1,30 +1,42 @@ { - "first" : { - "referredSemanticId" : { - "keys" : [ { - "type" : "ConceptDescription", - "value" : "Concept Description key value" - } ], - "type" : "ExternalReference" + "annotatedRelationship1": { + "first": { + "referredSemanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "Concept Description key value" + } + ], + "type": "ExternalReference" + }, + "keys": [ + { + "type": "GlobalReference", + "value": "global reference key value" + } + ], + "type": "ExternalReference" }, - "keys" : [ { - "type" : "GlobalReference", - "value" : "global reference key value" - } ], - "type" : "ExternalReference" - }, - "second" : { - "keys" : [ { - "type" : "Property", - "value" : "MaxRotationSpeed" - } ], - "type" : "ModelReference" - }, - "annotations" : [ - "2022-07-31T17:08:51Z", - { - "min" : 17, - "max" : 42 - } - ] + "second": { + "keys": [ + { + "type": "Property", + "value": "MaxRotationSpeed" + } + ], + "type": "ModelReference" + }, + "annotations": [ + { + "propDateTime": "2022-07-31T17:08:51Z" + }, + { + "rangeInt": { + "min": 17, + "max": 42 + } + } + ] + } } \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/date_time_property.json b/dataformat-json/src/test/resources/valueonly/date_time_property.json index 5d4b426cf..eb26358e0 100644 --- a/dataformat-json/src/test/resources/valueonly/date_time_property.json +++ b/dataformat-json/src/test/resources/valueonly/date_time_property.json @@ -1 +1,3 @@ -"2022-07-31T17:08:51Z" \ No newline at end of file +{ + "propDateTime": "2022-07-31T17:08:51Z" +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/element_collection.json b/dataformat-json/src/test/resources/valueonly/element_collection.json index 25add3e13..5b338df3f 100644 --- a/dataformat-json/src/test/resources/valueonly/element_collection.json +++ b/dataformat-json/src/test/resources/valueonly/element_collection.json @@ -5,9 +5,11 @@ "max" : 5.0 }, "entity1" : { - "statements" : [ 5000 ], - "globalAssetId" : "Global Asset Id", - "entityType" : "SelfManagedEntity" + "statements": { + "maxRotationSpeed": 5000 + }, + "globalAssetId": "Global Asset Id", + "entityType": "SelfManagedEntity" }, "relationship1" : { "first" : { diff --git a/dataformat-json/src/test/resources/valueonly/element_list.json b/dataformat-json/src/test/resources/valueonly/element_list.json index 20424db2c..a6d21d582 100644 --- a/dataformat-json/src/test/resources/valueonly/element_list.json +++ b/dataformat-json/src/test/resources/valueonly/element_list.json @@ -1,12 +1,19 @@ [ - "foo", { + "foo", + { "min" : 3.0, "max" : 5.0 }, { - "statements" : [ 5000 ], - "globalAssetId" : "Global Asset Id", - "entityType" : "SelfManagedEntity" + "statements": { + "MaxRotationSpeed": 5000 + }, + "globalAssetId": "Global Asset Id", + "specificAssetIds": { + "firstIdType": "someId", + "secondIdType": "someOtherId" + }, + "entityType": "SelfManagedEntity" }, { "first" : { diff --git a/dataformat-json/src/test/resources/valueonly/entity.json b/dataformat-json/src/test/resources/valueonly/entity.json index 20a799db7..129ce2b1e 100644 --- a/dataformat-json/src/test/resources/valueonly/entity.json +++ b/dataformat-json/src/test/resources/valueonly/entity.json @@ -1,5 +1,7 @@ { - "statements" : [ 5000 ], - "globalAssetId" : "Global Asset Id", - "entityType" : "SelfManagedEntity" + "statements": { + "MaxRotationSpeed": 5000 + }, + "globalAssetId": "Global Asset Id", + "entityType": "SelfManagedEntity" } \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/property_double.json b/dataformat-json/src/test/resources/valueonly/property_double.json new file mode 100644 index 000000000..324d35171 --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/property_double.json @@ -0,0 +1,3 @@ +{ + "propDouble": "42.17" +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/property_int.json b/dataformat-json/src/test/resources/valueonly/property_int.json new file mode 100644 index 000000000..28dc7782f --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/property_int.json @@ -0,0 +1,3 @@ +{ + "propInt": "42" +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/ref_element_global.json b/dataformat-json/src/test/resources/valueonly/ref_element_global.json index 57cc49811..05c86e833 100644 --- a/dataformat-json/src/test/resources/valueonly/ref_element_global.json +++ b/dataformat-json/src/test/resources/valueonly/ref_element_global.json @@ -1,18 +1,20 @@ { - "referredSemanticId" : { - "keys" : [ + "referenceGlobal": { + "referredSemanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "Concept Description key value" + } + ], + "type": "ExternalReference" + }, + "keys": [ { - "type" : "ConceptDescription", - "value" : "Concept Description key value" + "type": "GlobalReference", + "value": "global reference key value" } ], - "type" : "ExternalReference" - }, - "keys" : [ - { - "type" : "GlobalReference", - "value" : "global reference key value" - } - ], - "type" : "ExternalReference" + "type": "ExternalReference" + } } \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/submodel.json b/dataformat-json/src/test/resources/valueonly/submodel.json index da8354cda..1d9ac718d 100644 --- a/dataformat-json/src/test/resources/valueonly/submodel.json +++ b/dataformat-json/src/test/resources/valueonly/submodel.json @@ -11,9 +11,15 @@ "max" : 5.0 }, "entity1" : { - "statements" : [ 5000 ], - "globalAssetId" : "Global Asset Id", - "entityType" : "SelfManagedEntity" + "statements": { + "MaxRotationSpeed": 5000 + }, + "globalAssetId": "Global Asset Id", + "specificAssetIds": { + "firstIdType": "someId", + "secondIdType": "someOtherId" + }, + "entityType": "SelfManagedEntity" }, "relationship1" : { "first" : { From 809b8571e1fcb2c295d99d44c23401891b75ce7f Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 21 Jul 2023 10:28:48 +0200 Subject: [PATCH 53/59] Reduce the class visibility --- .../aas4j/v3/dataformat/json/valueonly/AbstractMapper.java | 2 +- .../dataformat/json/valueonly/AnnotatedRelationshipMapper.java | 2 +- .../v3/dataformat/json/valueonly/BasicEventElementMapper.java | 2 +- .../v3/dataformat/json/valueonly/ElementsCollectionMapper.java | 2 +- .../aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java | 2 +- .../aas4j/v3/dataformat/json/valueonly/EntityMapper.java | 2 +- .../dataformat/json/valueonly/MultiLanguagePropertyMapper.java | 2 +- .../aas4j/v3/dataformat/json/valueonly/PropertyMapper.java | 2 +- .../aas4j/v3/dataformat/json/valueonly/RangeMapper.java | 2 +- .../v3/dataformat/json/valueonly/ReferenceElementMapper.java | 2 +- .../v3/dataformat/json/valueonly/RelationshipElementMapper.java | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java index c35bf0bb6..f85f92c87 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java @@ -22,7 +22,7 @@ * The abstract base class for all value-only mappers. * @param The type of the mapped elements. */ -public abstract class AbstractMapper { +abstract class AbstractMapper { protected final T element; protected final String idShortPath; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java index 8847e9e62..771cd7d64 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java @@ -32,7 +32,7 @@ * ${AnnotatedRelationshipElement/annotations}. The values of the array items are serialized depending on the type of * the annotation data element. */ -public class AnnotatedRelationshipMapper extends RelationshipElementMapper { +class AnnotatedRelationshipMapper extends RelationshipElementMapper { private static final String ANNOTATIONS = "annotations"; AnnotatedRelationshipMapper(AnnotatedRelationshipElement relationship, String idShortPath) { super(relationship, idShortPath); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java index 8f940e05c..2d65267da 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java @@ -29,7 +29,7 @@ * JSON property. The JSON object contains one JSON property named “observed” with the corresponding value of * ${BasicEventElement/observed} as the standard serialization of the Reference class. */ -public class BasicEventElementMapper extends AbstractMapper { +class BasicEventElementMapper extends AbstractMapper { private static final String OBSERVED = "observed"; BasicEventElementMapper(BasicEventElement event, String idShortPath) { diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java index b16e9c14e..6ad41b39d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java @@ -41,7 +41,7 @@ * the containing JSON property. The elements contained within the struct are serialized according to their respective * type with ${SubmodelElement/idShort} as the name of the containing JSON property. */ -public class ElementsCollectionMapper extends AbstractMapper> { +class ElementsCollectionMapper extends AbstractMapper> { ElementsCollectionMapper(List elements, String idShortPath) { super(elements, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java index 92718d4a2..887b03ebf 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java @@ -30,7 +30,7 @@ * SubmodelElementList is serialized as a JSON array with the index of the contained SubmodelElement in the list as the * position in the JSON array. The elements contained within the list are serialized according to their respective type. */ -public class ElementsListMapper extends ElementsCollectionMapper { +class ElementsListMapper extends ElementsCollectionMapper { ElementsListMapper(List elements, String idShortPath) { super(elements, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java index f6b5237ac..efaebde9f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java @@ -38,7 +38,7 @@ * JSON key and “value” for the JSON value. The third property is named “entityType” and contains a string * representation of ${Entity/entityType}. */ -public class EntityMapper extends AbstractMapper { +class EntityMapper extends AbstractMapper { private static final String STATEMENTS = "statements"; private static final String GLOBAL_ASSET_ID = "globalAssetId"; private static final String SPECIFIC_ASSET_ID = "specificAssetId"; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java index 92c779143..81133d4f6 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java @@ -34,7 +34,7 @@ * MultiLanguageProperty with the language as name and the corresponding localized string as value of the respective * JSON property. The language name is defined as two chars according to ISO 639-1. */ -public class MultiLanguagePropertyMapper extends AbstractMapper { +class MultiLanguagePropertyMapper extends AbstractMapper { MultiLanguagePropertyMapper(MultiLanguageProperty property, String idShortPath) { super(property, idShortPath); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java index 8ae66af35..6217bcc2f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java @@ -25,7 +25,7 @@ * of the respective property’s value in accordance with the data type to value mapping. * @see ValueConverter */ -public class PropertyMapper extends AbstractMapper { +class PropertyMapper extends AbstractMapper { PropertyMapper(Property property, String idShortPath) { super(property, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java index f0e6b051f..6a285b0a1 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java @@ -28,7 +28,7 @@ * object contains two JSON properties. The first is named "min". The second is named "max". Their corresponding values * are ${Range/min} and ${Range/max}. */ -public class RangeMapper extends AbstractMapper { +class RangeMapper extends AbstractMapper { private static final String MIN = "min"; private static final String MAX = "max"; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java index 61c3b3421..0776a79d7 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java @@ -27,7 +27,7 @@ * ReferenceElement is serialized as ${ReferenceElement/idShort}: ${ReferenceElement/value} where * ${ReferenceElement/value} is the serialization of the Reference class. */ -public class ReferenceElementMapper extends AbstractMapper { +class ReferenceElementMapper extends AbstractMapper { ReferenceElementMapper(ReferenceElement element, String idShortPath) { super(element, idShortPath); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java index 1b5f3f4e8..68514b7f3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java @@ -31,7 +31,7 @@ * named "second". Their corresponding values are ${RelationshipElement/first} resp. ${Relationship/second}. The values * are serialized according to the serialization of a Reference. */ -public class RelationshipElementMapper extends AbstractMapper { +class RelationshipElementMapper extends AbstractMapper { private static final String FIRST = "first"; private static final String SECOND = "second"; From 452375af6026bbcdbc78434c7040d866bfc4fc2a Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 21 Jul 2023 10:48:32 +0200 Subject: [PATCH 54/59] Change the methods visibility to package-private. --- .../json/valueonly/AnnotatedRelationshipMapper.java | 4 ++-- .../v3/dataformat/json/valueonly/BasicEventElementMapper.java | 4 ++-- .../aas4j/v3/dataformat/json/valueonly/BlobMapper.java | 4 ++-- .../dataformat/json/valueonly/ElementsCollectionMapper.java | 4 ++-- .../v3/dataformat/json/valueonly/ElementsListMapper.java | 4 ++-- .../aas4j/v3/dataformat/json/valueonly/EntityMapper.java | 4 ++-- .../aas4j/v3/dataformat/json/valueonly/FileMapper.java | 4 ++-- .../json/valueonly/MultiLanguagePropertyMapper.java | 4 ++-- .../aas4j/v3/dataformat/json/valueonly/PropertyMapper.java | 4 ++-- .../aas4j/v3/dataformat/json/valueonly/RangeMapper.java | 4 ++-- .../v3/dataformat/json/valueonly/ReferenceElementMapper.java | 4 ++-- .../dataformat/json/valueonly/RelationshipElementMapper.java | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java index 771cd7d64..14cc24419 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java @@ -39,7 +39,7 @@ class AnnotatedRelationshipMapper extends RelationshipElementMapper { } @Override - public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = (ObjectNode) super.toJson(); List annotations = new ArrayList<>(((AnnotatedRelationshipElement)element).getAnnotations()); if(annotations.size() > 0) { @@ -51,7 +51,7 @@ public JsonNode toJson() throws ValueOnlySerializationException { } @Override - public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + void update(JsonNode valueOnly) throws ValueOnlySerializationException { super.update(valueOnly); List annotations = ((AnnotatedRelationshipElement)element).getAnnotations(); JsonNode annotationsNode = valueOnly.get(ANNOTATIONS); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java index 2d65267da..42bd26851 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java @@ -37,14 +37,14 @@ class BasicEventElementMapper extends AbstractMapper { } @Override - public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); node.set(OBSERVED, serializer.toJson(element.getObserved())); return node; } @Override - public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + void update(JsonNode valueOnly) throws ValueOnlySerializationException { element.setObserved(deserializer.parseReference(valueOnly.get(OBSERVED), idShortPath)); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java index 17f6c29bd..48e0cde17 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java @@ -41,7 +41,7 @@ class BlobMapper extends AbstractMapper { } @Override - public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); node.set(CONTENT_TYPE, new TextNode(element.getContentType())); node.set(VALUE, new TextNode(Base64.getEncoder().encodeToString(element.getValue()))); @@ -49,7 +49,7 @@ public JsonNode toJson() throws ValueOnlySerializationException { } @Override - public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + void update(JsonNode valueOnly) throws ValueOnlySerializationException { JsonNode contentNode = valueOnly.get(CONTENT_TYPE); if(contentNode == null || contentNode.isNull()) { element.setContentType(null); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java index 6ad41b39d..0ea83327d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java @@ -47,7 +47,7 @@ class ElementsCollectionMapper extends AbstractMapper> { } @Override - public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); for(SubmodelElement submodelElement : element) { String idShort = submodelElement.getIdShort(); @@ -66,7 +66,7 @@ public JsonNode toJson() throws ValueOnlySerializationException { } @Override - public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + void update(JsonNode valueOnly) throws ValueOnlySerializationException { if(!valueOnly.isObject()) { throw new ValueOnlySerializationException( "Cannot update the submodel elements collection at idShort path '" + idShortPath + diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java index 887b03ebf..3fa7f9b9c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java @@ -36,7 +36,7 @@ class ElementsListMapper extends ElementsCollectionMapper { } @Override - public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode toJson() throws ValueOnlySerializationException { ArrayNode arrayNode = JsonNodeFactory.instance.arrayNode(); for(int i = 0; i < element.size(); i++) { SubmodelElement submodelElement = element.get(i); @@ -47,7 +47,7 @@ public JsonNode toJson() throws ValueOnlySerializationException { } @Override - public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + void update(JsonNode valueOnly) throws ValueOnlySerializationException { if(!valueOnly.isArray()) { throw new ValueOnlySerializationException( "Cannot update the submodel elements list at idShort path '" + idShortPath + diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java index efaebde9f..20e896b65 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java @@ -49,7 +49,7 @@ class EntityMapper extends AbstractMapper { } @Override - public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); ElementsListMapper statementsMapper = new ElementsListMapper( element.getStatements(), idShortPath + "." + STATEMENTS); @@ -71,7 +71,7 @@ public JsonNode toJson() throws ValueOnlySerializationException { } @Override - public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + void update(JsonNode valueOnly) throws ValueOnlySerializationException { JsonNode statementsNode = valueOnly.get(STATEMENTS); if(statementsNode == null) { element.getStatements().clear(); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java index c2934ee41..6bbb41972 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java @@ -41,7 +41,7 @@ class FileMapper extends AbstractMapper { } @Override - public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); node.set(CONTENT_TYPE, new TextNode(element.getContentType())); node.set(VALUE, new TextNode(element.getValue())); @@ -49,7 +49,7 @@ public JsonNode toJson() throws ValueOnlySerializationException { } @Override - public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + void update(JsonNode valueOnly) throws ValueOnlySerializationException { JsonNode contentNode = valueOnly.get(CONTENT_TYPE); if(contentNode == null || contentNode.isNull()) { element.setContentType(null); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java index 81133d4f6..d9a867455 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java @@ -41,7 +41,7 @@ class MultiLanguagePropertyMapper extends AbstractMapper } @Override - public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode toJson() throws ValueOnlySerializationException { List langTexts = element.getValue(); if(langTexts == null || langTexts.size() == 0) { return NullNode.instance; @@ -54,7 +54,7 @@ public JsonNode toJson() throws ValueOnlySerializationException { } @Override - public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + void update(JsonNode valueOnly) throws ValueOnlySerializationException { if(!valueOnly.isObject()) { throw new ValueOnlySerializationException( "Cannot update the multi-language property at idShort path '" + idShortPath + diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java index 6217bcc2f..a7ad2f858 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java @@ -31,7 +31,7 @@ class PropertyMapper extends AbstractMapper { } @Override - public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode toJson() throws ValueOnlySerializationException { try { return ValueConverter.convert(element.getValueType(), element.getValue()); } catch (NumberFormatException ex) { @@ -41,7 +41,7 @@ public JsonNode toJson() throws ValueOnlySerializationException { } @Override - public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + void update(JsonNode valueOnly) throws ValueOnlySerializationException { element.setValue(readValueAsString("Cannot update the property", idShortPath, valueOnly)); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java index 6a285b0a1..711a34ccd 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java @@ -37,7 +37,7 @@ class RangeMapper extends AbstractMapper { } @Override - public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode toJson() throws ValueOnlySerializationException { try { ObjectNode node = JsonNodeFactory.instance.objectNode(); DataTypeDefXsd valueType = element.getValueType(); @@ -51,7 +51,7 @@ public JsonNode toJson() throws ValueOnlySerializationException { } @Override - public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + void update(JsonNode valueOnly) throws ValueOnlySerializationException { element.setMax(PropertyMapper.readValueAsString("Cannot update Range." + MAX, idShortPath, valueOnly.get(MAX))); element.setMin(PropertyMapper.readValueAsString("Cannot update Range." + MIN, idShortPath, valueOnly.get(MIN))); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java index 0776a79d7..f4c973a17 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java @@ -33,12 +33,12 @@ class ReferenceElementMapper extends AbstractMapper { } @Override - public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode toJson() throws ValueOnlySerializationException { return serializer.toJson(element.getValue()); } @Override - public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + void update(JsonNode valueOnly) throws ValueOnlySerializationException { element.setValue(deserializer.parseReference(valueOnly, idShortPath)); } } \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java index 68514b7f3..bacf037bb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java @@ -40,7 +40,7 @@ class RelationshipElementMapper extends AbstractMapper { } @Override - public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); node.set(FIRST, serializer.toJson(element.getFirst())); node.set(SECOND, serializer.toJson(element.getSecond())); @@ -48,7 +48,7 @@ public JsonNode toJson() throws ValueOnlySerializationException { } @Override - public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + void update(JsonNode valueOnly) throws ValueOnlySerializationException { element.setFirst(deserializer.parseReference(valueOnly.get(FIRST), idShortPath + "." + FIRST)); element.setSecond(deserializer.parseReference(valueOnly.get(SECOND), idShortPath + "." + SECOND)); } From 497449eee4beae525663f82acf8b4b6c9438ebf5 Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Tue, 25 Jul 2023 14:55:41 +0200 Subject: [PATCH 55/59] split ValueOnlyMapper into JsonValueOnlySerialiser and JsonValueOnlyDeserialiser --- .../valueonly/BasicEventElementMapper.java | 7 +- .../valueonly/JsonValueOnlyDeserialiser.java | 112 +++++++++ ...pper.java => JsonValueOnlySerialiser.java} | 47 ++-- .../valueonly/ReferenceElementMapper.java | 8 +- .../valueonly/RelationshipElementMapper.java | 13 +- .../JsonValueOnlyDeserialiserTest.java | 136 +++++++++++ .../JsonValueOnlySerialiserTest.java | 133 ++++++++++ .../json/valueonly/ValueOnlyMapperTest.java | 229 ------------------ 8 files changed, 407 insertions(+), 278 deletions(-) create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/{ValueOnlyMapper.java => JsonValueOnlySerialiser.java} (77%) create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java index 42bd26851..c4bddeca2 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java @@ -21,9 +21,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.serializer; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.deserializer; - /** * BasicEventElement is serialized as named JSON object with ${BasicEventElement/idShort} as the name of the containing * JSON property. The JSON object contains one JSON property named “observed” with the corresponding value of @@ -39,12 +36,12 @@ class BasicEventElementMapper extends AbstractMapper { @Override JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); - node.set(OBSERVED, serializer.toJson(element.getObserved())); + node.set(OBSERVED, new JsonValueOnlyDeserialiser().toJson(element.getObserved())); return node; } @Override void update(JsonNode valueOnly) throws ValueOnlySerializationException { - element.setObserved(deserializer.parseReference(valueOnly.get(OBSERVED), idShortPath)); + element.setObserved(new JsonValueOnlyDeserialiser().deserialiseReference(valueOnly.get(OBSERVED), idShortPath)); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java new file mode 100644 index 000000000..34719ef24 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +/** + * This class implements the value-only Serialization in JSON format, as described in section 11.4.2 of
    + * AAS Specification Part 2
    + * + * Values are only available for: + *
      + *
    1. All subtypes of abstract type DataElement
    2. + *
    3. SubmodelElementList and SubmodelElementCollection respectively for their included SubmodelElements
    4. + *
    5. ReferenceElement
    6. + *
    7. RelationshipElement + AnnotatedRelationshipElement
    8. + *
    9. Entity
    10. + *
    11. BasicEventElement
    12. + *
    + */ +public class JsonValueOnlyDeserialiser extends JsonDeserializer { + + JsonNode toJson(Reference reference) { + return mapper.valueToTree(reference) ; + } + + JsonNode readTree(String jsonString) throws ValueOnlySerializationException { + try { + return mapper.readTree(jsonString); + } catch (JsonProcessingException e) { + throw new ValueOnlySerializationException("Cannot parse the value only string: ", e, "$"); + } + + } + + + public Reference deserialiseReference(JsonNode refNode, String idShortPath) throws ValueOnlySerializationException { + if(refNode == null) { + return null; + } + try { + return mapper.treeToValue(refNode, Reference.class); + } catch (JsonProcessingException e) { + throw new ValueOnlySerializationException( + "Cannot deserialize a reference at idShort path + '" + idShortPath + "'.", e, idShortPath); + } + } + + + + /** + * The default constructor creates a value-only mapper which serializes and deserializes submodels and submodel + * elements to a compact value-only JSON string. + */ + public JsonValueOnlyDeserialiser() { + + } + + + + /** + * Update an existing submodel with the given value-only JSON string. + *
    Note:The update is not an atomic operation and if an exception is thrown, the corresponding submodel + * will be in an inconsistent state. If you cannot handle such situations, pass a copy of the original submodel. + * @param submodel The submodel to be updated. If you want to prevent the direct modification of the original + * submodel, just use the corresponding copy constructor, when you pass this argument. Not null. + * @param valueOnly the valueOnly string. Not null. + * + */ + public void deserialise(Submodel submodel, String valueOnly) throws ValueOnlySerializationException { + JsonNode node = readTree(valueOnly); + ElementsCollectionMapper mapper = new ElementsCollectionMapper(submodel.getSubmodelElements(), "$"); + mapper.update(node); + } + + + /** + * Update an existing submodel element with the given valueOnly. + *
    Note:The update is not an atomic operation and if an exception is thrown, the corresponding element + * will be in an inconsistent state. If you cannot handle such situations, pass a copy of the original element. + * @param element The submodel element to be updated. If you want to prevent the direct modification of the original + * submodel element, just use the corresponding copy constructor, when you pass this argument. + * Not null. + * @param valueOnly the valueOnly string. Not null. + */ + public void deserialise(SubmodelElement element, String valueOnly) throws ValueOnlySerializationException { + JsonNode node = readTree(valueOnly); + AbstractMapper mapper = ElementsCollectionMapper.createMapper(element, "$"); + mapper.update(node); + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiser.java similarity index 77% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiser.java index b810d8a0f..92ae6d14f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiser.java @@ -19,7 +19,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; @@ -40,45 +39,29 @@ *
  • BasicEventElement
  • * */ -public class ValueOnlyMapper { - static class ValueOnlySerializer extends JsonSerializer { - JsonNode toJson(Reference reference) { - return mapper.valueToTree(reference); - } - JsonNode readTree(String jsonString) throws ValueOnlySerializationException { +public class JsonValueOnlySerialiser extends JsonSerializer { + + private final boolean prettyString; + + JsonNode toJson(Reference reference) { + return mapper.valueToTree(reference) ; + } + + JsonNode readTree(String jsonString) throws ValueOnlySerializationException { try { return mapper.readTree(jsonString); } catch (JsonProcessingException e) { throw new ValueOnlySerializationException("Cannot parse the value only string: ", e, "$"); } - } - } - static class ValueOnlyDeserializer extends JsonDeserializer { - Reference parseReference(JsonNode refNode, String idShortPath) throws ValueOnlySerializationException { - if(refNode == null) { - return null; - } - try { - return mapper.treeToValue(refNode, Reference.class); - } catch (JsonProcessingException e) { - throw new ValueOnlySerializationException( - "Cannot deserialize a reference at idShort path + '" + idShortPath + "'.", e, idShortPath); - } - } } - private final boolean prettyString; - - final static ValueOnlySerializer serializer = new ValueOnlySerializer(); - final static ValueOnlyDeserializer deserializer = new ValueOnlyDeserializer(); - /** * The default constructor creates a value-only mapper which serializes and deserializes submodels and submodel * elements to a compact value-only JSON string. */ - public ValueOnlyMapper() { + public JsonValueOnlySerialiser() { this(false); } @@ -86,7 +69,7 @@ public ValueOnlyMapper() { * Creates a value-only mapper. * @param prettyString pass true, if you want to have a pretty formatted value-only JSON strings. */ - public ValueOnlyMapper(boolean prettyString) { + public JsonValueOnlySerialiser(boolean prettyString) { this.prettyString = prettyString; } @@ -95,7 +78,7 @@ public ValueOnlyMapper(boolean prettyString) { * @param submodel the submodel to be serialized. Not null. * @return the corresponding value-only JSON string. */ - public String toValueOnly(Submodel submodel) throws ValueOnlySerializationException { + public String serialise(Submodel submodel) throws ValueOnlySerializationException { ElementsCollectionMapper mapper = new ElementsCollectionMapper(submodel.getSubmodelElements(), "$"); JsonNode node = mapper.toJson(); return prettyString ? node.toPrettyString() : node.toString(); @@ -111,7 +94,7 @@ public String toValueOnly(Submodel submodel) throws ValueOnlySerializationExcept * */ public void update(Submodel submodel, String valueOnly) throws ValueOnlySerializationException { - JsonNode node = serializer.readTree(valueOnly); + JsonNode node = readTree(valueOnly); ElementsCollectionMapper mapper = new ElementsCollectionMapper(submodel.getSubmodelElements(), "$"); mapper.update(node); } @@ -121,7 +104,7 @@ public void update(Submodel submodel, String valueOnly) throws ValueOnlySerializ * @param element the submodel element to be serialized. Not null. * @return the corresponding value-only JSON string. */ - public String toValueOnly(SubmodelElement element) throws ValueOnlySerializationException { + public String serialise(SubmodelElement element) throws ValueOnlySerializationException { AbstractMapper mapper = ElementsCollectionMapper.createMapper(element, "$"); if(mapper == null) { throw new ValueOnlySerializationException( @@ -142,7 +125,7 @@ public String toValueOnly(SubmodelElement element) throws ValueOnlySerialization * @param valueOnly the valueOnly string. Not null. */ public void update(SubmodelElement element, String valueOnly) throws ValueOnlySerializationException { - JsonNode node = serializer.readTree(valueOnly); + JsonNode node = readTree(valueOnly); AbstractMapper mapper = ElementsCollectionMapper.createMapper(element, "$"); mapper.update(node); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java index f4c973a17..58cc31543 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java @@ -20,25 +20,23 @@ import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.serializer; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.deserializer; - /** * ReferenceElement is serialized as ${ReferenceElement/idShort}: ${ReferenceElement/value} where * ${ReferenceElement/value} is the serialization of the Reference class. */ class ReferenceElementMapper extends AbstractMapper { + ReferenceElementMapper(ReferenceElement element, String idShortPath) { super(element, idShortPath); } @Override JsonNode toJson() throws ValueOnlySerializationException { - return serializer.toJson(element.getValue()); + return new JsonValueOnlySerialiser().toJson(element.getValue()); } @Override void update(JsonNode valueOnly) throws ValueOnlySerializationException { - element.setValue(deserializer.parseReference(valueOnly, idShortPath)); + element.setValue(new JsonValueOnlyDeserialiser().deserialiseReference(valueOnly, idShortPath)); } } \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java index bacf037bb..bda7c36bf 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java @@ -22,9 +22,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.serializer; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly.ValueOnlyMapper.deserializer; - /** * RelationshipElement is serialized as named JSON object with ${RelationshipElement/idShort} as the name of the * containing JSON property. The JSON object contains two JSON properties. The first is named "first". The second is @@ -42,14 +39,16 @@ class RelationshipElementMapper extends AbstractMapper { @Override JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); - node.set(FIRST, serializer.toJson(element.getFirst())); - node.set(SECOND, serializer.toJson(element.getSecond())); + JsonValueOnlySerialiser serialiser = new JsonValueOnlySerialiser(); + node.set(FIRST, serialiser.toJson(element.getFirst())); + node.set(SECOND, serialiser.toJson(element.getSecond())); return node; } @Override void update(JsonNode valueOnly) throws ValueOnlySerializationException { - element.setFirst(deserializer.parseReference(valueOnly.get(FIRST), idShortPath + "." + FIRST)); - element.setSecond(deserializer.parseReference(valueOnly.get(SECOND), idShortPath + "." + SECOND)); + JsonValueOnlyDeserialiser deserialiser = new JsonValueOnlyDeserialiser(); + element.setFirst(deserialiser.deserialiseReference(valueOnly.get(FIRST), idShortPath + "." + FIRST)); + element.setSecond(deserialiser.deserialiseReference(valueOnly.get(SECOND), idShortPath + "." + SECOND)); } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java new file mode 100644 index 000000000..c2a6dced1 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import org.json.JSONException; +import org.junit.FixMethodOrder; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runners.MethodSorters; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +@Ignore // @TODO: activate again +public class JsonValueOnlyDeserialiserTest { + + private static JsonValueOnlyDeserialiser deserialiser = new JsonValueOnlyDeserialiser(); + private static JsonValueOnlySerialiser serialiser = new JsonValueOnlySerialiser(); + + @Test + public void testCreateDefaultMapper() throws IOException { + assertNotNull(new JsonValueOnlyDeserialiser()); + } + + @Test + public void testUpdateSubmodel() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.SUBMODEL_UPDATED); + deserialiser.deserialise(TestData.SUBMODEL, valueOnly); + assertEquals(TestData.SUBMODEL_UPDATED, TestData.SUBMODEL); + } + + @Test + public void testUpdateEntity() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.ENTITY_UPDATED); + deserialiser.deserialise(TestData.ENTITY, valueOnly); + assertEquals(TestData.ENTITY_UPDATED, TestData.ENTITY); + } + + @Test + public void testUpdateProperty() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.PROPERTY_INT_UPDATED); + deserialiser.deserialise(TestData.PROPERTY_INT, valueOnly); + assertEquals(TestData.PROPERTY_INT_UPDATED, TestData.PROPERTY_INT); + } + + @Test + public void testUpdateRange() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.RANGE_DOUBLE_UPDATED); + deserialiser.deserialise(TestData.RANGE_DOUBLE, valueOnly); + assertEquals(TestData.RANGE_DOUBLE_UPDATED, TestData.RANGE_DOUBLE); + } + + @Test + public void testUpdateBlob() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.BLOB_UPDATED); + deserialiser.deserialise(TestData.BLOB, valueOnly); + assertEquals(TestData.BLOB_UPDATED, TestData.BLOB); + } + + @Test + public void testUpdateFile() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.FILE_UPDATED); + deserialiser.deserialise(TestData.FILE, valueOnly); + assertEquals(TestData.FILE_UPDATED, TestData.FILE); + } + + @Test + public void testUpdateMultiLangProperty() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.MULTI_LANGUAGE_PROPERTY_UPDATED); + deserialiser.deserialise(TestData.MULTI_LANGUAGE_PROPERTY, valueOnly); + assertEquals(TestData.MULTI_LANGUAGE_PROPERTY_UPDATED, TestData.MULTI_LANGUAGE_PROPERTY); + } + + @Test + public void testUpdatePropertyDouble() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.PROPERTY_DOUBLE_UPDATED); + deserialiser.deserialise(TestData.PROPERTY_DOUBLE, valueOnly); + assertEquals(TestData.PROPERTY_DOUBLE_UPDATED, TestData.PROPERTY_DOUBLE); + } + + @Test + public void testUpdatePropertyDatetime() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.PROPERTY_DATETIME_UPDATED); + deserialiser.deserialise(TestData.PROPERTY_DATETIME, valueOnly); + assertEquals(TestData.PROPERTY_DATETIME_UPDATED, TestData.PROPERTY_DATETIME); + } + + @Test + public void testUpdateRefElementGlobal() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.REFERENCE_ELEMENT_GLOBAL_UPDATED); + deserialiser.deserialise(TestData.REFERENCE_ELEMENT_GLOBAL, valueOnly); + assertEquals(TestData.REFERENCE_ELEMENT_GLOBAL_UPDATED, TestData.REFERENCE_ELEMENT_GLOBAL); + } + + @Test + public void testUpdateAnnotatedRelationshipElement() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED); + deserialiser.deserialise(TestData.ANNOTATED_RELATIONSHIP_ELEMENT, valueOnly); + assertEquals(TestData.ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED, TestData.ANNOTATED_RELATIONSHIP_ELEMENT); + } + + @Test + public void testUpdateCollectionElement() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.ELEMENT_COLLECTION_UPDATED); + deserialiser.deserialise(TestData.ELEMENT_COLLECTION, valueOnly); + assertEquals(TestData.ELEMENT_COLLECTION_UPDATED, TestData.ELEMENT_COLLECTION); + } + + @Test + public void testUpdateListElement() throws ValueOnlySerializationException { + String valueOnly = serialiser.serialise(TestData.ELEMENT_LIST_UPDATED); + deserialiser.deserialise(TestData.ELEMENT_LIST, valueOnly); + assertEquals(TestData.ELEMENT_LIST_UPDATED, TestData.ELEMENT_LIST); + } + +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java new file mode 100644 index 000000000..9a45e7a65 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import org.json.JSONException; +import org.junit.FixMethodOrder; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runners.MethodSorters; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +@Ignore // @TODO: activate again +public class JsonValueOnlySerialiserTest { + private static final JsonValueOnlySerialiser serialiser = new JsonValueOnlySerialiser(true); + + + @Test + public void testSerializeSubmodel() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = serialiser.serialise(TestData.SUBMODEL); + String expected = readValueOnlyFile("submodel.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeEntity() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = serialiser.serialise(TestData.ENTITY); + String expected = readValueOnlyFile("entity.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeProperty() throws ValueOnlySerializationException, IOException, JSONException { + String valueOnly = serialiser.serialise(TestData.PROPERTY_INT); + String expected = readValueOnlyFile("property_int.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeRange() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = serialiser.serialise(TestData.RANGE_DOUBLE); + String expected = readValueOnlyFile("range.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeBlob() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = serialiser.serialise(TestData.BLOB); + String expected = readValueOnlyFile("blob.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeFile() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = serialiser.serialise(TestData.FILE); + String expected = readValueOnlyFile("file.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeMultiLangProperty() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = serialiser.serialise(TestData.MULTI_LANGUAGE_PROPERTY); + String expected = readValueOnlyFile("multi_lang_property.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializePropertyDouble() throws ValueOnlySerializationException, JSONException, IOException { + String valueOnly = serialiser.serialise(TestData.PROPERTY_DOUBLE); + String expected = readValueOnlyFile("property_double.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializePropertyDatetime() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = serialiser.serialise(TestData.PROPERTY_DATETIME); + String expected = readValueOnlyFile("date_time_property.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeRefElementGlobal() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = serialiser.serialise(TestData.REFERENCE_ELEMENT_GLOBAL); + String expected = readValueOnlyFile("ref_element_global.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeAnnotatedRelationshipElement() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = serialiser.serialise(TestData.ANNOTATED_RELATIONSHIP_ELEMENT); + String expected = readValueOnlyFile("ann_relationship_element.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + + @Test + public void testSerializeCollectionElement() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = serialiser.serialise(TestData.ELEMENT_COLLECTION); + String expected = readValueOnlyFile("element_collection.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + // failing + } + + @Test + public void testSerializeListElement() throws IOException, ValueOnlySerializationException, JSONException { + String valueOnly = serialiser.serialise(TestData.ELEMENT_LIST); + String expected = readValueOnlyFile("element_list.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + + + private String readValueOnlyFile(String valueOnlyFile) throws IOException { + return new String(getClass().getClassLoader().getResourceAsStream( + "valueonly/" + valueOnlyFile).readAllBytes(), StandardCharsets.UTF_8); + } +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java deleted file mode 100644 index ba613b181..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapperTest.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; - -import org.json.JSONException; - -import org.junit.FixMethodOrder; -import org.junit.Test; -import org.junit.runners.MethodSorters; -import org.skyscreamer.jsonassert.JSONAssert; -import org.skyscreamer.jsonassert.JSONCompareMode; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -@FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class ValueOnlyMapperTest { - private static ValueOnlyMapper valueOnlyMapper = new ValueOnlyMapper(true); - - @Test - public void testCreateDefaultMapper() throws IOException { - assertNotNull(new ValueOnlyMapper()); - } - - @Test - public void testSerializeSubmodel() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.SUBMODEL); - String expected = readValueOnlyFile("submodel.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - } - - @Test - public void testSerializeEntity() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.ENTITY); - String expected = readValueOnlyFile("entity.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - } - - @Test - public void testSerializeProperty() throws ValueOnlySerializationException, IOException, JSONException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_INT); - String expected = readValueOnlyFile("property_int.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - } - - @Test - public void testSerializeRange() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.RANGE_DOUBLE); - String expected = readValueOnlyFile("range.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - } - - @Test - public void testSerializeBlob() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.BLOB); - String expected = readValueOnlyFile("blob.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - } - - @Test - public void testSerializeFile() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.FILE); - String expected = readValueOnlyFile("file.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - } - - @Test - public void testSerializeMultiLangProperty() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.MULTI_LANGUAGE_PROPERTY); - String expected = readValueOnlyFile("multi_lang_property.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - } - - @Test - public void testSerializePropertyDouble() throws ValueOnlySerializationException, JSONException, IOException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_DOUBLE); - String expected = readValueOnlyFile("property_double.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - } - - @Test - public void testSerializePropertyDatetime() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_DATETIME); - String expected = readValueOnlyFile("date_time_property.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - } - - @Test - public void testSerializeRefElementGlobal() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.REFERENCE_ELEMENT_GLOBAL); - String expected = readValueOnlyFile("ref_element_global.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - } - - @Test - public void testSerializeAnnotatedRelationshipElement() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.ANNOTATED_RELATIONSHIP_ELEMENT); - String expected = readValueOnlyFile("ann_relationship_element.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - } - - @Test - public void testSerializeCollectionElement() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.ELEMENT_COLLECTION); - String expected = readValueOnlyFile("element_collection.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - // failing - } - - @Test - public void testSerializeListElement() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.ELEMENT_LIST); - String expected = readValueOnlyFile("element_list.json"); - JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); - } - - @Test - public void testUpdateSubmodel() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.SUBMODEL_UPDATED); - valueOnlyMapper.update(TestData.SUBMODEL, valueOnly); - assertEquals(TestData.SUBMODEL_UPDATED, TestData.SUBMODEL); - } - - @Test - public void testUpdateEntity() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.ENTITY_UPDATED); - valueOnlyMapper.update(TestData.ENTITY, valueOnly); - assertEquals(TestData.ENTITY_UPDATED, TestData.ENTITY); - } - - @Test - public void testUpdateProperty() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_INT_UPDATED); - valueOnlyMapper.update(TestData.PROPERTY_INT, valueOnly); - assertEquals(TestData.PROPERTY_INT_UPDATED, TestData.PROPERTY_INT); - } - - @Test - public void testUpdateRange() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.RANGE_DOUBLE_UPDATED); - valueOnlyMapper.update(TestData.RANGE_DOUBLE, valueOnly); - assertEquals(TestData.RANGE_DOUBLE_UPDATED, TestData.RANGE_DOUBLE); - } - - @Test - public void testUpdateBlob() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.BLOB_UPDATED); - valueOnlyMapper.update(TestData.BLOB, valueOnly); - assertEquals(TestData.BLOB_UPDATED, TestData.BLOB); - } - - @Test - public void testUpdateFile() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.FILE_UPDATED); - valueOnlyMapper.update(TestData.FILE, valueOnly); - assertEquals(TestData.FILE_UPDATED, TestData.FILE); - } - - @Test - public void testUpdateMultiLangProperty() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.MULTI_LANGUAGE_PROPERTY_UPDATED); - valueOnlyMapper.update(TestData.MULTI_LANGUAGE_PROPERTY, valueOnly); - assertEquals(TestData.MULTI_LANGUAGE_PROPERTY_UPDATED, TestData.MULTI_LANGUAGE_PROPERTY); - } - - @Test - public void testUpdatePropertyDouble() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_DOUBLE_UPDATED); - valueOnlyMapper.update(TestData.PROPERTY_DOUBLE, valueOnly); - assertEquals(TestData.PROPERTY_DOUBLE_UPDATED, TestData.PROPERTY_DOUBLE); - } - - @Test - public void testUpdatePropertyDatetime() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.PROPERTY_DATETIME_UPDATED); - valueOnlyMapper.update(TestData.PROPERTY_DATETIME, valueOnly); - assertEquals(TestData.PROPERTY_DATETIME_UPDATED, TestData.PROPERTY_DATETIME); - } - - @Test - public void testUpdateRefElementGlobal() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.REFERENCE_ELEMENT_GLOBAL_UPDATED); - valueOnlyMapper.update(TestData.REFERENCE_ELEMENT_GLOBAL, valueOnly); - assertEquals(TestData.REFERENCE_ELEMENT_GLOBAL_UPDATED, TestData.REFERENCE_ELEMENT_GLOBAL); - } - - @Test - public void testUpdateAnnotatedRelationshipElement() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED); - valueOnlyMapper.update(TestData.ANNOTATED_RELATIONSHIP_ELEMENT, valueOnly); - assertEquals(TestData.ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED, TestData.ANNOTATED_RELATIONSHIP_ELEMENT); - } - - @Test - public void testUpdateCollectionElement() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.ELEMENT_COLLECTION_UPDATED); - valueOnlyMapper.update(TestData.ELEMENT_COLLECTION, valueOnly); - assertEquals(TestData.ELEMENT_COLLECTION_UPDATED, TestData.ELEMENT_COLLECTION); - } - - @Test - public void testUpdateListElement() throws ValueOnlySerializationException { - String valueOnly = valueOnlyMapper.toValueOnly(TestData.ELEMENT_LIST_UPDATED); - valueOnlyMapper.update(TestData.ELEMENT_LIST, valueOnly); - assertEquals(TestData.ELEMENT_LIST_UPDATED, TestData.ELEMENT_LIST); - } - - private String readValueOnlyFile(String valueOnlyFile) throws IOException { - return new String(getClass().getClassLoader().getResourceAsStream( - "valueonly/" + valueOnlyFile).readAllBytes(), StandardCharsets.UTF_8); - } -} \ No newline at end of file From 5d67f720d32db2b30dffb2df486b327d60ecdbd4 Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Tue, 25 Jul 2023 15:01:10 +0200 Subject: [PATCH 56/59] remove not applicable copyright headers --- .../aas4j/v3/dataformat/json/valueonly/AbstractMapper.java | 1 - .../dataformat/json/valueonly/AnnotatedRelationshipMapper.java | 1 - .../v3/dataformat/json/valueonly/BasicEventElementMapper.java | 1 - .../aas4j/v3/dataformat/json/valueonly/BlobMapper.java | 1 - .../v3/dataformat/json/valueonly/ElementsCollectionMapper.java | 1 - .../aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java | 1 - .../aas4j/v3/dataformat/json/valueonly/EntityMapper.java | 1 - .../aas4j/v3/dataformat/json/valueonly/FileMapper.java | 1 - .../v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java | 1 - .../v3/dataformat/json/valueonly/JsonValueOnlySerialiser.java | 1 - .../dataformat/json/valueonly/MultiLanguagePropertyMapper.java | 1 - .../aas4j/v3/dataformat/json/valueonly/PropertyMapper.java | 1 - .../aas4j/v3/dataformat/json/valueonly/RangeMapper.java | 1 - .../v3/dataformat/json/valueonly/ReferenceElementMapper.java | 1 - .../v3/dataformat/json/valueonly/RelationshipElementMapper.java | 1 - .../aas4j/v3/dataformat/json/valueonly/ValueConverter.java | 1 - .../json/valueonly/ValueOnlySerializationException.java | 1 - .../dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java | 1 - .../dataformat/json/valueonly/JsonValueOnlySerialiserTest.java | 1 - .../digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java | 1 - 20 files changed, 20 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java index f85f92c87..a9ae6d1da 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java index 14cc24419..ec9a1da10 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java index c4bddeca2..5f6cadeb2 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java index 48e0cde17..b3d3fd162 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java index 0ea83327d..2fe12d56c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java index 3fa7f9b9c..cda04258a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java index 20e896b65..e681ab4c1 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java index 6bbb41972..901a2ddbc 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java index 34719ef24..d7b54fb9b 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiser.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiser.java index 92ae6d14f..04e7fa9e3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiser.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiser.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java index d9a867455..9c2d55749 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/MultiLanguagePropertyMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java index a7ad2f858..4dd1fdec3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java index 711a34ccd..ecddd5fbe 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java index 58cc31543..1d266c474 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java index bda7c36bf..5a1766bb8 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueConverter.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueConverter.java index ee9f8ccb1..b215d78b4 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueConverter.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueConverter.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java index 41299acbe..6222dec1a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlySerializationException.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java index c2a6dced1..adcea63c7 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java index 9a45e7a65..da4510c1e 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java index c7b3d8f8f..257695787 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); From ff6555bbbc999051dbd5fe5173a4dd0710ee08da Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Tue, 25 Jul 2023 15:02:37 +0200 Subject: [PATCH 57/59] fix code warnings in valueonly --- .../JsonValueOnlyDeserialiserTest.java | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java index adcea63c7..db98d4a90 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java @@ -15,31 +15,20 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; -import org.json.JSONException; + import org.junit.FixMethodOrder; import org.junit.Ignore; import org.junit.Test; import org.junit.runners.MethodSorters; -import org.skyscreamer.jsonassert.JSONAssert; -import org.skyscreamer.jsonassert.JSONCompareMode; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; @FixMethodOrder(MethodSorters.NAME_ASCENDING) @Ignore // @TODO: activate again public class JsonValueOnlyDeserialiserTest { - private static JsonValueOnlyDeserialiser deserialiser = new JsonValueOnlyDeserialiser(); - private static JsonValueOnlySerialiser serialiser = new JsonValueOnlySerialiser(); - - @Test - public void testCreateDefaultMapper() throws IOException { - assertNotNull(new JsonValueOnlyDeserialiser()); - } + private static final JsonValueOnlyDeserialiser deserialiser = new JsonValueOnlyDeserialiser(); + private static final JsonValueOnlySerialiser serialiser = new JsonValueOnlySerialiser(); @Test public void testUpdateSubmodel() throws ValueOnlySerializationException { From 49e2e889ffae0f633c1f4c83850f3cd479e6daba Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Tue, 25 Jul 2023 15:03:43 +0200 Subject: [PATCH 58/59] activate valueonly tests again --- .../json/valueonly/JsonValueOnlyDeserialiserTest.java | 2 -- .../dataformat/json/valueonly/JsonValueOnlySerialiserTest.java | 2 -- 2 files changed, 4 deletions(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java index db98d4a90..76adc91cd 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java @@ -17,14 +17,12 @@ import org.junit.FixMethodOrder; -import org.junit.Ignore; import org.junit.Test; import org.junit.runners.MethodSorters; import static org.junit.Assert.assertEquals; @FixMethodOrder(MethodSorters.NAME_ASCENDING) -@Ignore // @TODO: activate again public class JsonValueOnlyDeserialiserTest { private static final JsonValueOnlyDeserialiser deserialiser = new JsonValueOnlyDeserialiser(); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java index da4510c1e..f6e59fe08 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java @@ -17,7 +17,6 @@ import org.json.JSONException; import org.junit.FixMethodOrder; -import org.junit.Ignore; import org.junit.Test; import org.junit.runners.MethodSorters; import org.skyscreamer.jsonassert.JSONAssert; @@ -27,7 +26,6 @@ import java.nio.charset.StandardCharsets; @FixMethodOrder(MethodSorters.NAME_ASCENDING) -@Ignore // @TODO: activate again public class JsonValueOnlySerialiserTest { private static final JsonValueOnlySerialiser serialiser = new JsonValueOnlySerialiser(true); From 3d36b1e47c87ed7e5a6a9a81fc3327606c6e96f6 Mon Sep 17 00:00:00 2001 From: tschultebahrenberg-sap <137792054+tschultebahrenberg-sap@users.noreply.github.com> Date: Wed, 2 Aug 2023 14:05:56 +0200 Subject: [PATCH 59/59] test: adopt unit tests (#6) adjust to the correct valueonly format --- .../valueonly/AbstractCollectionMapper.java | 79 ++++++++++++ .../json/valueonly/AbstractListMapper.java | 28 +++++ .../json/valueonly/AbstractMapper.java | 62 +++++++-- .../AnnotatedRelationshipMapper.java | 37 +++--- .../valueonly/BasicEventElementMapper.java | 6 +- .../dataformat/json/valueonly/BlobMapper.java | 12 +- .../valueonly/ElementsCollectionMapper.java | 118 ++---------------- .../json/valueonly/ElementsListMapper.java | 31 +++-- .../json/valueonly/EntityMapper.java | 40 +++--- .../dataformat/json/valueonly/FileMapper.java | 10 +- .../valueonly/JsonValueOnlyDeserialiser.java | 9 +- .../valueonly/JsonValueOnlySerialiser.java | 22 ++-- .../MultiLanguagePropertyMapper.java | 18 +-- .../json/valueonly/PropertyMapper.java | 31 ++--- .../json/valueonly/RangeMapper.java | 16 +-- .../valueonly/ReferenceElementMapper.java | 13 +- .../valueonly/RelationshipElementMapper.java | 14 +-- .../json/valueonly/SubmodelMapper.java | 23 ++++ .../json/valueonly/ValueOnlyMapper.java | 86 +++++++++++++ .../JsonValueOnlyDeserialiserTest.java | 84 +++++++++---- .../JsonValueOnlySerialiserTest.java | 41 +++--- .../dataformat/json/valueonly/TestData.java | 102 ++++++++------- .../valueonly/element_collection.json | 72 ++++++----- .../resources/valueonly/element_list.json | 88 +++++++------ .../src/test/resources/valueonly/entity.json | 14 ++- .../resources/valueonly/property_double.json | 2 +- .../resources/valueonly/property_int.json | 2 +- .../resources/valueonly/property_string.json | 3 + .../src/test/resources/valueonly/range.json | 6 +- .../test/resources/valueonly/submodel.json | 12 +- 30 files changed, 654 insertions(+), 427 deletions(-) create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractCollectionMapper.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractListMapper.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/SubmodelMapper.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java create mode 100644 dataformat-json/src/test/resources/valueonly/property_string.json diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractCollectionMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractCollectionMapper.java new file mode 100644 index 000000000..ecbd2555b --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractCollectionMapper.java @@ -0,0 +1,79 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + +/** + * Base class for mapping collections of submodel elements as for + *
      + *
    • {@link SubmodelMapper}
    • + *
    • {@link ElementsCollectionMapper}
    • + *
    + * @param + */ +public abstract class AbstractCollectionMapper extends AbstractListMapper { + /** + * @param element the submodel element that has to be mapped. + * @param values + * @param idShortPath the idShort path is a dot separated chain of idShorts, that can be used in case of + * troubleshooting. + */ + protected AbstractCollectionMapper(T element, List values, String idShortPath) { + super(element, values, idShortPath); + } + + ObjectNode valuesToJson() throws ValueOnlySerializationException { + ObjectNode elementsNode = JsonNodeFactory.instance.objectNode(); + for (SubmodelElement submodelElement : values) { + String idShort = submodelElement.getIdShort(); + if (elementsNode.has(idShort)) { + throw new ValueOnlySerializationException("Duplicated idShort name '" + idShort + + "' under idShort path '" + idShortPath + "'.", idShortPath); + } + ValueOnlyMapper mapper = ValueOnlyMapper.createMapper(submodelElement, idShortPath + "." + idShort); + if (mapper == null) { + // This type of submodel elements are not serialized in value-only format. + continue; + } + JsonNode mapperNode = mapper.toJson(); + if (elementsNode.isObject()) { + elementsNode.setAll((ObjectNode) mapperNode); + } else { + elementsNode.set(idShort, mapperNode); + } + } + return elementsNode; + } + + public void updateFromJson(JsonNode value) throws ValueOnlySerializationException { + if (!value.isObject()) { + throw new ValueOnlySerializationException( + "Cannot update the submodel elements collection at idShort path '" + idShortPath + + "', as the corresponding value-only is not a JSON object.", idShortPath); + } + ObjectNode objNode = (ObjectNode) value; + for (Iterator it = objNode.fieldNames(); it.hasNext(); ) { + String idShort = it.next(); + SubmodelElement submodelElement = findElementByIdShort(idShort); + ValueOnlyMapper mapper = ValueOnlyMapper.createMapper(submodelElement, idShortPath + "." + idShort); + //mapper.update(objNode.get(idShort)); + mapper.update(JsonNodeFactory.instance.objectNode().set(idShort, objNode.get(idShort))); + } + } + + private SubmodelElement findElementByIdShort(String idShort) throws ValueOnlySerializationException { + for (SubmodelElement submodelElement : values) { + if (idShort.equals(submodelElement.getIdShort())) { + return submodelElement; + } + } + throw new ValueOnlySerializationException("Cannot find submodel element with idShort '" + idShort + + "' at idShort path '" + idShortPath + "'.", idShortPath); + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractListMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractListMapper.java new file mode 100644 index 000000000..aa28217e4 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractListMapper.java @@ -0,0 +1,28 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +/** + * Base class for mapping elements providing list of submodel elements as for + *
      + *
    • {@link ElementsListMapper}
    • + *
    • {@link ElementsCollectionMapper}
    • + *
    + * @param + */ +public abstract class AbstractListMapper extends AbstractMapper { + protected final List values; + + /** + * @param element the submodel element that has to be mapped. + * @param idShortPath the idShort path is a dot separated chain of idShorts, that can be used in case of + * troubleshooting. + */ + protected AbstractListMapper(T element, List values, String idShortPath) { + super(element, idShortPath); + this.values = values; + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java index a9ae6d1da..7c6abffcc 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AbstractMapper.java @@ -15,13 +15,17 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import java.util.Iterator; + +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; /** * The abstract base class for all value-only mappers. * @param The type of the mapped elements. */ -abstract class AbstractMapper { +abstract class AbstractMapper implements ValueOnlyMapper { protected final T element; protected final String idShortPath; @@ -36,19 +40,51 @@ protected AbstractMapper(T element, String idShortPath) { this.idShortPath = idShortPath; } - /** - * This method converts the corresponding element to a value-only JSON node. - * @return the corresponding JSON node. - * @throws ValueOnlySerializationException with information about the idShort path. - */ - abstract JsonNode toJson() throws ValueOnlySerializationException; + JsonNode asValueNode(JsonNode value) { + return JsonNodeFactory.instance.objectNode().set(element.getIdShort(), value); + } + + static JsonNode valueFromNode(String msg, String idShortPath, JsonNode valueOnly) { + Iterator fieldNames = valueOnly.fieldNames(); + if (!fieldNames.hasNext()) { + // throw exception as value-only nodes must have exactly one field! + throw new ValueOnlySerializationException( + msg + " at idShort path '" + idShortPath + + "', as the passed value does have no fields!", idShortPath); + } + String fieldName = fieldNames.next(); + if (fieldNames.hasNext()) { + // throw exception as value-only nodes must have exactly one field! + throw new ValueOnlySerializationException( + msg + " at idShort path '" + idShortPath + + "', as the passed value has more than one field!", idShortPath); + } + return valueOnly.get(fieldName); + } /** - * Updates the corresponding element according the passed valueOnly JSON node. - * @param valueOnly the value only JSON node. - * @throws ValueOnlySerializationException with information about the idShort path. - *
    Note:The update is not an atomic operation and if an exception is thrown, the corresponding element - * will be in an inconsistent state. If you cannot handle such situations, pass a copy of the original element. + * Verifies the given object is neither an object nor an array + * @param msg Prefix for exception messages. + * @param idShortPath short path of ID being included to exception messages. + * @param value the node to return as text + * @return given {@code value} as text if it's neither an object nor an array, otherwise throws exception. + * @throws ValueOnlySerializationException throw if node is object or array. */ - abstract void update(JsonNode valueOnly) throws ValueOnlySerializationException; + String readValueAsString(String msg, String idShortPath, JsonNode value) + throws ValueOnlySerializationException { + if (value == null || value.isNull()) { + return null; + } + if (value.isObject()) { + throw new ValueOnlySerializationException( + msg + " at idShort path '" + idShortPath + + "', as the passed value is a JSON object.", idShortPath); + } + if (value.isArray()) { + throw new ValueOnlySerializationException( + msg + " at idShort path '" + idShortPath + + "', as the passed value is a JSON array.", idShortPath); + } + return value.asText(); + } } \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java index ec9a1da10..b38d2040e 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/AnnotatedRelationshipMapper.java @@ -15,15 +15,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.ArrayList; +import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.ArrayList; -import java.util.List; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; /** * AnnotatedRelationshipElement is serialized according to the serialization of a ReleationshipElement. Additionally, a @@ -38,27 +37,31 @@ class AnnotatedRelationshipMapper extends RelationshipElementMapper { } @Override - JsonNode toJson() throws ValueOnlySerializationException { - ObjectNode node = (ObjectNode) super.toJson(); - List annotations = new ArrayList<>(((AnnotatedRelationshipElement)element).getAnnotations()); - if(annotations.size() > 0) { - ElementsListMapper listMapper = new ElementsListMapper( - annotations, idShortPath + "." + ANNOTATIONS); - node.set(ANNOTATIONS, listMapper.toJson()); + public JsonNode toJson() throws ValueOnlySerializationException { + ObjectNode valueNode = (ObjectNode) super.toJson(); + AnnotatedRelationshipElement annotatedRelationshipElement = (AnnotatedRelationshipElement) element; + List annotations = new ArrayList<>(annotatedRelationshipElement.getAnnotations()); + if(!annotations.isEmpty()) { + ElementsListMapper listMapper = new ElementsListMapper<>( + annotatedRelationshipElement, annotations, idShortPath + "." + ANNOTATIONS); + ObjectNode dataNode = (ObjectNode) valueNode.get(element.getIdShort()); + dataNode.set(ANNOTATIONS, listMapper.toJson()); } - return node; + return valueNode; } @Override - void update(JsonNode valueOnly) throws ValueOnlySerializationException { + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { super.update(valueOnly); - List annotations = ((AnnotatedRelationshipElement)element).getAnnotations(); - JsonNode annotationsNode = valueOnly.get(ANNOTATIONS); + AnnotatedRelationshipElement annotatedRelationshipElement = (AnnotatedRelationshipElement) element; + List annotations = annotatedRelationshipElement.getAnnotations(); + JsonNode value = valueFromNode("Cannot update the annotated relationship", idShortPath, valueOnly); + JsonNode annotationsNode = value.get(ANNOTATIONS); if(annotationsNode == null || annotationsNode.isNull()) { annotations.clear(); } else { List elements = new ArrayList<>(annotations); - ElementsListMapper listMapper = new ElementsListMapper(elements, idShortPath + "." + ANNOTATIONS); + ElementsListMapper listMapper = new ElementsListMapper<>(annotatedRelationshipElement, elements, idShortPath + "." + ANNOTATIONS); listMapper.update(annotationsNode); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java index 5f6cadeb2..d5a12b99b 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BasicEventElementMapper.java @@ -15,10 +15,10 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; /** * BasicEventElement is serialized as named JSON object with ${BasicEventElement/idShort} as the name of the containing @@ -33,14 +33,14 @@ class BasicEventElementMapper extends AbstractMapper { } @Override - JsonNode toJson() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); node.set(OBSERVED, new JsonValueOnlyDeserialiser().toJson(element.getObserved())); return node; } @Override - void update(JsonNode valueOnly) throws ValueOnlySerializationException { + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { element.setObserved(new JsonValueOnlyDeserialiser().deserialiseReference(valueOnly.get(OBSERVED), idShortPath)); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java index b3d3fd162..6dae8a659 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/BlobMapper.java @@ -15,13 +15,13 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import java.util.Base64; + +import org.eclipse.digitaltwin.aas4j.v3.model.Blob; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; -import org.eclipse.digitaltwin.aas4j.v3.model.Blob; - -import java.util.Base64; /** * Blob is serialized as named JSON object with ${Blob/idShort} as the name of the containing JSON property. The JSON @@ -40,7 +40,7 @@ class BlobMapper extends AbstractMapper { } @Override - JsonNode toJson() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); node.set(CONTENT_TYPE, new TextNode(element.getContentType())); node.set(VALUE, new TextNode(Base64.getEncoder().encodeToString(element.getValue()))); @@ -48,7 +48,7 @@ JsonNode toJson() throws ValueOnlySerializationException { } @Override - void update(JsonNode valueOnly) throws ValueOnlySerializationException { + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { JsonNode contentNode = valueOnly.get(CONTENT_TYPE); if(contentNode == null || contentNode.isNull()) { element.setContentType(null); @@ -62,7 +62,7 @@ void update(JsonNode valueOnly) throws ValueOnlySerializationException { JsonNode valueNode = valueOnly.get(VALUE); if(valueNode == null || valueNode.isNull()) { element.setValue(null); - } else if(contentNode.isTextual()) { + } else if(contentNode != null && contentNode.isTextual()) { element.setValue(Base64.getDecoder().decode(valueNode.asText())); } else { throw new ValueOnlySerializationException( diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java index 2fe12d56c..80f732f5a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsCollectionMapper.java @@ -15,124 +15,32 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; -import org.eclipse.digitaltwin.aas4j.v3.model.Blob; -import org.eclipse.digitaltwin.aas4j.v3.model.Entity; -import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Range; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; -import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; - -import java.util.Iterator; -import java.util.List; /** * SubmodelElementCollection is serialized as named JSON object with ${SubmodelElementCollection/idShort} as the name of * the containing JSON property. The elements contained within the struct are serialized according to their respective * type with ${SubmodelElement/idShort} as the name of the containing JSON property. */ -class ElementsCollectionMapper extends AbstractMapper> { - ElementsCollectionMapper(List elements, String idShortPath) { - super(elements, idShortPath); +class ElementsCollectionMapper extends AbstractCollectionMapper { + ElementsCollectionMapper(Referable elementCollection, List values, String idShortPath) { + super(elementCollection, values, idShortPath); } @Override - JsonNode toJson() throws ValueOnlySerializationException { - ObjectNode node = JsonNodeFactory.instance.objectNode(); - for(SubmodelElement submodelElement : element) { - String idShort = submodelElement.getIdShort(); - if(node.has(idShort)) { - throw new ValueOnlySerializationException("Duplicated idShort name '" + idShort + - "' under idShort path '" + idShortPath + "'.", idShortPath); - } - AbstractMapper mapper = createMapper(submodelElement, idShortPath + "." + idShort); - if(mapper == null) { - // This type of submodel elements are not serialized in value-only format. - continue; - } - node.set(idShort, mapper.toJson()); - } - return node; + public JsonNode toJson() throws ValueOnlySerializationException { + ObjectNode elementsNode = valuesToJson(); + return asValueNode(elementsNode); } @Override - void update(JsonNode valueOnly) throws ValueOnlySerializationException { - if(!valueOnly.isObject()) { - throw new ValueOnlySerializationException( - "Cannot update the submodel elements collection at idShort path '" + idShortPath + - "', as the corresponding value-only is not a JSON object.", idShortPath); - } - ObjectNode objNode = (ObjectNode) valueOnly; - for (Iterator it = objNode.fieldNames(); it.hasNext(); ) { - String idShort = it.next(); - SubmodelElement submodelElement = findElementByIdShort(idShort); - AbstractMapper mapper = createMapper(submodelElement, idShortPath + "." + idShort); - mapper.update(objNode.get(idShort)); - } - } - - /** - * Creates the corresponding mapper. - * @param element the submodel element. - * @param idShortPath the idShort path. - * @return the corresponding mapper or null if this type cannot be serialized to value-only JSON string. - */ - static AbstractMapper createMapper(SubmodelElement element, String idShortPath) { - if(element instanceof Blob) { - return new BlobMapper((Blob) element, idShortPath); - } - if(element instanceof File) { - return new FileMapper((File) element, idShortPath); - } - if(element instanceof MultiLanguageProperty) { - return new MultiLanguagePropertyMapper((MultiLanguageProperty)element, idShortPath); - } - if(element instanceof Property) { - return new PropertyMapper((Property)element, idShortPath); - } - if(element instanceof Range) { - return new RangeMapper((Range) element, idShortPath); - } - if(element instanceof ReferenceElement) { - return new ReferenceElementMapper((ReferenceElement) element, idShortPath); - } - if(element instanceof Entity) { - return new EntityMapper((Entity) element, idShortPath); - } - if(element instanceof BasicEventElement) { - return new BasicEventElementMapper((BasicEventElement) element, idShortPath); - } - if(element instanceof SubmodelElementCollection) { - return new ElementsCollectionMapper(((SubmodelElementCollection)element).getValue(), idShortPath); - } - if(element instanceof SubmodelElementList) { - return new ElementsListMapper(((SubmodelElementList)element).getValue(), idShortPath); - } - if(element instanceof AnnotatedRelationshipElement) { - return new AnnotatedRelationshipMapper((AnnotatedRelationshipElement) element, idShortPath); - } - if(element instanceof RelationshipElement) { - return new RelationshipElementMapper((RelationshipElement) element, idShortPath); - } - return null; - } - - private SubmodelElement findElementByIdShort(String idShort) throws ValueOnlySerializationException { - for (SubmodelElement submodelElement : element) { - if(idShort.equals(submodelElement.getIdShort())) { - return submodelElement; - } - } - throw new ValueOnlySerializationException("Cannot find submodel element with idShort '" + idShort + - "' at idShort path '" + idShortPath + "'.", idShortPath); + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + JsonNode value = valueFromNode("Cannot update submodel elements collection", idShortPath, valueOnly); + updateFromJson(value); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java index cda04258a..a4425273a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ElementsListMapper.java @@ -15,52 +15,51 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; - import com.fasterxml.jackson.databind.node.NullNode; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.List; - /** * SubmodelElementList is serialized as a JSON array with the index of the contained SubmodelElement in the list as the * position in the JSON array. The elements contained within the list are serialized according to their respective type. */ -class ElementsListMapper extends ElementsCollectionMapper { - ElementsListMapper(List elements, String idShortPath) { - super(elements, idShortPath); +class ElementsListMapper extends AbstractListMapper { + ElementsListMapper(T elementList, List values, String idShortPath) { + super(elementList, values, idShortPath); } @Override - JsonNode toJson() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ArrayNode arrayNode = JsonNodeFactory.instance.arrayNode(); - for(int i = 0; i < element.size(); i++) { - SubmodelElement submodelElement = element.get(i); - AbstractMapper mapper = createMapper(submodelElement, idShortPath + "[" + i + "]"); + for (int i = 0; i < values.size(); i++) { + SubmodelElement submodelElement = values.get(i); + ValueOnlyMapper mapper = ValueOnlyMapper.createMapper(submodelElement, idShortPath + "[" + i + "]"); arrayNode.add(mapper == null ? NullNode.instance : mapper.toJson()); } return arrayNode; } @Override - void update(JsonNode valueOnly) throws ValueOnlySerializationException { + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { if(!valueOnly.isArray()) { throw new ValueOnlySerializationException( "Cannot update the submodel elements list at idShort path '" + idShortPath + "', as the corresponding value-only is not a JSON array.", idShortPath); } ArrayNode arrayNode = (ArrayNode) valueOnly; - if(arrayNode.size() != element.size()) { + if (arrayNode.size() != values.size()) { throw new ValueOnlySerializationException( "Cannot update the submodel elements list at idShort path '" + idShortPath + "', as the corresponding value-only array has different size.", idShortPath); } for (int i = 0; i < arrayNode.size(); i++ ) { - SubmodelElement submodelElement = element.get(i); - AbstractMapper mapper = createMapper(submodelElement, idShortPath + "[" + i + "]"); + SubmodelElement submodelElement = values.get(i); + ValueOnlyMapper mapper = ValueOnlyMapper.createMapper(submodelElement, idShortPath + "[" + i + "]"); mapper.update(arrayNode.get(i)); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java index e681ab4c1..d923a48eb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/EntityMapper.java @@ -15,18 +15,18 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.databind.node.TextNode; +import java.util.Iterator; +import java.util.List; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Entity; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; - -import java.util.Iterator; -import java.util.List; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; /** * Entity is serialized as named JSON object with ${Entity/idShort} as the name of the containing JSON property. The @@ -48,17 +48,17 @@ class EntityMapper extends AbstractMapper { } @Override - JsonNode toJson() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); - ElementsListMapper statementsMapper = new ElementsListMapper( - element.getStatements(), idShortPath + "." + STATEMENTS); + ElementsListMapper statementsMapper = new ElementsListMapper<>( + element, element.getStatements(), idShortPath + "." + STATEMENTS); node.set(STATEMENTS, statementsMapper.toJson()); String globalAssetId = element.getGlobalAssetId(); if(globalAssetId != null) { node.set(GLOBAL_ASSET_ID, new TextNode(globalAssetId)); } List specificAssetIds = element.getSpecificAssetIds(); - if(specificAssetIds != null && specificAssetIds.size() > 0) { + if(specificAssetIds != null && !specificAssetIds.isEmpty()) { ObjectNode assetIdNode = JsonNodeFactory.instance.objectNode(); for (SpecificAssetId assetId : specificAssetIds) { assetIdNode.set(assetId.getValue(), new TextNode(assetId.getName())); @@ -66,20 +66,21 @@ JsonNode toJson() throws ValueOnlySerializationException { node.set(SPECIFIC_ASSET_ID, assetIdNode); } node.set(ENTITY_TYPE, new TextNode(EnumSerializer.serializeEnumName(element.getEntityType().name()))); - return node; + return asValueNode(node); } @Override - void update(JsonNode valueOnly) throws ValueOnlySerializationException { - JsonNode statementsNode = valueOnly.get(STATEMENTS); + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + JsonNode value = valueFromNode("Cannot update entity", idShortPath, valueOnly); + JsonNode statementsNode = value.get(STATEMENTS); if(statementsNode == null) { element.getStatements().clear(); } else { - ElementsListMapper statementsMapper = new ElementsListMapper( - element.getStatements(), idShortPath + "." + STATEMENTS); + ElementsListMapper statementsMapper = new ElementsListMapper<>( + element, element.getStatements(), idShortPath + "." + STATEMENTS); statementsMapper.update(statementsNode); } - JsonNode globalAssetIdNode = valueOnly.get(GLOBAL_ASSET_ID); + JsonNode globalAssetIdNode = value.get(GLOBAL_ASSET_ID); if(globalAssetIdNode == null || globalAssetIdNode.isNull()) { element.setGlobalAssetId(null); } else if(globalAssetIdNode.isTextual()) { @@ -88,16 +89,15 @@ void update(JsonNode valueOnly) throws ValueOnlySerializationException { throw new ValueOnlySerializationException("Cannot update the Entity at idShort path '" + idShortPath + "', as the passed " + GLOBAL_ASSET_ID + " is not a string.", idShortPath); } - JsonNode specificAssetIdNode = valueOnly.get(SPECIFIC_ASSET_ID); + JsonNode specificAssetIdNode = value.get(SPECIFIC_ASSET_ID); if(specificAssetIdNode != null) { - List specificAssetIds = element.getSpecificAssetIds(); if(!specificAssetIdNode.isObject()) { throw new ValueOnlySerializationException("Cannot update the Entity at idShort path '" + idShortPath + "', as the passed " + SPECIFIC_ASSET_ID + " is not an object.", idShortPath); } updateSpecificAssetIds(element.getSpecificAssetIds(), (ObjectNode) specificAssetIdNode); } - JsonNode entityTypeNode = valueOnly.get(ENTITY_TYPE); + JsonNode entityTypeNode = value.get(ENTITY_TYPE); if(entityTypeNode == null || !entityTypeNode.isTextual()) { throw new ValueOnlySerializationException("Cannot update the Entity at idShort path '" + idShortPath + "', as its type is not set as string property '" + ENTITY_TYPE + "'.", idShortPath); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java index 901a2ddbc..5f0403de9 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/FileMapper.java @@ -15,13 +15,11 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import org.eclipse.digitaltwin.aas4j.v3.model.File; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; -import org.eclipse.digitaltwin.aas4j.v3.model.File; - -import java.util.Base64; /** * File is serialized as named JSON object with ${File/idShort} as the name of the containing JSON property. The JSON @@ -40,7 +38,7 @@ class FileMapper extends AbstractMapper { } @Override - JsonNode toJson() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); node.set(CONTENT_TYPE, new TextNode(element.getContentType())); node.set(VALUE, new TextNode(element.getValue())); @@ -48,7 +46,7 @@ JsonNode toJson() throws ValueOnlySerializationException { } @Override - void update(JsonNode valueOnly) throws ValueOnlySerializationException { + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { JsonNode contentNode = valueOnly.get(CONTENT_TYPE); if(contentNode == null || contentNode.isNull()) { element.setContentType(null); @@ -62,7 +60,7 @@ void update(JsonNode valueOnly) throws ValueOnlySerializationException { JsonNode valueNode = valueOnly.get(VALUE); if(valueNode == null || valueNode.isNull()) { element.setValue(null); - } else if(contentNode.isTextual()) { + } else if(contentNode != null && contentNode.isTextual()) { element.setValue(valueNode.textValue()); } else { throw new ValueOnlySerializationException( diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java index d7b54fb9b..d588fa6a4 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiser.java @@ -15,13 +15,12 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; /** * This class implements the value-only Serialization in JSON format, as described in section 11.4.2 of } @Override - JsonNode toJson() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { List langTexts = element.getValue(); - if(langTexts == null || langTexts.size() == 0) { + if(langTexts == null || langTexts.isEmpty()) { return NullNode.instance; } ObjectNode node = JsonNodeFactory.instance.objectNode(); @@ -53,7 +53,7 @@ JsonNode toJson() throws ValueOnlySerializationException { } @Override - void update(JsonNode valueOnly) throws ValueOnlySerializationException { + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { if(!valueOnly.isObject()) { throw new ValueOnlySerializationException( "Cannot update the multi-language property at idShort path '" + idShortPath + diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java index 4dd1fdec3..c3cacafe7 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/PropertyMapper.java @@ -15,9 +15,8 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; -import com.fasterxml.jackson.databind.JsonNode; - import org.eclipse.digitaltwin.aas4j.v3.model.Property; +import com.fasterxml.jackson.databind.JsonNode; /** * Property is serialized as ${Property/idShort}: ${Property/value} where ${Property/value} is the JSON serialization @@ -30,9 +29,10 @@ class PropertyMapper extends AbstractMapper { } @Override - JsonNode toJson() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { try { - return ValueConverter.convert(element.getValueType(), element.getValue()); + JsonNode value = ValueConverter.convert(element.getValueType(), element.getValue()); + return asValueNode(value); } catch (NumberFormatException ex) { throw new ValueOnlySerializationException("Cannot serialize the property with idShort path '" + idShortPath + "': " + ex.getMessage(), idShortPath); @@ -40,25 +40,8 @@ JsonNode toJson() throws ValueOnlySerializationException { } @Override - void update(JsonNode valueOnly) throws ValueOnlySerializationException { - element.setValue(readValueAsString("Cannot update the property", idShortPath, valueOnly)); - } - - static String readValueAsString(String msg, String idShortPath, JsonNode valueOnly) - throws ValueOnlySerializationException { - if(valueOnly == null || valueOnly.isNull()) { - return null; - } - if(valueOnly.isObject()) { - throw new ValueOnlySerializationException( - msg + " at idShort path '" + idShortPath + - "', as the passed value is a JSON object.", idShortPath); - } - if(valueOnly.isArray()) { - throw new ValueOnlySerializationException( - msg + " at idShort path '" + idShortPath + - "', as the passed value is a JSON array.", idShortPath); - } - return valueOnly.asText(); + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + JsonNode valueNode = valueFromNode("Cannot update the property", idShortPath, valueOnly); + element.setValue(readValueAsString("Cannot update the property", idShortPath, valueNode)); } } \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java index ecddd5fbe..2d1167d7c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RangeMapper.java @@ -15,13 +15,12 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.Range; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Range; - /** * Range is serialized as named JSON object with ${Range/idShort} as the name of the containing JSON property. The JSON * object contains two JSON properties. The first is named "min". The second is named "max". Their corresponding values @@ -36,13 +35,13 @@ class RangeMapper extends AbstractMapper { } @Override - JsonNode toJson() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { try { ObjectNode node = JsonNodeFactory.instance.objectNode(); DataTypeDefXsd valueType = element.getValueType(); node.set(MIN, ValueConverter.convert(valueType, element.getMin())); node.set(MAX, ValueConverter.convert(valueType, element.getMax())); - return node; + return asValueNode(node); } catch (NumberFormatException ex) { throw new ValueOnlySerializationException("Cannot serialize the range with idShort path '" + idShortPath + "': " + ex.getMessage(), idShortPath); @@ -50,8 +49,9 @@ JsonNode toJson() throws ValueOnlySerializationException { } @Override - void update(JsonNode valueOnly) throws ValueOnlySerializationException { - element.setMax(PropertyMapper.readValueAsString("Cannot update Range." + MAX, idShortPath, valueOnly.get(MAX))); - element.setMin(PropertyMapper.readValueAsString("Cannot update Range." + MIN, idShortPath, valueOnly.get(MIN))); + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + JsonNode valueNode = valueFromNode("Cannot update Range", idShortPath, valueOnly); + element.setMax(readValueAsString("Cannot update Range." + MAX, idShortPath, valueNode.get(MAX))); + element.setMin(readValueAsString("Cannot update Range." + MIN, idShortPath, valueNode.get(MIN))); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java index 1d266c474..9dd4df1ec 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ReferenceElementMapper.java @@ -15,9 +15,8 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; -import com.fasterxml.jackson.databind.JsonNode; - import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; +import com.fasterxml.jackson.databind.JsonNode; /** * ReferenceElement is serialized as ${ReferenceElement/idShort}: ${ReferenceElement/value} where @@ -30,12 +29,14 @@ class ReferenceElementMapper extends AbstractMapper { } @Override - JsonNode toJson() throws ValueOnlySerializationException { - return new JsonValueOnlySerialiser().toJson(element.getValue()); + public JsonNode toJson() throws ValueOnlySerializationException { + JsonNode value = new JsonValueOnlySerialiser().toJson(element.getValue()); + return asValueNode(value); } @Override - void update(JsonNode valueOnly) throws ValueOnlySerializationException { - element.setValue(new JsonValueOnlyDeserialiser().deserialiseReference(valueOnly, idShortPath)); + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + JsonNode reference = valueFromNode("Cannot update ReferenceElement", idShortPath, valueOnly); + element.setValue(new JsonValueOnlyDeserialiser().deserialiseReference(reference, idShortPath)); } } \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java index 5a1766bb8..9646bc5ff 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/RelationshipElementMapper.java @@ -15,12 +15,11 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; - /** * RelationshipElement is serialized as named JSON object with ${RelationshipElement/idShort} as the name of the * containing JSON property. The JSON object contains two JSON properties. The first is named "first". The second is @@ -36,18 +35,19 @@ class RelationshipElementMapper extends AbstractMapper { } @Override - JsonNode toJson() throws ValueOnlySerializationException { + public JsonNode toJson() throws ValueOnlySerializationException { ObjectNode node = JsonNodeFactory.instance.objectNode(); JsonValueOnlySerialiser serialiser = new JsonValueOnlySerialiser(); node.set(FIRST, serialiser.toJson(element.getFirst())); node.set(SECOND, serialiser.toJson(element.getSecond())); - return node; + return asValueNode(node); } @Override - void update(JsonNode valueOnly) throws ValueOnlySerializationException { + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { JsonValueOnlyDeserialiser deserialiser = new JsonValueOnlyDeserialiser(); - element.setFirst(deserialiser.deserialiseReference(valueOnly.get(FIRST), idShortPath + "." + FIRST)); - element.setSecond(deserialiser.deserialiseReference(valueOnly.get(SECOND), idShortPath + "." + SECOND)); + JsonNode value = valueFromNode("Cannot update the relationship element", idShortPath, valueOnly); + element.setFirst(deserialiser.deserialiseReference(value.get(FIRST), idShortPath + "." + FIRST)); + element.setSecond(deserialiser.deserialiseReference(value.get(SECOND), idShortPath + "." + SECOND)); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/SubmodelMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/SubmodelMapper.java new file mode 100644 index 000000000..277015229 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/SubmodelMapper.java @@ -0,0 +1,23 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import com.fasterxml.jackson.databind.JsonNode; + +/** + * A submodel is serialized as an unnamed JSON object. + */ +public class SubmodelMapper extends AbstractCollectionMapper { + SubmodelMapper(Submodel submodel, String idShortPath) { + super(submodel, submodel.getSubmodelElements(), idShortPath); + } + + @Override + public JsonNode toJson() throws ValueOnlySerializationException { + return valuesToJson(); + } + + @Override + public void update(JsonNode valueOnly) throws ValueOnlySerializationException { + updateFromJson(valueOnly); + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java new file mode 100644 index 000000000..061944b91 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/ValueOnlyMapper.java @@ -0,0 +1,86 @@ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; + +import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; +import org.eclipse.digitaltwin.aas4j.v3.model.Blob; +import org.eclipse.digitaltwin.aas4j.v3.model.Entity; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.Property; +import org.eclipse.digitaltwin.aas4j.v3.model.Range; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; +import com.fasterxml.jackson.databind.JsonNode; + +public interface ValueOnlyMapper { + + /** + * This method converts the corresponding element to a value-only JSON node. + * + * @return the corresponding JSON node. + * @throws ValueOnlySerializationException with information about the idShort path. + */ + JsonNode toJson() throws ValueOnlySerializationException; + + /** + * Updates the corresponding element according the passed valueOnly JSON node. + * + * @param valueOnly the value only JSON node. + * @throws ValueOnlySerializationException with information about the idShort path. + *
    Note:The update is not an atomic operation and if an exception is thrown, the corresponding element + * will be in an inconsistent state. If you cannot handle such situations, pass a copy of the original element. + */ + void update(JsonNode valueOnly) throws ValueOnlySerializationException; + + /** + * Creates the corresponding mapper. + * + * @param element the submodel element. + * @param idShortPath the idShort path. + * @return the corresponding mapper or null if this type cannot be serialized to value-only JSON string. + */ + static ValueOnlyMapper createMapper(SubmodelElement element, String idShortPath) { + if (element instanceof Blob) { + return new BlobMapper((Blob) element, idShortPath); + } + if (element instanceof File) { + return new FileMapper((File) element, idShortPath); + } + if (element instanceof MultiLanguageProperty) { + return new MultiLanguagePropertyMapper((MultiLanguageProperty) element, idShortPath); + } + if (element instanceof Property) { + return new PropertyMapper((Property) element, idShortPath); + } + if (element instanceof Range) { + return new RangeMapper((Range) element, idShortPath); + } + if (element instanceof ReferenceElement) { + return new ReferenceElementMapper((ReferenceElement) element, idShortPath); + } + if (element instanceof Entity) { + return new EntityMapper((Entity) element, idShortPath); + } + if (element instanceof BasicEventElement) { + return new BasicEventElementMapper((BasicEventElement) element, idShortPath); + } + if (element instanceof SubmodelElementCollection) { + SubmodelElementCollection elementCollection = (SubmodelElementCollection) element; + return new ElementsCollectionMapper(elementCollection, elementCollection.getValue(), idShortPath); + } + if (element instanceof SubmodelElementList) { + SubmodelElementList elementList = (SubmodelElementList) element; + return new ElementsListMapper<>(elementList, elementList.getValue(), idShortPath); + } + if (element instanceof AnnotatedRelationshipElement) { + return new AnnotatedRelationshipMapper((AnnotatedRelationshipElement) element, idShortPath); + } + if (element instanceof RelationshipElement) { + return new RelationshipElementMapper((RelationshipElement) element, idShortPath); + } + return null; + } +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java index 76adc91cd..09cffa276 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlyDeserialiserTest.java @@ -16,6 +16,17 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.Blob; +import org.eclipse.digitaltwin.aas4j.v3.model.Entity; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.Property; +import org.eclipse.digitaltwin.aas4j.v3.model.Range; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; @@ -31,92 +42,113 @@ public class JsonValueOnlyDeserialiserTest { @Test public void testUpdateSubmodel() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.SUBMODEL_UPDATED); - deserialiser.deserialise(TestData.SUBMODEL, valueOnly); - assertEquals(TestData.SUBMODEL_UPDATED, TestData.SUBMODEL); + Submodel actual = TestData.SUBMODEL.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.SUBMODEL_UPDATED, actual); } @Test public void testUpdateEntity() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.ENTITY_UPDATED); - deserialiser.deserialise(TestData.ENTITY, valueOnly); - assertEquals(TestData.ENTITY_UPDATED, TestData.ENTITY); + Entity actual = TestData.ENTITY.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.ENTITY_UPDATED, actual); } @Test public void testUpdateProperty() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.PROPERTY_INT_UPDATED); - deserialiser.deserialise(TestData.PROPERTY_INT, valueOnly); - assertEquals(TestData.PROPERTY_INT_UPDATED, TestData.PROPERTY_INT); + Property actual = TestData.PROPERTY_INT.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.PROPERTY_INT_UPDATED, actual); } @Test public void testUpdateRange() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.RANGE_DOUBLE_UPDATED); - deserialiser.deserialise(TestData.RANGE_DOUBLE, valueOnly); - assertEquals(TestData.RANGE_DOUBLE_UPDATED, TestData.RANGE_DOUBLE); + Range actual = TestData.RANGE_DOUBLE.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.RANGE_DOUBLE_UPDATED, actual); } @Test public void testUpdateBlob() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.BLOB_UPDATED); - deserialiser.deserialise(TestData.BLOB, valueOnly); - assertEquals(TestData.BLOB_UPDATED, TestData.BLOB); + Blob actual = TestData.BLOB.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.BLOB_UPDATED, actual); } @Test public void testUpdateFile() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.FILE_UPDATED); - deserialiser.deserialise(TestData.FILE, valueOnly); - assertEquals(TestData.FILE_UPDATED, TestData.FILE); + File actual = TestData.FILE.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.FILE_UPDATED, actual); } @Test public void testUpdateMultiLangProperty() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.MULTI_LANGUAGE_PROPERTY_UPDATED); - deserialiser.deserialise(TestData.MULTI_LANGUAGE_PROPERTY, valueOnly); - assertEquals(TestData.MULTI_LANGUAGE_PROPERTY_UPDATED, TestData.MULTI_LANGUAGE_PROPERTY); + MultiLanguageProperty actual = TestData.MULTI_LANGUAGE_PROPERTY.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.MULTI_LANGUAGE_PROPERTY_UPDATED, actual); } @Test public void testUpdatePropertyDouble() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.PROPERTY_DOUBLE_UPDATED); - deserialiser.deserialise(TestData.PROPERTY_DOUBLE, valueOnly); - assertEquals(TestData.PROPERTY_DOUBLE_UPDATED, TestData.PROPERTY_DOUBLE); + Property actual = TestData.PROPERTY_DOUBLE.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.PROPERTY_DOUBLE_UPDATED, actual); } @Test public void testUpdatePropertyDatetime() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.PROPERTY_DATETIME_UPDATED); - deserialiser.deserialise(TestData.PROPERTY_DATETIME, valueOnly); - assertEquals(TestData.PROPERTY_DATETIME_UPDATED, TestData.PROPERTY_DATETIME); + Property actual = TestData.PROPERTY_DATETIME.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.PROPERTY_DATETIME_UPDATED, actual); + } + + @Test + public void testUpdatePropertyString() { + String valueOnly = serialiser.serialise(TestData.PROPERTY_STRING_UPDATED); + Property actual = TestData.PROPERTY_STRING.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.PROPERTY_STRING_UPDATED, actual); } @Test public void testUpdateRefElementGlobal() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.REFERENCE_ELEMENT_GLOBAL_UPDATED); - deserialiser.deserialise(TestData.REFERENCE_ELEMENT_GLOBAL, valueOnly); - assertEquals(TestData.REFERENCE_ELEMENT_GLOBAL_UPDATED, TestData.REFERENCE_ELEMENT_GLOBAL); + ReferenceElement actual = TestData.REFERENCE_ELEMENT_GLOBAL.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.REFERENCE_ELEMENT_GLOBAL_UPDATED, actual); } @Test public void testUpdateAnnotatedRelationshipElement() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED); - deserialiser.deserialise(TestData.ANNOTATED_RELATIONSHIP_ELEMENT, valueOnly); - assertEquals(TestData.ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED, TestData.ANNOTATED_RELATIONSHIP_ELEMENT); + AnnotatedRelationshipElement actual = TestData.ANNOTATED_RELATIONSHIP_ELEMENT.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED, actual); } @Test public void testUpdateCollectionElement() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.ELEMENT_COLLECTION_UPDATED); - deserialiser.deserialise(TestData.ELEMENT_COLLECTION, valueOnly); - assertEquals(TestData.ELEMENT_COLLECTION_UPDATED, TestData.ELEMENT_COLLECTION); + SubmodelElementCollection actual = TestData.ELEMENT_COLLECTION.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.ELEMENT_COLLECTION_UPDATED, actual); } @Test public void testUpdateListElement() throws ValueOnlySerializationException { String valueOnly = serialiser.serialise(TestData.ELEMENT_LIST_UPDATED); - deserialiser.deserialise(TestData.ELEMENT_LIST, valueOnly); - assertEquals(TestData.ELEMENT_LIST_UPDATED, TestData.ELEMENT_LIST); + SubmodelElementList actual = TestData.ELEMENT_LIST.get(); + deserialiser.deserialise(actual, valueOnly); + assertEquals(TestData.ELEMENT_LIST_UPDATED, actual); } } \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java index f6e59fe08..bf4c9cf2e 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/JsonValueOnlySerialiserTest.java @@ -15,6 +15,9 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + import org.json.JSONException; import org.junit.FixMethodOrder; import org.junit.Test; @@ -22,9 +25,6 @@ import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; -import java.io.IOException; -import java.nio.charset.StandardCharsets; - @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class JsonValueOnlySerialiserTest { private static final JsonValueOnlySerialiser serialiser = new JsonValueOnlySerialiser(true); @@ -32,84 +32,91 @@ public class JsonValueOnlySerialiserTest { @Test public void testSerializeSubmodel() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serialiser.serialise(TestData.SUBMODEL); + String valueOnly = serialiser.serialise(TestData.SUBMODEL.get()); String expected = readValueOnlyFile("submodel.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeEntity() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serialiser.serialise(TestData.ENTITY); + String valueOnly = serialiser.serialise(TestData.ENTITY.get()); String expected = readValueOnlyFile("entity.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test - public void testSerializeProperty() throws ValueOnlySerializationException, IOException, JSONException { - String valueOnly = serialiser.serialise(TestData.PROPERTY_INT); + public void testSerializeIntProperty() throws ValueOnlySerializationException, IOException, JSONException { + String valueOnly = serialiser.serialise(TestData.PROPERTY_INT.get()); String expected = readValueOnlyFile("property_int.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeRange() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serialiser.serialise(TestData.RANGE_DOUBLE); + String valueOnly = serialiser.serialise(TestData.RANGE_DOUBLE.get()); String expected = readValueOnlyFile("range.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeBlob() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serialiser.serialise(TestData.BLOB); + String valueOnly = serialiser.serialise(TestData.BLOB.get()); String expected = readValueOnlyFile("blob.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeFile() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serialiser.serialise(TestData.FILE); + String valueOnly = serialiser.serialise(TestData.FILE.get()); String expected = readValueOnlyFile("file.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeMultiLangProperty() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serialiser.serialise(TestData.MULTI_LANGUAGE_PROPERTY); + String valueOnly = serialiser.serialise(TestData.MULTI_LANGUAGE_PROPERTY.get()); String expected = readValueOnlyFile("multi_lang_property.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializePropertyDouble() throws ValueOnlySerializationException, JSONException, IOException { - String valueOnly = serialiser.serialise(TestData.PROPERTY_DOUBLE); + String valueOnly = serialiser.serialise(TestData.PROPERTY_DOUBLE.get()); String expected = readValueOnlyFile("property_double.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializePropertyDatetime() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serialiser.serialise(TestData.PROPERTY_DATETIME); + String valueOnly = serialiser.serialise(TestData.PROPERTY_DATETIME.get()); String expected = readValueOnlyFile("date_time_property.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } + @Test + public void testSerializePropertyString() throws IOException, JSONException { + String valueOnly = serialiser.serialise(TestData.PROPERTY_STRING.get()); + String expected = readValueOnlyFile("property_string.json"); + JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); + } + @Test public void testSerializeRefElementGlobal() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serialiser.serialise(TestData.REFERENCE_ELEMENT_GLOBAL); + String valueOnly = serialiser.serialise(TestData.REFERENCE_ELEMENT_GLOBAL.get()); String expected = readValueOnlyFile("ref_element_global.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeAnnotatedRelationshipElement() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serialiser.serialise(TestData.ANNOTATED_RELATIONSHIP_ELEMENT); + String valueOnly = serialiser.serialise(TestData.ANNOTATED_RELATIONSHIP_ELEMENT.get()); String expected = readValueOnlyFile("ann_relationship_element.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } @Test public void testSerializeCollectionElement() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serialiser.serialise(TestData.ELEMENT_COLLECTION); + String valueOnly = serialiser.serialise(TestData.ELEMENT_COLLECTION.get()); String expected = readValueOnlyFile("element_collection.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); // failing @@ -117,7 +124,7 @@ public void testSerializeCollectionElement() throws IOException, ValueOnlySerial @Test public void testSerializeListElement() throws IOException, ValueOnlySerializationException, JSONException { - String valueOnly = serialiser.serialise(TestData.ELEMENT_LIST); + String valueOnly = serialiser.serialise(TestData.ELEMENT_LIST.get()); String expected = readValueOnlyFile("element_list.json"); JSONAssert.assertEquals(expected, valueOnly, JSONCompareMode.NON_EXTENSIBLE); } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java index 257695787..dd0446a88 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/valueonly/TestData.java @@ -15,6 +15,10 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.valueonly; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.util.function.Supplier; + import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; import org.eclipse.digitaltwin.aas4j.v3.model.Blob; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; @@ -22,29 +26,40 @@ import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; import org.eclipse.digitaltwin.aas4j.v3.model.File; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.Range; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; - -import java.time.ZoneOffset; -import java.time.ZonedDateTime; -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; public class TestData { - public static final Entity ENTITY = new DefaultEntity.Builder() + public static final Supplier ENTITY = () -> new DefaultEntity.Builder() .idShort("entity1") .entityType(EntityType.SELF_MANAGED_ENTITY) .globalAssetId("Global Asset Id") .statements(new DefaultProperty.Builder() - .idShort("MaxRotationSpeed") + .idShort("maxRotationSpeed") .valueType(DataTypeDefXsd.INT) .value("5000") .build()) @@ -55,13 +70,13 @@ public class TestData { .entityType(EntityType.CO_MANAGED_ENTITY) .globalAssetId("Global Asset Id Updated") .statements(new DefaultProperty.Builder() - .idShort("MaxRotationSpeed") + .idShort("maxRotationSpeed") .valueType(DataTypeDefXsd.INT) .value("5001") .build()) .build(); - public static final Property PROPERTY_STRING = new DefaultProperty.Builder() + public static final Supplier PROPERTY_STRING = () -> new DefaultProperty.Builder() .category("category") .idShort("propString") .value("foo") @@ -73,7 +88,7 @@ public class TestData { .value("foo updated") .build(); - public static final Range RANGE_DOUBLE = new DefaultRange.Builder() + public static final Supplier RANGE_DOUBLE = () -> new DefaultRange.Builder() .idShort("rangeDouble") .valueType(DataTypeDefXsd.DOUBLE) .min("3.0") @@ -87,7 +102,7 @@ public class TestData { .max("5.0") .build(); - public static final Blob BLOB = new DefaultBlob.Builder() + public static final Supplier BLOB = () -> new DefaultBlob.Builder() .idShort("blob1") .contentType("application/octet-stream") .value("example-data".getBytes()) @@ -99,7 +114,7 @@ public class TestData { .value("{ value: 42 }".getBytes()) .build(); - public static final File FILE = new DefaultFile.Builder() + public static final Supplier FILE = () -> new DefaultFile.Builder() .idShort("file1") .contentType("application/pdf") .value("SafetyInstructions.pdf") @@ -111,7 +126,7 @@ public class TestData { .value("SafetyInstructions.json") .build(); - public static final MultiLanguageProperty MULTI_LANGUAGE_PROPERTY = new DefaultMultiLanguageProperty.Builder() + public static final Supplier MULTI_LANGUAGE_PROPERTY = () -> new DefaultMultiLanguageProperty.Builder() .idShort("multiLanguageProp1") .value(new DefaultLangStringTextType.Builder().text("foo").language("de").build()) .value(new DefaultLangStringTextType.Builder() .text("bar").language("en").build()) @@ -123,7 +138,7 @@ public class TestData { .value(new DefaultLangStringTextType.Builder() .text("bar updated").language("de").build()) .build(); - public static final Property PROPERTY_DOUBLE = new DefaultProperty.Builder() + public static final Supplier PROPERTY_DOUBLE = () -> new DefaultProperty.Builder() .category("category") .idShort("propDouble") .valueType(DataTypeDefXsd.DOUBLE) @@ -137,7 +152,7 @@ public class TestData { .value("24.71") .build(); - public static final Property PROPERTY_DATETIME = new DefaultProperty.Builder() + public static final Supplier PROPERTY_DATETIME = () -> new DefaultProperty.Builder() .category("category") .idShort("propDateTime") .valueType(DataTypeDefXsd.DATE_TIME) @@ -151,7 +166,7 @@ public class TestData { .value(ZonedDateTime.of(2023, 7, 31, 17, 8, 51, 0, ZoneOffset.UTC).toString()) .build(); - public static final Property PROPERTY_INT = new DefaultProperty.Builder() + public static final Supplier PROPERTY_INT = () -> new DefaultProperty.Builder() .category("category") .idShort("propInt") .valueType(DataTypeDefXsd.INT) @@ -165,7 +180,7 @@ public class TestData { .value("24") .build(); - public static final Range RANGE_INT = new DefaultRange.Builder() + public static final Supplier RANGE_INT = () -> new DefaultRange.Builder() .idShort("rangeInt") .valueType(DataTypeDefXsd.INT) .min("17") @@ -179,7 +194,7 @@ public class TestData { .max("50") .build(); - public static final ReferenceElement REFERENCE_ELEMENT_GLOBAL = new DefaultReferenceElement.Builder() + public static final Supplier REFERENCE_ELEMENT_GLOBAL = () -> new DefaultReferenceElement.Builder() .idShort("referenceGlobal") .value(new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) .referredSemanticId(new DefaultReference.Builder() @@ -213,7 +228,7 @@ public class TestData { .build()) .build(); - public static final ReferenceElement REFERENCE_ELEMENT_MODEL = new DefaultReferenceElement.Builder() + public static final Supplier REFERENCE_ELEMENT_MODEL = () -> new DefaultReferenceElement.Builder() .idShort("referenceModel") .value(new DefaultReference.Builder() .type(ReferenceTypes.MODEL_REFERENCE) @@ -235,12 +250,12 @@ public class TestData { .build()) .build(); - public static final AnnotatedRelationshipElement ANNOTATED_RELATIONSHIP_ELEMENT = new DefaultAnnotatedRelationshipElement.Builder() + public static final Supplier ANNOTATED_RELATIONSHIP_ELEMENT = () -> new DefaultAnnotatedRelationshipElement.Builder() .idShort("annotatedRelationship1") - .first(REFERENCE_ELEMENT_GLOBAL.getValue()) - .second(REFERENCE_ELEMENT_MODEL.getValue()) - .annotations(PROPERTY_DATETIME) - .annotations(RANGE_INT) + .first(REFERENCE_ELEMENT_GLOBAL.get().getValue()) + .second(REFERENCE_ELEMENT_MODEL.get().getValue()) + .annotations(PROPERTY_DATETIME.get()) + .annotations(RANGE_INT.get()) .build(); public static final AnnotatedRelationshipElement ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED = new DefaultAnnotatedRelationshipElement.Builder() @@ -251,10 +266,10 @@ public class TestData { .annotations(RANGE_INT_UPDATED) .build(); - public static final RelationshipElement RELATIONSHIP_ELEMENT = new DefaultRelationshipElement.Builder() + public static final Supplier RELATIONSHIP_ELEMENT = () -> new DefaultRelationshipElement.Builder() .idShort("relationship1") - .first(REFERENCE_ELEMENT_GLOBAL.getValue()) - .second(REFERENCE_ELEMENT_MODEL.getValue()) + .first(REFERENCE_ELEMENT_GLOBAL.get().getValue()) + .second(REFERENCE_ELEMENT_MODEL.get().getValue()) .build(); @@ -264,12 +279,12 @@ public class TestData { .second(REFERENCE_ELEMENT_MODEL_UPDATED.getValue()) .build(); - public static final SubmodelElementCollection ELEMENT_COLLECTION = new DefaultSubmodelElementCollection.Builder() + public static final Supplier ELEMENT_COLLECTION = () -> new DefaultSubmodelElementCollection.Builder() .idShort("collection1") - .value(PROPERTY_STRING) - .value(RANGE_DOUBLE) - .value(ENTITY) - .value(RELATIONSHIP_ELEMENT) + .value(PROPERTY_STRING.get()) + .value(RANGE_DOUBLE.get()) + .value(ENTITY.get()) + .value(RELATIONSHIP_ELEMENT.get()) .build(); public static final SubmodelElementCollection ELEMENT_COLLECTION_UPDATED = new DefaultSubmodelElementCollection.Builder() @@ -280,12 +295,12 @@ public class TestData { .value(RELATIONSHIP_ELEMENT_UPDATED) .build(); - public static final SubmodelElementList ELEMENT_LIST = new DefaultSubmodelElementList.Builder() + public static final Supplier ELEMENT_LIST = () -> new DefaultSubmodelElementList.Builder() .idShort("list1") - .value(PROPERTY_STRING) - .value(RANGE_DOUBLE) - .value(ENTITY) - .value(ANNOTATED_RELATIONSHIP_ELEMENT) + .value(PROPERTY_STRING.get()) + .value(RANGE_DOUBLE.get()) + .value(ENTITY.get()) + .value(ANNOTATED_RELATIONSHIP_ELEMENT.get()) .build(); public static final SubmodelElementList ELEMENT_LIST_UPDATED = new DefaultSubmodelElementList.Builder() @@ -295,13 +310,14 @@ public class TestData { .value(ENTITY_UPDATED) .value(ANNOTATED_RELATIONSHIP_ELEMENT_UPDATED) .build(); - public static final Submodel SUBMODEL = new DefaultSubmodel.Builder() + + public static final Supplier SUBMODEL = () -> new DefaultSubmodel.Builder() .category("category") .idShort("submodel1") .kind(ModellingKind.INSTANCE) - .submodelElements(PROPERTY_STRING) - .submodelElements(RANGE_DOUBLE) - .submodelElements(ELEMENT_COLLECTION) + .submodelElements(PROPERTY_STRING.get()) + .submodelElements(RANGE_DOUBLE.get()) + .submodelElements(ELEMENT_COLLECTION.get()) .submodelElements(new DefaultOperation.Builder() .idShort("operation1") .build()) diff --git a/dataformat-json/src/test/resources/valueonly/element_collection.json b/dataformat-json/src/test/resources/valueonly/element_collection.json index 5b338df3f..ef42617c3 100644 --- a/dataformat-json/src/test/resources/valueonly/element_collection.json +++ b/dataformat-json/src/test/resources/valueonly/element_collection.json @@ -1,37 +1,47 @@ { - "propString" : "foo", - "rangeDouble" : { - "min" : 3.0, - "max" : 5.0 - }, - "entity1" : { - "statements": { - "maxRotationSpeed": 5000 + "collection1": { + "propString": "foo", + "rangeDouble": { + "min": 3.0, + "max": 5.0 }, - "globalAssetId": "Global Asset Id", - "entityType": "SelfManagedEntity" - }, - "relationship1" : { - "first" : { - "referredSemanticId" : { - "keys" : [ { - "type" : "ConceptDescription", - "value" : "Concept Description key value" - } ], - "type" : "ExternalReference" - }, - "keys" : [ { - "type" : "GlobalReference", - "value" : "global reference key value" - } ], - "type" : "ExternalReference" + "entity1": { + "statements": [ + { + "maxRotationSpeed": 5000 + } + ], + "globalAssetId": "Global Asset Id", + "entityType": "SelfManagedEntity" }, - "second" : { - "keys" : [ { - "type" : "Property", - "value" : "MaxRotationSpeed" - } ], - "type" : "ModelReference" + "relationship1": { + "first": { + "referredSemanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "Concept Description key value" + } + ], + "type": "ExternalReference" + }, + "keys": [ + { + "type": "GlobalReference", + "value": "global reference key value" + } + ], + "type": "ExternalReference" + }, + "second": { + "keys": [ + { + "type": "Property", + "value": "MaxRotationSpeed" + } + ], + "type": "ModelReference" + } } } } \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/element_list.json b/dataformat-json/src/test/resources/valueonly/element_list.json index a6d21d582..6d338fab2 100644 --- a/dataformat-json/src/test/resources/valueonly/element_list.json +++ b/dataformat-json/src/test/resources/valueonly/element_list.json @@ -1,54 +1,64 @@ [ - "foo", { - "min" : 3.0, - "max" : 5.0 + "propString": "foo" }, { - "statements": { - "MaxRotationSpeed": 5000 - }, - "globalAssetId": "Global Asset Id", - "specificAssetIds": { - "firstIdType": "someId", - "secondIdType": "someOtherId" - }, - "entityType": "SelfManagedEntity" + "rangeDouble": { + "min": 3.0, + "max": 5.0 + } }, { - "first" : { - "referredSemanticId" : { - "keys" : [ + "entity1": { + "statements": [ + { + "maxRotationSpeed": 5000 + } + ], + "globalAssetId": "Global Asset Id", + "entityType": "SelfManagedEntity" + } + }, + { + "annotatedRelationship1": { + "first": { + "referredSemanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "Concept Description key value" + } + ], + "type": "ExternalReference" + }, + "keys": [ { - "type" : "ConceptDescription", - "value" : "Concept Description key value" + "type": "GlobalReference", + "value": "global reference key value" } ], - "type" : "ExternalReference" + "type": "ExternalReference" }, - "keys" : [ + "second": { + "keys": [ + { + "type": "Property", + "value": "MaxRotationSpeed" + } + ], + "type": "ModelReference" + }, + "annotations": [ { - "type" : "GlobalReference", - "value" : "global reference key value" - } - ], - "type" : "ExternalReference" - }, - "second" : { - "keys" : [ + "propDateTime": "2022-07-31T17:08:51Z" + }, { - "type" : "Property", - "value" : "MaxRotationSpeed" + "rangeInt": { + "min": 17, + "max": 42 + } } - ], - "type" : "ModelReference" - }, - "annotations" : [ - "2022-07-31T17:08:51Z", - { - "min" : 17, - "max" : 42 - } - ] + ] + } } ] \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/entity.json b/dataformat-json/src/test/resources/valueonly/entity.json index 129ce2b1e..a5b8435a1 100644 --- a/dataformat-json/src/test/resources/valueonly/entity.json +++ b/dataformat-json/src/test/resources/valueonly/entity.json @@ -1,7 +1,11 @@ { - "statements": { - "MaxRotationSpeed": 5000 - }, - "globalAssetId": "Global Asset Id", - "entityType": "SelfManagedEntity" + "entity1": { + "statements": [ + { + "maxRotationSpeed": 5000 + } + ], + "globalAssetId": "Global Asset Id", + "entityType": "SelfManagedEntity" + } } \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/property_double.json b/dataformat-json/src/test/resources/valueonly/property_double.json index 324d35171..c97edc2f4 100644 --- a/dataformat-json/src/test/resources/valueonly/property_double.json +++ b/dataformat-json/src/test/resources/valueonly/property_double.json @@ -1,3 +1,3 @@ { - "propDouble": "42.17" + "propDouble": 42.17 } \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/property_int.json b/dataformat-json/src/test/resources/valueonly/property_int.json index 28dc7782f..74e12fe45 100644 --- a/dataformat-json/src/test/resources/valueonly/property_int.json +++ b/dataformat-json/src/test/resources/valueonly/property_int.json @@ -1,3 +1,3 @@ { - "propInt": "42" + "propInt": 42 } \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/property_string.json b/dataformat-json/src/test/resources/valueonly/property_string.json new file mode 100644 index 000000000..d7448dce7 --- /dev/null +++ b/dataformat-json/src/test/resources/valueonly/property_string.json @@ -0,0 +1,3 @@ +{ + "propString": "foo" +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/range.json b/dataformat-json/src/test/resources/valueonly/range.json index 67354262f..99a53d249 100644 --- a/dataformat-json/src/test/resources/valueonly/range.json +++ b/dataformat-json/src/test/resources/valueonly/range.json @@ -1,4 +1,6 @@ { - "min" : 3.0, - "max" : 5.0 + "rangeDouble": { + "min": 3.0, + "max": 5.0 + } } \ No newline at end of file diff --git a/dataformat-json/src/test/resources/valueonly/submodel.json b/dataformat-json/src/test/resources/valueonly/submodel.json index 1d9ac718d..94fb51efc 100644 --- a/dataformat-json/src/test/resources/valueonly/submodel.json +++ b/dataformat-json/src/test/resources/valueonly/submodel.json @@ -11,14 +11,12 @@ "max" : 5.0 }, "entity1" : { - "statements": { - "MaxRotationSpeed": 5000 - }, + "statements": [ + { + "maxRotationSpeed": 5000 + } + ], "globalAssetId": "Global Asset Id", - "specificAssetIds": { - "firstIdType": "someId", - "secondIdType": "someOtherId" - }, "entityType": "SelfManagedEntity" }, "relationship1" : {